/* Sistema de Diseño - Variables CSS */
:root {
    --primary-color: #E2B06A;
    --accent-color: #F8D39D;
    --bg-color: #121212;
    --surface-color: #1E1E1E;
    --text-main: #F5F5F5;
    --text-muted: #A0A0A0;
    --border-color: #333333;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 15px 35px rgba(226, 176, 106, 0.15);
    --border-radius-lg: 24px;
    --border-radius-sm: 12px;
    --transition-speed: 0.3s;
}

/* Reset Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

* {
    max-width: 100vw;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-actions {
    position: relative;
}

.cart-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#open-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: #121212;
    box-shadow: 0 4px 15px rgba(226, 176, 106, 0.4);
    border: none;
    padding: 0;
}
#open-cart-btn i {
    font-size: 1.6rem;
    margin: 0;
}
#open-cart-btn .cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.8rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    border: 2px solid var(--bg-color);
}

.cart-btn:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 4rem 5%;
    align-items: center;
    min-height: 70vh;
}

.hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 400px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #121212;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 8px 20px rgba(121, 85, 72, 0.2);
}

.btn-primary:hover {
    background-color: #614339;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(121, 85, 72, 0.3);
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image .shape {
    position: absolute;
    width: 350px;
    height: 350px;
    background-color: var(--accent-color);
    border-radius: 50%;
    z-index: -1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.2;
}

.hero-image img {
    width: 100%;
    max-width: 450px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    object-fit: cover;
    height: 600px;
}

/* Menu Section */
.menu-section {
    padding: 5rem 5%;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.categories {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-color);
}

.categories::-webkit-scrollbar {
    height: 6px;
}
.categories::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 3px;
}
.categories::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

.category-btn {
    white-space: nowrap;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

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

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

/* Menu Item Card */
.menu-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    transition: all var(--transition-speed) ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.menu-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.menu-img-container {
    width: 100%;
    height: 220px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.menu-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.menu-card:hover .menu-img-container img {
    transform: scale(1.05);
}

.menu-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.menu-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.menu-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.add-to-cart-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    height: 40px;
    width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.menu-card:hover .add-to-cart-btn {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(5px);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
    z-index: 10;
}

.fav-btn.active {
    color: #ef4444;
}

.fav-btn:hover {
    transform: scale(1.15);
    color: #ef4444;
}

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--surface-color);
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-main);
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-speed);
}

.close-cart-btn:hover {
    color: var(--primary-color);
}

.cart-items {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-cart-msg {
    text-align: center;
    color: var(--text-muted);
    margin-top: 2rem;
}

/* Cart Item */
.cart-item {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-color);
    padding: 0.3rem 0.5rem;
    border-radius: 20px;
}

.qty-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    border-radius: 50%;
    transition: background 0.2s;
}

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

.cart-item-qty {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 16px;
    text-align: center;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ff4d4f;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
}

.cart-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-family: 'Playfair Display', serif;
}

.btn-checkout {
    width: 100%;
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--text-muted);
    box-shadow: none;
}

/* Responsive */
@media (max-width: 900px) {
    .navbar { flex-wrap: wrap; gap: 1rem; padding: 1rem; justify-content: center; }
    .nav-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
    .user-widget { font-size: 0.9rem; padding: 0.5rem; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
    
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 2rem;
        min-height: auto;
    }
    
    .hero-content p {
        margin: 0 auto 2rem;
    }

    .hero-image img {
        height: 400px;
    }
}

@media (max-width: 950px) {
    .view-tabs { 
        position: fixed; 
        bottom: 10px; 
        left: 5%; 
        width: 90%; 
        background: rgba(30, 30, 30, 0.95); 
        backdrop-filter: blur(15px);
        padding: 0.2rem 0.5rem; 
        justify-content: space-around; 
        z-index: 1000;
        border: 1px solid var(--border-color);
        border-radius: 20px;
        box-shadow: var(--shadow-soft);
        margin: 0;
        display: none; /* Se maneja con js si está auth o no, su display real en movil es flex pero JS mete styles locales */
    }
    
    /* Para sobreescribir cualquier flex-start previo o si JS le pone display flex en linea */
    #main-view-tabs[style*="display: flex"] {
        display: flex !important;
        justify-content: space-around !important;
        position: fixed !important;
        bottom: 10px !important;
        left: 5% !important;
        width: 90% !important;
    }

    #open-cart-btn {
        bottom: 70px; /* Above the view-tabs */
        right: 15px;
        width: 55px;
        height: 55px;
    }
    #open-cart-btn i {
        font-size: 1.4rem;
    }

    .view-tab-btn { 
        flex: 1; 
        text-align: center; 
        justify-content: center; 
        flex-direction: column; 
        font-size: 0.55rem; 
        padding: 0.1rem;
        gap: 0;
        max-width: 30%;
    }
    
    .view-tab-btn i {
        font-size: 1.1rem;
        display: block;
        margin-bottom: 0px;
    }

    body, html {
        padding-bottom: 110px; /* Evita que el contenido quede abajo del nav footer */
    }

    .hero-content h1 {
        font-size: 2.5rem;
        word-break: break-word;
    }
    
    .section-header h2, .orders-section h2 {
        font-size: 1.8rem !important;
        word-break: break-word;
    }
    
    .categories {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding-bottom: 10px;
    }
    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Mis Pedidos Tracker CSS */
.orders-section {
    padding: 2rem 5%;
    margin-top: 1rem;
    display: none;
}

.order-tracker-card {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}
.order-id {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}
.progress-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}
.progress-line-bg {
    position: absolute;
    top: 20px;
    left: 10%;
    width: 80%;
    height: 6px;
    background: #e0e0e0;
    z-index: 1;
    border-radius: 3px;
}
.progress-line-fill {
    position: absolute;
    top: 20px;
    left: 10%;
    height: 6px;
    background: var(--primary-color);
    z-index: 2;
    transition: width 0.5s ease-in-out;
    border-radius: 3px;
}
.progress-step {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}
.progress-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
    font-size: 1.5rem;
    transition: all 0.5s ease;
}
.progress-step.active .progress-icon {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #121212;
    box-shadow: 0 4px 10px rgba(226, 176, 106, 0.3);
}
.progress-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}
.progress-step.active .progress-label {
    color: var(--primary-color);
    font-weight: bold;
}

/* View Tabs */
.view-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--surface-color);
    padding: 0.3rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}
.view-tab-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}
.view-tab-btn.active {
    background: var(--primary-color);
    color: #121212;
}
.view-tab-btn:hover:not(.active) {
    color: var(--primary-color);
}
.orders-badge {
    background: #ff4d4f;
    color: white;
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-weight: bold;
}
