/* =========================================
   1. RESET Y ESTILOS GENERALES
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Roboto', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    padding-bottom: 100px; 
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* =========================================
   2. HEADER TIPO BANNER
   ========================================= */
.header, .minimal-header {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1544025162-d76690b67f11?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80');
    background-size: cover;
    background-position: center;
    padding: 40px 20px 50px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    margin-bottom: 25px;
    position: relative; 
    z-index: 1003;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    position: relative;
    text-align: center;
}

.logo, .logo-small {
    max-height: 100px; 
    width: auto;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
}
.logo:hover, .logo-small:hover { transform: scale(1.05); }

/* =========================================
   3. BUSCADOR
   ========================================= */
.search-container {
    padding: 0 20px;
    margin-top: -30px;
    position: relative;
    z-index: 1004;
    max-width: 900px;
    margin-left: auto; margin-right: auto;
}

.search-container i {
    position: absolute; left: 35px; top: 50%; transform: translateY(-50%);
    color: #B86B25;
    z-index: 1005;
}

#search-bar {
    width: 100%; padding: 15px 20px 15px 45px; 
    border-radius: 50px;
    border: none; font-size: 1rem;
    background-color: #fff; 
    outline: none; transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}
#search-bar:focus {
    transform: scale(1.01);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* =========================================
   4. NAVEGACIÓN (¡BARRA MÁS DELGADA!)
   ========================================= */
.category-nav {
    background-color: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 8px 0; /* Barra afinada */
    position: sticky; top: 0; z-index: 1001;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

#category-buttons {
    list-style: none; display: flex;      
    gap: 8px; padding: 0 15px; 
    overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 900px; margin: 0 auto;
}
#category-buttons::-webkit-scrollbar { display: none; }

.category-btn {
    background: #fff; border: 1px solid #eee;
    padding: 6px 14px; /* Botones más finos */
    border-radius: 50px;
    cursor: pointer; font-size: 0.8rem; 
    color: #555;
    font-weight: 600; transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.category-btn.active, .category-btn:hover {
    background-color: #222; color: white; border-color: #222;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.category-title {
    margin-top: 40px; margin-bottom: 20px;
    font-size: 1.3rem; font-weight: 800;
    color: #B86B25; 
    text-transform: uppercase; letter-spacing: 1px;
    position: relative; padding-left: 15px;
    display: flex; align-items: center;
}
.category-title::before {
    content: ''; position: absolute; left: 0; 
    height: 70%; width: 5px; 
    background-color: #222; border-radius: 5px;
}

/* =========================================
   5. TARJETAS DE PRODUCTOS
   ========================================= */
#menu-container {
    padding: 10px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.products-grid {
    display: flex; flex-direction: column; gap: 20px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card, .product-card-simple {
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeInUp 0.6s ease-out forwards;
    position: relative;
    cursor: pointer;
}

.product-card:active, .product-card-simple:active { transform: scale(0.97); }

.product-card:hover, .product-card-simple:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-card {
    display: flex; 
    flex-direction: row; 
    min-height: 95px; 
    height: auto; 
    align-items: stretch; 
}

.product-image {
    width: 95px;
    min-width: 95px;
    background-color: #eee; /* Fondo base para el esqueleto */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; 
    position: relative;
    overflow: hidden;
}

/* Brillo del Skeleton Loader */
.product-image::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.2) 20%, rgba(255,255,255,0.5) 60%, rgba(255,255,255,0));
    animation: shimmer 2s infinite;
}

@keyframes shimmer { 100% { transform: translateX(100%); } }

.product-image img, .product-card img {
    width: 75px;
    height: 75px;
    object-fit: cover; 
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    position: relative; z-index: 2;
}

.product-info {
    padding: 15px 15px 15px 0;
    display: flex; flex-direction: column;
    flex-grow: 1; 
    justify-content: center;
    position: relative;
}

.product-card-simple {
    padding: 20px;
    display: flex; flex-direction: column; justify-content: center;
    min-height: 90px;
}

.product-name, .product-card h3 {
    font-size: 1.05rem; font-weight: 700; color: #222;
    line-height: 1.2; margin-bottom: 8px;
    padding-right: 70px;
}

.product-description, .description {
    font-size: 0.85rem; color: #666; line-height: 1.4;
    margin-bottom: 5px;
}

.product-price, .price-tag {
    position: absolute; top: 15px; right: 15px;
    font-weight: 800; color: #B86B25; 
    font-size: 1rem;
    background: #FFF8F0;
    padding: 5px 10px; border-radius: 8px;
    white-space: nowrap;
}

/* =========================================
   7. BOTÓN VOLVER ARRIBA
   ========================================= */
#scrollTopBtn {
    display: none; position: fixed; bottom: 25px; right: 25px; z-index: 9999; 
    border: none; background-color: #B86B25; color: white;
    width: 50px; height: 50px; border-radius: 50%;
    box-shadow: 0 4px 15px rgba(184, 107, 37, 0.4);
    transition: all 0.3s;
}

/* =========================================
   8. POP-UP DE PRODUCTO (MODAL)
   ========================================= */
.product-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 99999; display: flex; align-items: flex-end;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.product-modal-overlay.active { opacity: 1; visibility: visible; }

.product-modal-content {
    background: #fff; width: 100%; max-height: 90vh;
    border-radius: 25px 25px 0 0; overflow-y: auto;
    transform: translateY(100%); transition: transform 0.4s;
    position: relative;
}
.product-modal-overlay.active .product-modal-content { transform: translateY(0); }

.modal-image-container { width: 100%; height: 300px; background: #ffffff; }
.modal-image-container img { width: 100%; height: 100%; object-fit: contain; }

.modal-body { padding: 25px 20px; }
.modal-header-info { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.modal-header-info h2 { font-size: 1.4rem; font-weight: 800; color: #222; }
.modal-price { font-size: 1.3rem; font-weight: 800; color: #B86B25; }
.modal-description { font-size: 1rem; color: #666; line-height: 1.6; margin-bottom: 25px; }

/* =========================================
   10. MODO OSCURO AUTOMÁTICO 🌙
   ========================================= */
@media (prefers-color-scheme: dark) {
    body { background-color: #121212; color: #e0e0e0; }
    .category-nav { background-color: rgba(18, 18, 18, 0.9); }
    .category-btn { background: #1e1e1e; border: 1px solid #333; color: #aaa; }
    .category-btn.active { background-color: #B86B25; color: #fff; }
    .product-card, .product-card-simple { background-color: #1e1e1e; }
    .product-name { color: #ffffff; }
    .product-price { background: #2a1c10; color: #d88942; }
    .product-image { background-color: #252525; }
    .product-image::after { background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.05) 20%, rgba(255,255,255,0.1) 60%, rgba(255,255,255,0)); }
    .product-modal-content { background: #1e1e1e; }
}