/* styles.css - Carrocerías Chama - Versión Profesional */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #FFC31F;        /* Amarillo dorado - SOLO para acentos importantes */
    --primary-dark: #EB8107;    /* Naranja - hover estados */
    --dark: #1F1F1F;           /* Negro - textos y fondos importantes */
    --gray-dark: #4B4847;       /* Gris oscuro - textos secundarios */
    --gray-light: #E6E1DB;      /* Beige - fondo general sutil */
    --white: #FFFFFF;           /* Blanco - tarjetas y contrastes */
    
    /* Sombras profesionales */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --border-radius: 12px;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--white);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    touch-action: pan-y;
}

/* HEADER - Minimalista y profesional */
.main-header {
    background-color: var(--white);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 20px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.5rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.menu-toggle:active {
    background: rgba(0,0,0,0.05);
}

.header-logo {
    max-height: 150px;
    width: auto;
    object-fit: contain;
}

.header-spacer {
    width: 44px;
}

/* Menú desplegable - limpio */
.dropdown-menu {
    display: none;
    background: var(--white);
    border-top: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-md);
}

.dropdown-menu.open {
    display: block;
}

.dropdown-menu ul {
    list-style: none;
    padding: 8px 0;
}

.dropdown-menu li a {
    display: block;
    padding: 14px 24px;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu li a:active {
    background: var(--gray-light);
}

/* CHIPS DE ACCIÓN - estilo moderno */
.actions-carousel-container {
    padding: 20px 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.actions-carousel-container::-webkit-scrollbar {
    display: none;
}

.actions-carousel {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    width: max-content;
}

.action-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--primary);
    border: none;
    border-radius: 40px;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.action-chip i {
    color: var(--dark);
    font-size: 1rem;
}

.action-chip:active {
    background: var(--primary-dark);
    color: var(--dark);
}

.action-chip:active i {
    color: var(--dark);
}

/* CARRUSEL DE BANNERS - elegante */
.banners-section {
    padding: 8px 0 0px;
    position: relative;
}

.banners-carousel {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.banners-carousel::-webkit-scrollbar {
    display: none;
}

.banner-item {
    flex: 0 0 280px;
    height: 350px;
    border-radius: 24px;
    overflow: visible;
    scroll-snap-align: center;
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255,255,255,0.2);
}


.banner-item:active {
    transform: scale(0.98);
}

.banner-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.banner-item:hover .banner-img,
.banner-item:active .banner-img {
    transform: scale(1.02);
}

/* Efecto de brillo sutil en los bordes */
.banner-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.5);
    pointer-events: none;
}

.banners-indicators {
    display: none;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.banner-indicator {
    width: 4px;
    height: 4px;
    border-radius: 2px;
    background: var(--gray-dark);
    opacity: 0.3;
    transition: all 0.3s;
}

.banner-indicator.active {
    width: 20px;
    opacity: 1;
    background: var(--primary);
}

/* CARRUSEL DE CATEGORÍAS - estilo profesional con imágenes que sobresalen */
.categories-carousel-container {
    padding: 50px 0 20px;  /* Espacio arriba para que sobresalgan */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    margin-bottom: 10px;
    width: 100%;
    max-width: 100vw;
    min-height: 140px;
}

.categories-carousel-container::-webkit-scrollbar {
    display: none;
}

.categories-carousel {
    display: flex;
    gap: 15px;
    padding: 0 20px;
    width: max-content;
    height: 100%;
    min-height: 140px;
    min-width: 100%;
    align-items: flex-start;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 110px;
    height: 100px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 12px 5px 0 5px;  
    flex-shrink: 0;
}

/* Título arriba */
.category-card span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 2;  /* Por encima de la imagen */
    margin-top: 5px;
    line-height: 1.2;
}

/* La imagen SOBRESALE por arriba */
.category-card img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    position: absolute;
    top: 25px; 
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));
    z-index: 1; 
    pointer-events: none;
}

/* Versión activa (seleccionada) - Fondo AMARILLO */
.category-card.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(255, 195, 31, 0.3);
}

.category-card.active span {
    color: var(--dark);
    font-weight: 700;
}

.category-card.active img {
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.2)); /* Sombra normal */
    opacity: 1;  /* Sin oscurecer */
}

/* Efecto al presionar (solo móvil) */
.category-card:active {
    transform: scale(0.96);
}

/* Ajustes para pantallas más grandes */
@media (min-width: 600px) {
    .category-card {
        width: 120px;
        height: 130px;
    }
    
    .category-card span {
        font-size: 0.9rem;
    }
    
    .category-card img {
        width: 110px;
        height: 110px;
        top: 30px;
    }
}

/* TÍTULOS DE SECCIÓN - elegantes */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 20px 16px;
    color: var(--dark);
    letter-spacing: -0.02em;
}

/* GRID DE PRODUCTOS - limpio y profesional */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px 30px;
}

.product-item {
    background: var(--white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.03);
}

.product-item:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: var(--gray-light);
}

.product-info {
    padding: 12px 8px;
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--dark);
    line-height: 1.3;
}

.product-category {
    font-size: 0.75rem;
    color: var(--gray-dark);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* PANTALLA DE DETALLE DE PRODUCTO */
#productDetailScreen {
    background: var(--white);
    min-height: 100vh;
}

