/* ==========================================
   ESTILOS BASE - ESENCIA ARTESANAL
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #faf9f7;
    color: #333;
}

.header {
    background: #c29682;
    /*background: linear-gradient(135deg, rgba(194, 150, 130, 0.9), rgba(221, 184, 146, 0.85)), url('https://images.unsplash.com/photo-1608248543803-ba4f8c70ae0b?w=1200&h=400&fit=crop') center/cover;*/
    color: white;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.restaurant-info {
    position: relative;
    z-index: 1;
}

.restaurant-logo {
    width: 80px;
    height: 80px;
    background: url('https://hitnus.cl/logo-hitnus-2.jpeg') center/cover;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #8b6f47;
    font-size: 24px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 3px solid white;
}

.restaurant-name {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    color: #8b6f47;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.restaurant-tag {
    background: #775937;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: table-cell;
    margin-bottom: 1rem;
}

.delivery-info {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.discount-banner {
    background: linear-gradient(135deg, #f8e8dc, #f5dbc7);
    color: #8b6f47;
    padding: 1rem;
    margin: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    border: 1px solid #ddb890;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    padding-bottom: 120px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2rem 0 1rem 0;
    padding: 0 1rem;
    color: #8b6f47;
}

.category-section {
    margin-bottom: 2rem;
}

.category-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 2rem 0 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-left: 4px solid #c2a17a;
    border-radius: 3px;
    color: #8b6f47;
}

.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 100;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    display: none;
}

.sticky-header.active {
    transform: translateY(0);
}

.sticky-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #8b6f47;
    text-align: center;
}

.single-product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 400px;
    margin: 0 auto;
    margin-bottom: 3vh;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(194, 161, 122, 0.2);
}

.desktop-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #c2a17a;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 2;
}

.desktop-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.desktop-info {
    padding: 1.5rem;
}

.desktop-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #8b6f47;
}

.desktop-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.desktop-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.desktop-price-current {
    font-size: 1.3rem;
    font-weight: bold;
    color: #8b6f47;
}

.desktop-price-original {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.desktop-button {
    background: #c2a17a;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, transform 0.2s;
}

.desktop-button:hover {
    background: #a68968;
}

.desktop-button.added {
    background: #7fb069 !important;
    transform: scale(1.05);
}

/* ==========================================
   ESTILOS CARRUSEL
========================================== */
.carousel-section {
    padding: 2rem 0 1rem 0;
    background: #ffffff;
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem 1rem;
}

.carousel-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #8b6f47;
}

.carousel-controls {
    display: flex;
    gap: 0.5rem;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #8b6f47;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: #c2a17a;
    color: white;
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-container {
    overflow: hidden;
    position: relative;
}

.carousel {
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
    display: none;
}

/* CARD DEL CARRUSEL - DESKTOP */
.carousel-product-card {
    min-width: 280px;
    max-width: 280px;
    background: white;
    scroll-snap-align: start;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
}

.carousel-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(194, 161, 122, 0.2);
}

.carousel-product-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.carousel-product-badge {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: #c2a17a;
    color: white;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 3px;
    z-index: 2;
}

.carousel-product-info {
    padding: 1rem;
}

.carousel-product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #8b6f47;
    line-height: 1.3;
}

.carousel-product-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.carousel-product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #8b6f47;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carousel-product-price.sale {
    color: #d97757;
}

.carousel-product-price-original {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
}

/* BOTÓN DESKTOP CARRUSEL */
.carousel-add-btn {
    background: #c2a17a;
    color: white;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, transform 0.2s;
    font-size: 0.9rem;
}

.carousel-add-btn:hover {
    background: #a68968;
}

.carousel-add-btn.added {
    background: #7fb069 !important;
    transform: scale(1.05);
}

/* ELEMENTOS MOBILE DEL CARRUSEL */
.carousel-mobile-container {
    display: none;
    position: absolute;
    bottom: 0.8rem;
    right: 0.8rem;
}

.carousel-mobile-add {
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid #c2a17a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #c2a17a;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.carousel-mobile-add:active {
    background: #c2a17a;
    color: white;
    transform: scale(1.1);
}

.carousel-mobile-add.added {
    background: #7fb069 !important;
    color: white;
    border-color: #7fb069;
}

.carousel-quantity-controls {
    background: white;
    border: 2px solid #c2a17a;
    border-radius: 20px;
    display: none;
    align-items: center;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.carousel-quantity-controls.active {
    display: flex;
}

.carousel-quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #c2a17a;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-quantity-display {
    margin: 0 10px;
    font-weight: bold;
    color: #8b6f47;
    min-width: 22px;
    text-align: center;
}

.carousel-badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #c2a17a;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 3;
}

.carousel-badge-count.active {
    display: flex;
}

/* ==========================================
   BARRA FIJA INFERIOR
========================================== */
.cart-summary-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 1.2rem 1rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.cart-summary-bar.active {
    display: flex;
}

.cart-summary-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-items-count {
    background: #c2a17a;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.cart-total {
    font-weight: bold;
    color: #8b6f47;
}

.view-cart-btn {
    background: #c2a17a;
    color: white;
    border: none;
    padding: 0.8rem 3rem;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 180px;
}

.view-cart-btn:hover {
    background: #a68968;
}

