/* Global Styles & Design System - Materiales Chilavert */

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--color-text-main);
    background-color: var(--color-bg-light);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.section {
    padding: 3rem 0;
    width: 100%;
    overflow: hidden;
}

.section.bg-light {
    background-color: var(--color-bg-alt);
}

.section-title {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 800;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
    font-family: inherit;
    line-height: 1.2;
}

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

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

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

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

.btn-whatsapp {
    background-color: var(--color-whatsapp);
    color: var(--color-white);
}

.btn-whatsapp:hover {
    background-color: var(--color-whatsapp-hover);
}

/* Header */
.site-header {
    background-color: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-top: 4px solid var(--color-accent);
    width: 100%;
    max-width: 100vw;
    overflow: visible;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: -0.5px;
    text-decoration: none;
    line-height: 1.15;
}

.main-nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--color-accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.4rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    line-height: 1;
}

/* Hero Section con Carrusel Vertical Cíclico */
.hero-slider-section {
    position: relative;
    overflow: hidden;
    min-height: 560px;
    height: 75vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background-color: #0f172a;
    padding-bottom: 2.5rem;
    width: 100%;
    max-width: 100vw;
}

.hero-slides-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    transform: translateY(0);
    z-index: 2;
}

.hero-slide.idle-bottom {
    opacity: 0;
    transform: translateY(100%);
    z-index: 1;
}

.hero-slide.animating.prev {
    opacity: 1;
    transform: translateY(0);
    animation: slideUpOut 0.95s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    z-index: 2;
}

.hero-slide.animating.active {
    opacity: 1;
    transform: translateY(100%);
    animation: slideUpIn 0.95s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    z-index: 3;
}

@keyframes slideUpOut {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

@keyframes slideUpIn {
    0% { transform: translateY(100%); }
    100% { transform: translateY(0); }
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--color-white);
    max-width: 740px;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 2rem 2.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    margin: 1rem;
    margin-bottom: 2rem;
    width: calc(100% - 2rem);
    box-sizing: border-box;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.hero-content p {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.hero-actions {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-slider-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 20;
}

.hero-indicator-dot {
    width: 9px;
    height: 9px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-indicator-dot.active {
    background: var(--color-accent);
    width: 26px;
}

/* Cards */
.card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: rgba(217, 4, 41, 0.3);
}

.card-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    box-sizing: border-box;
}

.card-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-img-placeholder {
    width: 100%;
    height: 180px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--color-border);
}

.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
    line-height: 1.3;
}

.card-desc {
    color: var(--color-text-light);
    font-size: 0.88rem;
    margin-bottom: var(--space-md);
    flex: 1;
    line-height: 1.45;
}

/* Carrusel de Marcas */
.brands-carousel-section {
    padding: 3rem 0;
    background: #ffffff;
    overflow: hidden;
    position: relative;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    width: 100%;
    max-width: 100vw;
}

.brands-carousel-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.brands-carousel-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.brands-track {
    display: flex;
    gap: 3.5rem;
    width: max-content;
    animation: scrollBrands 24s linear infinite;
    padding: 0.5rem 0;
    align-items: center;
}

.brands-track:hover {
    animation-play-state: paused;
}

.brand-item {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0.85;
}

.brand-item:hover {
    transform: scale(1.12);
    opacity: 1;
}

.brand-logo-img {
    height: 38px;
    max-width: 135px;
    object-fit: contain;
    display: block;
}

.brand-text-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-primary);
    white-space: nowrap;
}

@keyframes scrollBrands {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Banner CTA Institucional */
.home-cta-section {
    padding: 4rem 0;
    background: #f8fafc;
    border-top: 1px solid var(--color-border);
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.home-cta-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.75rem 2.25rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    width: 100%;
    box-sizing: border-box;
}

.home-cta-badge {
    color: var(--color-accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.home-cta-title {
    font-size: 2.2rem;
    color: var(--color-primary);
    line-height: 1.25;
    margin-bottom: 0.75rem;
    font-weight: 800;
}

.home-cta-desc {
    color: var(--color-text-main);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 680px;
    margin: 0;
}

/* Footer Profesional - 100% Ancho Real Sin Cortes */
.site-footer {
    background-color: #0b1120;
    color: #94a3b8;
    padding: 3.5rem 0 2rem;
    border-top: 3px solid var(--color-accent);
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    box-sizing: border-box;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1.5fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    width: 100%;
    box-sizing: border-box;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--color-accent);
}

.footer-col p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
    font-size: 0.92rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
}

.footer-col ul li i {
    color: var(--color-accent);
    font-size: 1rem;
    margin-top: 3px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.footer-col a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--color-accent);
}