.detail-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--white);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 12px;
}

.back-btn {
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.3rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.back-btn:active {
    background: rgba(0,0,0,0.05);
}

.detail-header-title {
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
    color: var(--dark);
}

.detail-content {
    padding: 20px;
}

.main-image-container {
    width: 100%;
    /* 👇 CAMBIAR el aspect-ratio */
    aspect-ratio: auto;  /* o eliminar esta línea */
    min-height: 250px;
    max-height: 350px;
    background: var(--gray-light);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* CAMBIAR de cover a contain */
    object-position: center;
    background: var(--gray-light);
}

.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Miniaturas */
.thumbnail-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 16px;
    scrollbar-width: none;
}

.thumbnail-carousel::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    flex: 0 0 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, border 0.2s;
    border: 2px solid transparent;
    background: var(--gray-light);
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--primary);
}


.product-info-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.product-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gray-dark);
    margin-bottom: 20px;
}

.product-features {
    background: var(--gray-light);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 24px;
}

.product-features h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.9rem;
    color: var(--gray-dark);
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-icon {
    color: var(--primary);
    font-size: 1rem;
    width: 20px;
}

.contact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--dark);
    color: white;
    text-decoration: none;
    padding: 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 16px;
    width: 100%;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.contact-button i {
    color: var(--primary);
    font-size: 1.2rem;
}

.contact-button:active {
    background: #000;
}

/* MODALES */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: var(--white);
    width: 95%;           /* un poco más ancho */
    max-width: 900px;     /* máximo más grande */
    margin: 40px auto;    /* menos margen superior */
    border-radius: 24px;
    position: relative;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-dark);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:active {
    background: rgba(0,0,0,0.05);
}

.modal-logo {
    height: 48px;
    display: block;
    margin: 0 auto 16px;
    object-fit: contain;
}

.modal-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
}

.modal-text {
    line-height: 1.6;
    color: var(--gray-dark);
    font-size: 0.95rem;
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 8px;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.gallery-img {
    width: 100%;
    height: auto;
    min-height: 300px;      /* altura mínima */
    max-height: 500px;      /* altura máxima */
    object-fit: contain;
    object-position: center;
    border-radius: 20px;
    background: white;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.05);
}


.gallery-img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}


/* FOOTER - minimalista */
.site-footer {
    background: var(--white);
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 24px 20px;
    text-align: center;
    margin-top: auto;
}

.copyright-text {
    color: var(--gray-dark);
    font-size: 0.85rem;
    margin-bottom: 8px;
}


/* TOAST */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    transform: none;
    background: var(--dark);
    color: white;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 0.9rem;
    display: none;
    z-index: 2000;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

/* ============================================
   SELECTOR DE VARIANTES (2 ejes / 3 ejes)
   ============================================ */
.variant-selector {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--white);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.variant-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--gray-light);
    border: none;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.variant-btn.active {
    background: var(--primary);
    color: var(--dark);
}

.variant-btn:active {
    transform: scale(0.96);
}

/* ============================================
   CÓDIGO DE PRODUCTO
   ============================================ */
.product-code {
    background: var(--gray-light);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-bottom: 16px;
    display: inline-block;
}

.product-code strong {
    color: var(--dark);
}

/* ============================================
   BOTÓN FICHA TÉCNICA
   ============================================ */
.tech-sheet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gray-light);
    color: var(--dark);
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.tech-sheet-btn i {
    color: #e74c3c;
    font-size: 1.1rem;
}

.tech-sheet-btn:active {
    background: var(--gray-dark);
    color: var(--white);
}

.tech-sheet-btn:active i {
    color: var(--white);
}

/* ============================================
   MODAL PDF
   ============================================ */
.pdf-modal .modal-content {
    width: 95%;
    max-width: 1000px;
    height: 90vh;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdf-modal .pdf-container {
    flex: 1;
    width: 100%;
    height: calc(90vh - 50px);
    background: #f5f5f5;
}

.pdf-modal iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-modal .close-modal {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    z-index: 10;
}

.pdf-modal .close-modal:active {
    background: rgba(0,0,0,0.8);
}

/* styles.css - Agregar al final del archivo */

/* Mejorar el modal PDF */
.pdf-modal {
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.7);
}

.pdf-modal .modal-content {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.pdf-modal .pdf-container {
    flex: 1;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    position: relative;
}

.pdf-modal iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Mejorar el botón de cierre */
.pdf-modal .close-modal {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pdf-modal .close-modal:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.pdf-modal .close-modal:active {
    transform: scale(0.95);
}

/* Añadir un pequeño mensaje para indicar cómo cerrar */
.pdf-modal::before {
    content: "✕ Haz clic fuera del PDF para cerrar";
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 1002;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

/* Ocultar el mensaje en pantallas pequeñas */
@media (max-width: 768px) {
    .pdf-modal::before {
        content: "✕ Toca fuera para cerrar";
        bottom: 10px;
        font-size: 0.7rem;
        white-space: nowrap;
    }
}

/* Animación de entrada para el modal */
.pdf-modal {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

.pdf-modal .modal-content {
    animation: slideUp 0.3s ease;
}

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