/* ==========================================
   SIDEBAR CARRITO
========================================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
}

.cart-sidebar.active {
    transform: translateX(0);
}

.cart-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #faf9f7;
}

.cart-sidebar-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #8b6f47;
}

.delivery-options {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.delivery-option {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f3f3f3;
    color: #8b6f47;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.delivery-option.active {
    border-color: #c2a17a;
    background: #c2a17a;
    color: #ffffff;
}

.delivery-option:hover {
    border-color: #c2a17a;
}

.address-field {
    margin-top: 0.5rem;
    display: none;
}

.address-field.show {
    display: block;
}

.address-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.address-input:focus {
    outline: none;
    border-color: #c2a17a;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close-sidebar:hover {
    background: #e0e0e0;
}

.cart-items-list {
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    color: #8b6f47;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.cart-item-price {
    color: #8b6f47;
    font-weight: bold;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: background 0.2s;
}

.cart-item-qty-btn:hover {
    background: #f5f5f5;
}

.cart-item-quantity {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.cart-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    position: sticky;
    bottom: 0;
    background: white;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #8b6f47;
}

.final-total {
    border-top: 1px solid #e0e0e0;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.send-whatsapp-btn {
    background: #25d366;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-whatsapp-btn:hover {
    background: #1ea952;
}

/* OCULTAR ELEMENTOS MOBILE EN DESKTOP */
.mobile-content,
.mobile-image-container {
    display: none;
}

/* ==========================================
   RESPONSIVE - MOBILE
========================================== */
@media (max-width: 768px) {
    .header {
        border-radius: 0 0 73px 0;
        height: 60vw;
        max-height: 400px;
    }

    .restaurant-name {
        font-size: 1.5rem;
    }
    
    .delivery-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* OCULTAR ELEMENTOS DESKTOP */
    .section-title,
    .desktop-badge,
    .desktop-image,
    .desktop-info,
    .desktop-name,
    .desktop-description,
    .desktop-price,
    .desktop-price-current,
    .desktop-price-original,
    .desktop-button {
        display: none !important;
    }

    /* OCULTAR CONTROLES DE CARRUSEL EN MOBILE */
    .carousel-btn {
        display: none;
    }

    /* AJUSTAR CARRUSEL EN MOBILE */
    .carousel-section {
        padding: 1.5rem 0 1rem 0;
    }

    .section-header {
        padding: 0 1rem 0.8rem;
    }

    .carousel {
        padding: 0 1rem;
    }

    .carousel-product-card {
        min-width: 260px;
        max-width: 260px;
    }

    .carousel-product-image {
        height: 180px;
    }

    /* OCULTAR BOTÓN DESKTOP Y MOSTRAR CONTROLES MOBILE EN CARRUSEL */
    .carousel-add-btn {
        display: none !important;
    }

    .carousel-mobile-container {
        display: block;
    }

    /* MOSTRAR ELEMENTOS MOBILE */
    .sticky-header {
        display: block;
    }

    .category-title {
        font-size: 1.1rem;
        margin: 1rem 0 0.5rem 0;
        padding: 0.8rem 1rem;
        background: #f3f3f3;
        color: #8b6f47;
        border-left: none;
        border-radius: 3px;
    }

    .single-product-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-width: none;
        margin: 0;
    }

    .product-card {
        background: white;
        border-bottom: 1px solid #f0f0f0;
        padding: 1rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        position: relative;
        border-radius: 0;
        box-shadow: none;
        transition: background-color 0.2s;
    }

    .product-card:hover {
        background-color: #faf9f7;
        transform: none;
        box-shadow: none;
    }

    .product-card:last-child {
        border-bottom: none;
    }

    .mobile-content {
        display: flex;
        flex: 1;
        flex-direction: column;
        gap: 0.5rem;
    }

    .mobile-name {
        font-size: 1.1rem;
        font-weight: bold;
        color: #8b6f47;
        margin: 0;
    }

    .mobile-description {
        color: #666;
        font-size: 0.9rem;
        line-height: 1.3;
        margin: 0;
    }

    .mobile-price {
        font-size: 1.2rem;
        font-weight: bold;
        color: #8b6f47;
        margin: 0.3rem 0 0 0;
    }

    .mobile-image-container {
        display: block;
        position: relative;
        flex-shrink: 0;
    }

    .mobile-image {
        width: 100px;
        height: 100px;
        border-radius: 4px;
        background-size: cover;
        background-position: center;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 2rem;
    }

    .mobile-add {
        position: absolute;
        bottom: -8px;
        right: -8px;
        width: 32px;
        height: 32px;
        background: white;
        border: 2px solid #c2a17a;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        color: #c2a17a;
        cursor: pointer;
        font-size: 1.2rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        transition: all 0.2s;
    }

    .mobile-add:hover {
        background: #c2a17a;
        color: white;
        transform: scale(1.1);
    }

    .mobile-add.added {
        background: #7fb069 !important;
        color: white;
        border-color: #7fb069;
        transform: scale(1.2);
    }

    .quantity-controls {
        position: absolute;
        bottom: -8px;
        right: -8px;
        background: white;
        border: 2px solid #c2a17a;
        border-radius: 20px;
        display: none;
        align-items: center;
        padding: 4px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .quantity-controls.active {
        display: flex;
    }

    .quantity-btn {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: none;
        background: #c2a17a;
        color: white;
        cursor: pointer;
        font-size: 16px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .quantity-display {
        margin: 0 8px;
        font-weight: bold;
        color: #8b6f47;
        min-width: 20px;
        text-align: center;
    }

    .product-badge-count {
        position: absolute;
        top: -8px;
        right: -8px;
        width: 24px;
        height: 24px;
        background: #c2a17a;
        color: white;
        border-radius: 50%;
        display: none;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: bold;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .product-badge-count.active {
        display: flex;
    }

    .cart-sidebar {
        width: 100%;
        max-width: none;
    }
}