/* --- EFECTO PORTAL CLIP-PATH --- */
.catalog-portal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-color);
  display: block; /* Cambiado para permitir scroll natural en las galerías */
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  overflow-y: auto;
  padding: 80px 5% 40px;
  z-index: 3000;
}

.catalog-portal.active {
  clip-path: circle(150% at 50% 50%);
}

/* --- CONTROLES GENERALES DEL PORTAL --- */
.btn-close-portal {
  position: fixed;
  top: 30px;
  right: 30px; /* Cambiado a la derecha para no chocar con el botón volver */
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 50px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3010;
}

.btn-close-portal:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}

.btn-back-view {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.btn-back-view:hover {
  background: var(--primary-color);
  color: white;
}

/* --- SISTEMA DE VISTAS (SPA) --- */
.view-section {
  display: none; /* Ocultas por defecto */
  animation: fadeInView 0.5s ease forwards;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.view-section.active-view {
  display: block; /* Solo se muestra la vista activa */
}

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-title {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 30px;
  text-align: center;
}

/* --- VISTA 1: PANTALLA DIVIDIDA (SPLIT SCREEN) --- */
.op2-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
  height: calc(100vh - 160px); /* Ocupa casi toda la pantalla */
  min-height: 500px;
}

.op2-card {
  flex: 1;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: flex 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.op2-card:hover { flex: 1.4; }

.op2-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.2));
  z-index: 1;
  transition: 0.4s;
}

.op2-card:hover::before { background: linear-gradient(to top, rgba(212, 106, 78, 0.9), rgba(0,0,0,0.4)); }

.op2-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.8s ease;
}

.op2-card:hover .op2-bg { transform: scale(1.1); }

.op2-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  padding: 30px;
}

.op2-content h3 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 15px;
  font-family: "Playfair Display", serif;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.op2-content p {
  margin-bottom: 25px;
  font-size: 1.1rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
  max-width: 400px;
  margin: 0 auto 25px auto;
}

.op2-btn {
  display: inline-block;
  padding: 12px 30px;
  border: 2px solid white;
  border-radius: 50px;
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: 0.3s;
  letter-spacing: 1px;
}

.op2-card:hover .op2-btn { background: white; color: var(--accent-color); }

/* --- VISTAS 2 Y 3: GALERÍAS DE PRODUCTOS --- */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  width: 100%;
}

.product-card {
  background: #fff;
  border: 1px solid var(--light-gray);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1; /* Esto fuerza a que la imagen sea un cuadrado perfecto */
  height: auto;        /* Sustituye al antiguo height: 220px; */
  object-fit: cover;
  border-radius: 8px;
}

.product-card h3 {
  margin: 20px 0 15px;
  color: var(--primary-color);
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
}

.product-card .btn { width: 100%; }

/* --- ADAPTACIÓN MÓVIL --- */
@media (max-width: 768px) {
  .catalog-portal { padding-top: 90px; }
  .btn-close-portal { top: 20px; right: 20px; padding: 10px 15px; font-size: 0.7rem; }
  .op2-container { flex-direction: column; height: auto; min-height: 80vh; }
  .op2-card { min-height: 35vh; }
  .op2-card:hover { flex: 1.1; }
  .op2-content h3 { font-size: 2rem; }
  .view-title { font-size: 1.8rem; }
}
