html {
    color-scheme: dark light;
}
:root {
    /* Tema oscuro - Tonos más sobrios (ahora por defecto) */
    --primary-color: #C88A45;
    --secondary-color: #897055;
    --accent-color: #D0CECC;
    --cart-color: #72502C;
    /*--warm-bg: #23211F; */
    --warm-bg: #333333;
    --card-bg: #2f2b29;
    --text-primary: #D0CECC;
    --text-secondary: #a59a91;
    --border-color: #4a403a;
}

[data-theme="light"] {
    /* Tema claro opcional */
    --primary-color: #C88A45;
    --secondary-color: #897055;
    --accent-color: #72502C;
    --cart-color: #C88A45;
    /*--warm-bg: #D0CECC;*/
    --warm-bg: #F3EFE9;
    --card-bg: #ffffff;
    --text-primary: #23211F;
    --text-secondary: #5a514a;
    --border-color: #c1b9b0;
}

/* ===========================
   BASE GENERAL
   =========================== */
body {
    background-color: var(--warm-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand img {
    width: auto;
}

.logo-placeholder {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2rem;
}

.logo-img {
    max-width: 200px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

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

footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #777;
}

footer a {
    color: #007BFF;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}


/* ===========================
   HEADER BANNER Y LOGO
   =========================== */
.header-banner-container {
    position: relative;
    width: 100%;
    margin-bottom: 60px; /* Espacio para la mitad inferior del logo */
}

.banner-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 0 0 12px 12px;
}

.banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-floating {
    position: absolute;
    bottom: -60px; /* La mitad del tamaño del logo (120px / 2) */
    left: 30px;
    z-index: 10;
    background: var(--card-bg);
    padding: 8px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-floating .logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    max-width: none; /* Importante: anular el max-width anterior */
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .header-banner-container {
        margin-bottom: 50px;
    }
    
    .banner-image {
        height: 180px;
    }
    
    .logo-floating {
        bottom: -50px; /* La mitad del tamaño móvil (100px / 2) */
        left: 20px;
        width: 100px;
        height: 100px;
        padding: 6px;
        border: 3px solid var(--primary-color);
    }
}


/* ===========================
   LAYOUT PRINCIPAL
   =========================== */
.store-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px;
}

.products-section {
    margin-bottom: 30px;
}

.detail-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    padding: 20px;
    border: 1px solid var(--border-color);
}

/* ===========================
   CATEGORÍAS
   =========================== */
.category-bar {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

.category-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;           /* Evita que el texto se divida en múltiples líneas */
    font-size: 0.85rem;            /* Fuente más pequeña que el resto del sitio */
    flex-shrink: 0;                /* Evita que los botones se compriman */
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ===========================
   PRODUCTOS
   =========================== */
.products-area {
    padding: 10px;
    background: var(--warm-bg);
    border-radius: 12px;
}

/* Solo aplicar scroll en desktop */
@media (min-width: 769px) {
    .products-area {
        max-height: 60vh;
        overflow-y: auto;
    }
}

#products-grid {
    /* En móvil: columna única, ancho completo */
}

/* Desktop: mantener grilla de 2 columnas */
@media (min-width: 769px) {
    #products-grid .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Móvil: ancho completo */
@media (max-width: 768px) {
    #products-grid .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .product-card {
        max-width: 100% !important;
        margin: 0 !important;
    }
}

/* ESTILOS BASE PRODUCT CARD */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(200, 138, 69, 0.25);
    border-color: var(--primary-color);
}

/* PRODUCT CARD CON IMAGEN */
.product-card-with-image .product-image-header {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: var(--warm-bg);
}

.product-card-with-image .product-image-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8;
}

.product-card-with-image .card-body {
    padding: 15px;
}

/* PRODUCT CARD SIN IMAGEN */
.product-card-no-image .card-body {
    padding: 20px;
}

/* TEXTOS DE PRODUCTOS */
.product-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    height: auto;
    overflow: visible;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    .product-card-with-image .product-image-header img {
        max-height: 300px;
    }

    .product-card .card-body {
        padding: 12px;
    }

    .product-name {
        font-size: 0.95rem;
    }

    .product-description {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 1.1rem;
    }
}

/* ===========================
   BOTONES Y MODALES
   =========================== */
        /* Botones flotantes */
        .floating-buttons {
            position: fixed;
            right: 20px;
            top: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 1000;
        }

.btn-floating {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    border: none;
}

.btn-floating:hover {
    transform: scale(1.1);
}

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

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

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-bottom: none;
}

.modal-title {
    color: white;
}

.form-control {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(200, 138, 69, 0.25);
}

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

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

.btn-success {
    background: #28a745;
    border-color: #28a745;
}

/* ===========================
   EFECTOS Y SCROLL
   =========================== */
.product-card {
    animation: fadeIn 0.5s ease forwards;
}

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

.products-area::-webkit-scrollbar {
    width: 8px;
}

.products-area::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.products-area::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}


/* === FIX VISIBILIDAD BADGE EN MODO LIGHT === */
[data-theme="light"] .badge,
[data-theme="light"] .product-badge,
[data-theme="light"] .badge-qty {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .badge,
[data-theme="dark"] .product-badge,
[data-theme="dark"] .badge-qty {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border: 1px solid var(--border-color);
}


.cartas-section {
    margin-bottom: 2rem;
}

.cartas-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.carta-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.carta-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.carta-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}