/* General Styles */
* {
    box-sizing: border-box;
    max-width: 100%;
}

html, body {
    overflow-x: hidden;
}

:root {
    --primary-navy: #14532d; /* Verde Oscuro Profesional */
    --secondary-blue: #22c55e; /* Verde Logo */
    --accent-red: #b91c1c;
    --light-blue: #f0fdf4; /* Verde muy claro para fondos */
    --text-main: #2d3748;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background-color: #ffffff;
    width: 100%;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

.top-bar .container,
.main-header .container,
.full-width {
    width: 98% !important;
    max-width: none !important;
    padding: 0 1%;
}

.main-header .container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

.button {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 45%, #991b1b 55%, #b91c1c 100%);
    color: white;
    padding: 14px 40px;
    font-size: 1.1rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border: none;
}

/* Header Styles */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.top-bar {
    background: linear-gradient(180deg, #1a6336 0%, #14532d 45%, #0d3d21 55%, #14532d 100%);
    color: #ffffff;
    padding: 10px 0;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.top-bar .container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.track-btn-top {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 8px 25px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: 0.3s;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.track-btn-top:hover {
    background: linear-gradient(180deg, #004ecc 0%, #003da6 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 97, 255, 0.5);
}

.main-header {
    padding: 20px 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.logo a { display: flex; align-items: center; gap: 20px; }
.logo img { height: 110px; width: auto; display: block; }
.logo .slogan {
    font-size: 15px; color: var(--primary-navy); font-style: italic;
    border-left: 2px solid var(--accent-red); padding: 5px 0 5px 15px;
    max-width: 220px; line-height: 1.3; font-weight: 600;
}

.search-bar { display: flex; width: 100%; max-width: 500px; }
.search-bar input {
    padding: 12px 20px; border: 1px solid var(--border-color);
    border-radius: 25px 0 0 25px; flex: 1; outline: none;
    background-color: #ffffff;
}

.search-bar button {
    background: linear-gradient(180deg, #1a6336 0%, #14532d 45%, #0d3d21 55%, #14532d 100%);
    color: white;
    border: none; padding: 12px 20px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    font-weight: bold;
}

.cart-btn-header {
    position: fixed;
    right: 20px;
    top: 120px;
    z-index: 2500;
    cursor: pointer;
    background: linear-gradient(180deg, #1a6336 0%, #14532d 45%, #0d3d21 55%, #14532d 100%);
    color: white;
    padding: 12px 22px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.cart-btn-header:hover { transform: scale(1.05); background-color: var(--secondary-blue); }
#cart-count { background: var(--accent-red); padding: 2px 7px; border-radius: 10px; font-size: 11px; }

nav {
    background: linear-gradient(180deg, #1a6336 0%, #14532d 45%, #0d3d21 55%, #14532d 100%);
    color: white;
    padding: 5px 0;
}
nav ul {
    list-style: none; padding: 0; margin: 0;
    display: flex; justify-content: space-between; width: 100%;
}
nav a {
    color: #e2e8f0;
    display: block;
    padding: 12px 25px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}
nav a:hover { color: #ffffff; background-color: rgba(255,255,255,0.1); }

/* Hero Carousel - Lateral Scroll Continuous */
.hero {
    position: relative; min-height: 600px;
    display: flex; align-items: center;
    text-align: center;
    overflow: hidden; color: white;
}
.hero-carousel {
    position: absolute; top: 0; left: 0; height: 100%;
    display: flex; width: calc(100vw * 10); z-index: -2;
    animation: scrollHero 100s linear infinite;
}
.hero::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 37, 64, 0.65); z-index: -1; /* Azul profundo para seriedad en el carrusel */
}
.slide {
    flex: 0 0 100vw; height: 100%;
    background-size: cover; background-position: center;
}
@keyframes scrollHero {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100vw * 5)); }
}
.hero h1 {
    font-size: 3.5em; font-weight: 800; margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Categories Grid */
.categories-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px; 
    padding: 40px 0;
    width: 100%;
}
.category {
    text-align: center; padding: 30px 20px;
    background: #ffffff; border: 1px solid var(--border-color);
    border-radius: 12px; transition: all 0.4s ease;
}
.category:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.05); border-color: var(--secondary-blue); }

.product-img-container {
    width: 100%;
    height: 200px; /* Altura uniforme para todos los cuadros */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 15px;
}

.product-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ajusta la imagen sin deformarla */
}

.category h3 { font-size: 1.4em; color: var(--primary-navy); font-weight: 700; }

/* Brand Carousel */
.brands-carousel { background: #f8fafc; padding: 40px 0; overflow: hidden; border-top: 1px solid var(--border-color); }
.brands-track { display: flex; width: calc(200px * 16); animation: scrollBrands 30s linear infinite; }
.brand { width: 200px; display: flex; align-items: center; justify-content: center; font-size: 1.2em; font-weight: 800; color: var(--primary-navy); opacity: 0.5; }
.brand img { height: 1.25em; width: auto; filter: grayscale(100%); margin-right: 10px; }
@keyframes scrollBrands {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-200px * 8)); }
}

/* Modal Who We Are */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(10, 37, 64, 0.85); align-items: flex-start; justify-content: center; backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 40px 10px;
}
.modal-content {
    background: white; border-radius: 15px; width: 95%; max-width: 1000px;
    display: flex; overflow: hidden; position: relative;
    animation: slideIn 0.4s ease-out;
}
.modal-image-container { flex: 1; min-height: 300px; position: relative; }
.modal-image-container img { width: 100%; height: 100%; object-fit: cover; }
.modal-image-container::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(to right, transparent 60%, white 100%);
}
.modal-text-container { flex: 1.2; padding: 40px; }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close { 
    position: absolute; right: 15px; top: 15px; font-size: 24px; cursor: pointer; 
    color: var(--primary-navy); z-index: 100; 
    background: white; 
    width: 35px; height: 35px; 
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-weight: bold;
    line-height: 1;
}

