/**
 * ==================== ESTILOS DE PRODUCTOS ====================
 * 
 * Contiene todos los estilos relacionados con:
 * - Tarjetas de productos (vista general)
 * - Vista de detalle de productos (fullscreen)
 * - Navegación entre productos
 * - Transiciones y animaciones
 */

/* ==================== PRODUCTOS GENERAL SECTION ==================== */
.productos-general-section {
    padding: 120px 0; /* Aumentar padding superior para separar del mobile */
    background-color: #ffffff;
    width: 100%;
    margin-top: 80px; /* Agregar margen superior para más separación */
    position: relative;
    z-index: 1; /* Z-index bajo para no interferir con mobile */
}

.productos-general-header {
    text-align: center;
    margin-bottom: 60px;
}

.productos-general-subtitle {
    margin-bottom: var(--spacing-xs);
    color: #666666;
}

.productos-general-title {
    color: #333333;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .productos-general-title {
        font-size: 24px !important;
    }
}

/* Estilos comunes de las cards - Aplicables a todos los tamaños */
.producto-card {
    background-color: #ffffff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
    cursor: pointer;
}

.producto-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.producto-card:active {
    opacity: 0.8;
}

.producto-card-image {
    width: 100%;
    height: 350px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.producto-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.producto-card-content {
    background-color: #ffffff;
    padding: 25px;
}

.producto-card-nombre {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.producto-descripcion {
    font-size: 14px;
    color: #666;
    font-family: 'Montserrat', sans-serif;
    margin: 0 0 40px 0;
    line-height: 1.4;
    white-space: pre;
}

.producto-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.producto-precio-nuevo {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.precio-simbolo {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    font-family: 'Montserrat', sans-serif;
}

.precio-numero {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    font-family: 'Montserrat', sans-serif;
}

.btn-comprar {
  display: flex;
  align-items: center;
  border: none;
  background-color: #000;
  color: #fff;
  width: 62%;
}

.btn-comprar:hover {
    background-color: #333;
}

.btn-comprar svg {
    width: 16px;
    height: 16px;
}



.btn-comprar .btn-icon {
  aspect-ratio: 1 / 1; /* asegura que sea cuadrado */
  height: 100%;        /* ocupa todo el alto del botón */
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-comprar .btn-text {
  flex: 1;             /* ocupa el espacio restante */
  height: 100%;
  padding: 10px 0px;
  display: flex;
  align-items: center;
  justify-content: center; /* opcional */
}




/* Estilos base para mobile */
.productos-cards-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 0 20px;
}

/* Estilos de desktop - Solo para pantallas grandes */
@media (min-width: 969px) {
    .productos-cards-container {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 40px;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
        flex-wrap: wrap;
    }

    .producto-card {
        flex: 1;
        max-width: 350px;
        min-width: 280px;
    }
}

/* ==================== PRODUCTOS DETALLE SECTION ==================== */
.productos-section {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
    z-index: 5;
    will-change: opacity;
    background-color: #1a1a1a;
}

.productos-section.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s ease, visibility 0s linear 0s;
}

/* Capa de fondo con imagen (dos capas para crossfade) */
.producto-fondo-imagen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.6s ease;
    z-index: 1;
}

.fondo-capa-1 {
    z-index: 2;
}

.fondo-capa-2 {
    z-index: 1;
    opacity: 0;
}

/* Botón de cierre */
.btn-cerrar-producto {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-cerrar-producto:hover {
    opacity: 0.6;
}

.btn-cerrar-producto svg {
    color: #333;
}

/* Logo en detalle de producto */
.producto-logo {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 15;
    height: 30px;
}

.producto-logo img {
    height: 100%;
    width: auto;
    filter: brightness(0);
}

/* Animaciones de entrada */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Aplicar animaciones en desktop - Solo en apertura inicial */
@media (min-width: 769px) {
    /* Estas animaciones solo se aplican en la primera apertura, no durante navegación */
    .productos-section.active:not(.already-opened) .producto-titulo-principal {
        animation: slideInFromLeft 0.6s ease-out forwards;
    }
    
    .productos-section.active:not(.already-opened) .producto-perfil-container {
        animation: slideInFromLeft 0.6s ease-out 0.1s forwards;
        opacity: 0;
    }
    
    .productos-section.active:not(.already-opened) .producto-parrafo-izq {
        animation: slideInFromLeft 0.6s ease-out 0.2s forwards;
        opacity: 0;
    }
    
    .productos-section.active:not(.already-opened) .producto-parrafo-der {
        animation: slideInFromRight 0.6s ease-out 0.2s forwards;
        opacity: 0;
    }
}

/* Botón Siguiente */
.btn-siguiente-producto {
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-siguiente-producto:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.btn-siguiente-producto:hover svg {
    color: white;
}

.btn-siguiente-producto svg {
    color: #333;
    transition: color 0.3s ease;
}

/* Botón Anterior */
.btn-anterior-producto {
    position: absolute;
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-anterior-producto:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.btn-anterior-producto:hover svg {
    color: white;
}

.btn-anterior-producto svg {
    color: #333;
    transition: color 0.3s ease;
}

/* Título Principal - Fila 1 (23% desde arriba, 13% desde izquierda) */
.producto-titulo-principal {
    position: absolute;
    top: 23%;
    left: 13%;
    z-index: 100;
}

.producto-titulo-principal h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: #000;
    text-align: center;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .producto-titulo-principal h2 {
        font-size: 24px !important;
    }
}

.titulo-linea1,
.titulo-linea2 {
    margin: 0;
}

/* Perfil/Notas Container - 55% desde arriba, 8% desde izquierda */
.producto-perfil-container {
    position: absolute;
    top: 50%;
    left: 8%;
    width: 30%;
    z-index: 100;
}

.parrafo-perfil {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    white-space: pre-line;
    font-weight: 400;
}

.parrafo-perfil strong {
    color: #101010;
    font-weight: 600;
}

/* Párrafos Container - Fila 2 (60% desde arriba, 8% desde izquierda y derecha = 84% ancho) */
.producto-parrafos-container {
    position: absolute;
    top: 62%;
    left: 8%;
    width: 84%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
    z-index: 100;
}

/* Estilos de desktop para párrafos */
@media (min-width: 769px) {
    .producto-parrafos-container {
        overflow: visible;
    }
    
    /* Párrafo Izquierdo y Derecho - Cada uno ocupa 30% del ancho total */
    .producto-parrafo-izq,
    .producto-parrafo-der {
        width: 30%;
        text-align: left;
        position: relative;
    }
    
    /* Rectángulo blanco - Izquierdo - 1/3 desde borde izquierdo */
    .producto-parrafo-izq::before {
        content: '';
        position: absolute;
        top: 50%;
        left: calc(-8vw);
        width: calc(13.33% + 8vw);
        height: 140%;
        transform: translateY(-50%);
        background-color: white;
        z-index: -1;
    }

    /* Rectángulo gris - Derecho - 2/3 desde borde derecho */
    .producto-parrafo-der::before {
        content: '';
        position: absolute;
        top: 50%;
        right: calc(-8vw);
        width: calc(86.66% + 8vw);
        height: 140%;
        transform: translateY(-50%);
        background-color: #e8e8e8;
        z-index: -1;
    }
}

.parrafo-titulo {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.4;
}

.parrafo-texto {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    white-space: pre-line;
}

/* Rectángulo de color - 90% desde arriba, borde izquierdo */
.producto-rectangulo-color {
    position: absolute;
    top: 90%;
    left: 0;
    width: 11.5%;
    height: 3%;
    background-color: #1ec9d9;
    z-index: 100;
    transition: background-color 0.3s ease;
}

/* Botón cambiar párrafo - Oculto por defecto (solo móvil) */
.btn-cambiar-parrafo {
    display: none;
}

/* Botón comprar en detalle - Desktop alineado con rectángulo */
.btn-comprar-detalle {
    position: absolute;
    top: 90%;
    right: 8%;
    transform: translateY(-50%);
    z-index: 15;
    background-color: #000;
    color: #fff;
    border: none;
    padding: 12px 50px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease;
    border-radius: 0;
}

.btn-comprar-detalle:hover {
    background-color: #333;
}

.btn-comprar-detalle svg {
    width: 18px;
    height: 18px;
}

/* ==================== ANIMACIONES DE NAVEGACIÓN ==================== */
@keyframes slideOutRight {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(60px);
    }
}

@keyframes slideOutLeft {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-60px);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-60px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(60px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-out-right {
    animation: slideOutRight 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards !important;
}

.slide-out-left {
    animation: slideOutLeft 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards !important;
}

.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

/* ==================== LAYOUT CONTAINERS ==================== */
/* Desktop layout visible by default */
.producto-layout-desktop {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Mobile layout hidden by default */
.producto-layout-mobile {
    display: none;
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: #ffffff;
    padding-bottom: 100px; /* Espacio para el footer fijo + margen extra */
}

/* ==================== MOBILE LAYOUT STYLES ==================== */
/* DIV 1: Contenedor Principal */
.mobile-main-container {
    position: relative;
    width: 100vw;
    height: 140vw; /* 110% + 30% del ancho */
}

/* DIV 11: Información Principal del Producto */
.mobile-product-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 110vw;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 25px 25px 20px 25px;
    box-sizing: border-box;
    overflow: hidden;
    transition: background-image 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Animación de entrada para la imagen de fondo - al abrir */
.productos-section.active:not(.already-opened) .mobile-product-info {
    animation: mobileBackgroundSlideUp 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Animación al cambiar de producto - salida (sube) */
.mobile-product-info.animating-out {
    animation: mobileBackgroundSlideOut 0.4s cubic-bezier(0.4, 0.0, 0.6, 1) forwards;
}

/* Animación al cambiar de producto - entrada (sube desde abajo) */
.mobile-product-info.animating-in {
    animation: mobileBackgroundSlideIn 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

@keyframes mobileBackgroundSlideUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes mobileBackgroundSlideOut {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes mobileBackgroundSlideIn {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animaciones para cambio de producto en mobile */
@keyframes mobileContentSlideUp {
    0% {
        transform: translateY(40px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-product-info.animating-content .mobile-info-left,
.mobile-product-info.animating-content .mobile-info-right {
    animation: mobileContentSlideUp 0.7s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.mobile-info-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.mobile-info-right {
    display: flex;
    align-items: flex-end;
}

.mobile-puntos {
    font-size: 13px;
    font-weight: 400;
    color: #000000;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-proceso {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-peso {
    font-size: 13px;
    font-weight: 400;
    color: #000000;
    font-family: 'Montserrat', sans-serif;
}

/* DIV 12: Galería de Selección */
.mobile-gallery-selector {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vw;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.mobile-gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.mobile-gallery-item.active {
    opacity: 1;
}

.mobile-gallery-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.mobile-gallery-item:active .mobile-gallery-bg {
    transform: scale(0.95);
}

/* DIV 2: Descripción y Textos del Café */
.mobile-description-container {
    position: relative;
    width: 100%;
    padding: 25px 25px 40px 25px;
    box-sizing: border-box;
    background-color: #ffffff;
}

.mobile-description-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    text-align: left;
}

.mobile-description-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-description-notas {
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-description-parrafos {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-parrafo-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* DIV 3: Precio y Botón de Compra */
.mobile-purchase-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    box-sizing: border-box;
    z-index: 15;
}

.mobile-price {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.mobile-btn-comprar {
    background-color: #000;
    color: #fff;
    width: 60%;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
}

.mobile-btn-comprar:active {
    background-color: #333;
}

.mobile-btn-text {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
}

.mobile-btn-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* ==================== RESPONSIVE - MOBILE ==================== */
@media (max-width: 768px) {
    /* Permitir scroll en la sección de productos */
    .productos-section {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ocultar layout desktop */
    .producto-layout-desktop {
        display: none !important;
    }
    
    /* Mostrar layout mobile */
    .producto-layout-mobile {
        display: block !important;
    }
    
    /* Ocultar logo en mobile */
    .producto-logo {
        display: none;
    }
    
    /* Botón de cerrar como flecha atrás */
    .btn-cerrar-producto {
        display: flex !important;
        position: fixed;
        top: 20px;
        left: 20px;
        width: 40px;
        height: 40px;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        z-index: 16;
    }
    
    .btn-cerrar-producto svg {
        color: #333;
    }
    
    /* Ocultar botones de navegación en mobile */
    .btn-siguiente-producto,
    .btn-anterior-producto {
        display: none;
    }
    
    /* Ocultar fondos de imagen en mobile (usamos el del DIV 11) */
    .producto-fondo-imagen {
        display: none;
    }
}