.footer-schedule-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.footer-schedule-box strong {
    color: #ffffff;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 4px;
}

.footer-schedule-box span {
    font-size: 0.85rem;
    color: #cbd5e1;
    display: block;
    line-height: 1.4;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: #64748b;
    width: 100%;
}

/* Floating Action Button (WhatsApp) */
.fab-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-whatsapp);
    color: var(--color-white);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.fab-whatsapp:hover {
    transform: scale(1.1);
    background-color: var(--color-whatsapp-hover);
    color: white;
}

/* ===================================================
   RESPONSIVE MEDIA QUERIES (TABLETS & SMARTPHONES)
=================================================== */
@media (max-width: 900px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .container {
        padding: 0 0.85rem;
        width: 100%;
        max-width: 100%;
    }

    .header-container {
        height: 60px;
        padding: 0 0.75rem;
    }

    .logo {
        font-size: 1.05rem;
        max-width: 160px;
    }

    .site-header {
        overflow: visible !important;
    }

    .header-container {
        position: relative;
        overflow: visible !important;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 15px 30px rgba(0,0,0,0.25);
        padding: 1.25rem 1.5rem;
        border-bottom: 4px solid var(--color-accent);
        box-sizing: border-box;
        z-index: 1005;
    }
    
    .main-nav.active {
        display: block !important;
    }
    
    .main-nav ul {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .main-nav a {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--color-primary);
        display: block;
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--color-border);
        transition: color 0.2s ease, padding-left 0.2s ease;
    }

    .main-nav a:hover {
        color: var(--color-accent);
        padding-left: 5px;
    }

    .main-nav li:last-child a {
        border-bottom: none;
    }
    
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .header-cta {
        display: none;
    }

    .cart-btn-text {
        display: none;
    }

    .btn-cart-nav {
        padding: 0.4rem 0.65rem;
        font-size: 0.82rem;
    }

    /* Hero Responsive */
    .hero-slider-section {
        min-height: 480px;
        height: 68vh;
        padding-bottom: 1.5rem;
    }

    .hero-content {
        background: rgba(15, 23, 42, 0.32);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        border: 1px solid rgba(255, 255, 255, 0.25);
        padding: 1.15rem 0.9rem;
        margin: 0.5rem;
        margin-bottom: 1.25rem;
        border-radius: var(--radius-md);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
        width: calc(100% - 1rem);
    }

    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 0.35rem;
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 0.88rem;
        margin-bottom: 0.85rem;
        line-height: 1.35;
    }

    .hero-actions {
        flex-direction: column;
        gap: 0.45rem;
    }

    .hero-actions .btn {
        width: 100%;
        padding: 0.55rem 0.75rem;
        font-size: 0.85rem;
    }

    .hero-slider-indicators {
        bottom: 5px;
    }

    /* Grids */
    .grid-4, .grid-3 {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        width: 100%;
    }

    .card {
        width: 100%;
    }

    .card-img-wrapper {
        height: 170px;
    }

    .home-cta-card {
        flex-direction: column;
        text-align: center;
        padding: 1.75rem 1.25rem;
        gap: 1.25rem;
    }

    .home-cta-title {
        font-size: 1.55rem;
    }

    .home-cta-desc {
        font-size: 0.92rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        width: 100%;
    }

    .brands-track {
        gap: 2.5rem;
    }
}

/* Controles de Cantidad en Tarjetas de Catálogo */
.card-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.card-qty-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
}

.card-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
}

.card-qty-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.card-qty-btn:hover {
    background: #e2e8f0;
}

.card-qty-input {
    width: 44px;
    height: 32px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-primary);
    -moz-appearance: textfield;
}

.card-qty-input::-webkit-outer-spin-button,
.card-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Selector de Variantes / Medidas */
.variant-selector-box {
    margin-bottom: 1.25rem;
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.variant-selector-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.variant-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.variant-pill {
    padding: 0.4rem 0.85rem;
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    background: #f8fafc;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.variant-pill:hover {
    border-color: var(--color-accent);
    background: #ffffff;
}

.variant-pill.active {
    background: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(217, 4, 41, 0.35);
}