/* Cart Modal */
.cart-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 3000; justify-content: center; align-items: center;
}
.cart-content {
    background: white; padding: 30px; border-radius: 12px; width: 90%; max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.cart-item-list { list-style: none; padding: 0; margin: 20px 0; max-height: 300px; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-color); }

/* Asistencia Section */
.asistencia-seccion {
    margin-top: 80px; padding: 60px 40px; background-color: var(--light-blue);
    border-radius: 8px; text-align: center;
}
.asistencia-header h2 { color: var(--primary-navy); font-size: 2.2em; margin-bottom: 15px; font-weight: 700; }
.asistencia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.asistencia-card {
    background: #ffffff; padding: 40px 30px; border-radius: 4px;
    border-top: 4px solid var(--accent-red); box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease; display: block; text-decoration: none; color: var(--text-main);
}
.asistencia-card:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(10, 37, 64, 0.1); }
.asistencia-label { display: block; color: #718096; font-size: 0.85em; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; font-weight: 600; }
.asistencia-card h3 { color: var(--primary-navy); font-size: 1.5em; margin-bottom: 25px; }
.asistencia-btn {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 45%, #991b1b 55%, #b91c1c 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 4px;
    display: inline-block;
    font-weight: 700;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed !important; /* Fuerza la posición lateral */
    right: -400px; 
    top: 0; 
    width: 350px; 
    height: 100vh;
    background: white; z-index: 3000; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1); 
    display: flex; 
    flex-direction: column;
}
.cart-sidebar.active { right: 0; }
.cart-sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2999; display: none;
}

footer {
    background: linear-gradient(180deg, #1a6336 0%, #14532d 45%, #0d3d21 55%, #14532d 100%); /* Verde institucional */
    color: white;
    text-align: center;
    padding: 40px 0;
}

/* Tracking Modal Specific Styles */
#trackingModal .modal-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    padding: 40px;
    max-width: 750px;
}

.tracking-search-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
    width: 100%;
}

.tracking-search-container input {
    width: 100%;
    max-width: 550px;
    padding: 18px 25px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.25rem;
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
}

.tracking-search-container input:focus {
    border-color: var(--secondary-blue);
}

.tracking-bar {
    position: relative;
    width: 85%;
    margin: 80px auto 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tracking-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 6px;
    background: #edf2f7;
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 10px;
}

.tracking-line-progress {
    height: 100%;
    background: var(--secondary-blue);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.tracking-point {
    width: 65px;
    height: 65px;
    background: white;
    border: 4px solid #edf2f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-size: 1.8rem;
    transition: all 0.4s ease;
    filter: grayscale(100%) opacity(0.4);
}

.tracking-point.active {
    border-color: var(--secondary-blue);
    background: var(--light-blue);
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
    filter: sepia(100%) hue-rotate(80deg) saturate(500%); /* Ajustado a Verde */
}

.truck-icon {
    position: absolute;
    top: -45px;
    font-size: 35px;
    transition: left 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    display: none;
    transform: translateX(-50%);
}

#trackingStatusText { 
    margin-top: 40px; 
    font-weight: 800; 
    color: var(--secondary-blue); 
    font-size: 2.4rem; 
    text-transform: uppercase;
}
#trackingDescription { margin-top: 10px; color: #4a5568; line-height: 1.6; max-width: 600px; margin-left: auto; margin-right: auto; }

/* --- AJUSTES GLOBALES MÓVIL (TOP BAR) --- */
@media (max-width: 768px) {
    .top-bar { padding: 6px 0 !important; }
    .top-bar .container { 
        align-items: center !important; 
        text-align: center; 
        gap: 5px !important; 
    }
    .top-bar span { font-size: 10px !important; letter-spacing: 0.5px; }
    .track-btn-top { 
        padding: 5px 15px !important; 
        font-size: 10px !important; 
    }

    /* Ajustes adicionales para adaptabilidad total */
    .logo img { height: 60px; }
    .logo .slogan { font-size: 11px; max-width: 140px; padding-left: 10px; }
    .hero h1 { font-size: 1.8em; }
    .hero { min-height: 450px; }
    
    .search-bar { width: 100%; }
    
    nav a { padding: 10px 15px; font-size: 11px; }
    
    .cart-btn-header {
        top: auto;
        bottom: 20px;
        right: 15px;
    }

    /* Ajustes para el Modal en Móvil */
    .modal-content { flex-direction: column; }
    .modal-image-container { flex: none; height: 250px; }
    .modal-image-container::after { 
        background: linear-gradient(to bottom, transparent 60%, white 100%); 
    }
    .modal-text-container { padding: 25px 20px; }

    /* --- AJUSTES PARA PANEL DE ADMINISTRACIÓN --- */
    .admin-container, .dashboard-wrapper {
        padding: 10px;
        width: 100% !important;
    }

    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }

    .admin-form-group {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .admin-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}
