:root {
    --bg-color: #f7f9fa;
    --card-bg: #ffffff;
    --text-main: #0a192f; /* Azul marino premium */
    --text-muted: #666666;
    --accent-blue: #000;
    --border-radius: 16px;
    --whatsapp-green: #1ebd59;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden; 
    width: 100%;
    min-height: 100vh; /* Asegura que el footer baje por completo */
}

/* Barra de Navegación Superior */
.navbar {
    width: 100%;
    background-color: #000000; /* Fondo negro de extremo a extremo */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.navbar-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo-container img {
    height: 45px;
    width: auto;
    display: block;
}

.cart-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
}

.cart-icon-btn svg {
    width: 28px;
    height: 28px;
    fill: #ffffff; 
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ffffff;
    color: #000000;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tasa del Dólar Flotante */
.tasa-flotante {
    background-color: #112240;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Encabezado */
header {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 25px;
    padding: 0 20px;
    box-sizing: border-box;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

header p {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}

/* Contenedor de Filtros */
.categorias-container {
    display: flex;
    gap: 10px;
    max-width: 1200px;
    padding: 10px 20px;
    margin-bottom: 30px;
    box-sizing: border-box;
}

.pill {
    background-color: #eeeeee;
    color: var(--text-main);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.pill.active {
    background-color: var(--text-main);
    color: #ffffff;
    border-color: var(--text-main);
}

/* Contenedor de Productos */
.tienda-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px 50px 20px;
    box-sizing: border-box;
}

.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Tarjeta de Producto */
.producto-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #eaeaea;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.producto-card:hover {
    transform: translateY(-2px);
}

.img-container {
    width: 100%;
    height: 220px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 15px;
    box-sizing: border-box;
}

.img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.info-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.categoria-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.producto-titulo {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.compra-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.precios {
    display: flex;
    flex-direction: column;
}

.precio-principal {
    font-size: 1.3rem;
    font-weight: 700;
}

.precio-principal span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 2px;
}

.promo-divisa {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00bfff;
    margin-top: 2px;
}

/* Botón Agregar */
.btn-agregar {
    background-color: var(--accent-blue);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-agregar svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* MODALES Y CARRITO SIDEBAR */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 15px;
    box-sizing: border-box;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 24px;
    overflow-y: auto;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f1f3f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 1.2rem;
    font-weight: bold;
}

.modal-img-container {
    width: 100%;
    height: 280px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Estilos para la Galería de Miniaturas */
.modal-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 24px 15px 24px;
    overflow-x: auto;
}

.thumb-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 2px solid #eaeaea;
    border-radius: 12px;
    cursor: pointer;
    padding: 4px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.thumb-img.active {
    border-color: #0044ff;
    box-shadow: 0 2px 8px rgba(0, 68, 255, 0.2);
}

.modal-body {
    padding: 24px;
    border-top: 1px solid #f1f3f5;
}

.modal-titulo {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.modal-categoria {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: block;
}

.modal-caracteristicas {
    font-size: 0.9rem;
    color: #444;
    margin: 0 0 25px 0;
    padding-left: 20px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f3f5;
    padding-top: 15px;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background-color: #f8f9fa;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-sizing: border-box;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.cart-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #333;
}

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 20px;
}

.cart-item {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid #f1f3f5;
}

.cart-item-img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: #eaeaea;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-item-img img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.cart-item-info {
    flex-grow: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

.qty-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    padding: 0 4px;
}

.qty-num {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 12px;
    text-align: center;
}

.delete-item-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #e74c3c;
    display: flex;
    align-items: center;
    padding-left: 4px;
}

.delete-item-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.cart-footer {
    padding: 20px;
    background-color: #ffffff;
    border-top: 1px solid #f1f3f5;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.cart-total-price {
    color: var(--accent-blue);
}

.checkout-btn {
    width: 100%;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.checkout-btn:hover {
    background-color: #0033cc;
}

.cart-overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.2);
    z-index: 2500;
    display: none;
}

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 0.95rem;
    background-color: #fff;
}
.location-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.selector-option {
    border: 1px solid #e2e8f0;
    background-color: #fff;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.selector-option.active {
    border-color: var(--accent-blue);
    background-color: #e6edff;
    color: var(--accent-blue);
    font-weight: 600;
}
.resumen-box {
    background-color: #fff;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    max-height: 100px;
    overflow-y: auto;
}
.whatsapp-btn {
    width: 100%;
    background-color: var(--whatsapp-green);
    color: white;
    border: none;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* --- FOOTER SECCIÓN --- */
footer {
    width: 100%;
    background-color: #000000;
    color: #ffffff;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: auto; /* Empuja hacia abajo */
    box-sizing: border-box;
    border-top: 1px solid #111111;
}

footer p {
    margin: 0;
    opacity: 0.8;
}

/* Responsive Móviles */
@media (max-width: 600px) {
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: #000000;
        padding: 12px 20px;
        z-index: 1050;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .navbar-content {
        justify-content: center;
    }

    .logo-container {
        display: flex;
        justify-content: center;
        margin: 0 auto;
    }

    .logo-container img {
        height: 38px;
    }

    .cart-icon-btn {
        position: absolute;
        right: 0px;
        top: 50%;
        transform: translateY(-50%);
    }

    .tasa-flotante {
        position: fixed;
        top: 78px; 
        font-size: 0.8rem;
        padding: 4px 12px;
        z-index: 1050;
    }

    header {
        margin-top: 135px; 
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.6rem;
        margin-top: 10px;
    }

    header p {
        font-size: 0.9rem;
        padding: 0 10px;
    }

    .categorias-container {
        overflow-x: auto;
        width: 100%;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 20px;
    }
    .categorias-container::-webkit-scrollbar {
        display: none;
    }

    .grid-productos {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .tienda-container {
        padding: 0 12px 30px 12px;
    }

    .img-container {
        height: 140px;
        padding: 8px;
    }

    .info-container {
        padding: 12px;
    }

    .producto-titulo {
        font-size: 0.95rem;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .compra-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .btn-agregar {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .precio-principal {
        font-size: 1.1rem;
    }

    .cart-sidebar {
        max-width: 100%;
    }

    .modal-content {
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
    }
    
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-img-container {
        height: 200px;
    }
}