﻿/* ==========================================================================
   La Flama — Restaurant Booking System
   B&W color scheme · Mobile-first responsive
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --black: #000000;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --text: #171717;
    --text-light: #525252;
    --text-muted: #737373;
    --border: #e5e5e5;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    --transition: .2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --container: 640px;
    --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--text); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gray-600); }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ---------- Container ---------- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
    width: 100%;
}

/* ==========================================================================
   HEADER — Black bar, white logo, clean nav
   ========================================================================== */
.site-header {
    background: var(--black);
    height: var(--header-h);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--gray-800);
}
.header-inner {
    max-width: 960px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.site-logo img {
    height: 48px;
    width: auto;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.site-nav a {
    color: var(--gray-300);
    font-size: .875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: color var(--transition);
}
.site-nav a:hover,
.site-nav a.active { color: var(--white); }
.site-nav .nav-phone { font-size: .8rem; opacity: .7; }
.site-nav .nav-phone:hover { opacity: 1; }
.site-nav .material-icons-outlined { font-size: 1.15rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .875rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn-black {
    background: var(--black);
    color: var(--white);
}
.btn-black:hover { background: var(--gray-800); color: var(--white); }
.btn-white {
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--gray-300);
}
.btn-white:hover { background: var(--gray-100); color: var(--black); }
.btn-outline {
    background: transparent;
    color: var(--gray-300);
    border: 1px solid var(--gray-600);
}
.btn-outline:hover { color: var(--white); border-color: var(--white); }
.btn-sm { padding: .35rem .85rem; font-size: .8rem; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; color: white; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-danger-fill { background: var(--danger); color: white; }
.btn-danger-fill:hover { background: #b91c1c; color: white; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 200;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    transition: transform .3s, opacity .3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 90;
}
.mobile-overlay.show { display: block; }

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.site-main {
    flex: 1;
    padding: 2rem 0;
}

/* ==========================================================================
   CARDS & FORM ELEMENTS
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.card-dark {
    background: var(--black);
    color: var(--white);
    border: none;
}
.card-dark .text-muted { color: var(--gray-400) !important; }

/* Form fields */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .35rem;
}
.form-check label {
    display: inline;
    font-weight: 400;
    font-size: .82rem;
    cursor: pointer;
}
.form-check input[type="checkbox"] {
    margin-right: .35rem;
    vertical-align: middle;
}
.form-check a { color: var(--black); text-decoration: underline; }
.form-control {
    width: 100%;
    padding: .65rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    background: var(--white);
    color: var(--text);
    transition: border-color var(--transition);
    -webkit-appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--black);
    box-shadow: 0 0 0 2px rgba(0,0,0,.1);
}
.form-control::placeholder { color: var(--gray-400); }

/* Alerts */
.alert {
    padding: .85rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: 1rem;
    border: 1px solid;
}
.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: #bbf7d0;
}
.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #fecaca;
}

/* ==========================================================================
   BOOKING WIZARD
   ========================================================================== */
.booking-hero {
    text-align: center;
    padding: 1.5rem 0 1rem;
}
.booking-hero img {
    height: 80px;
    margin-bottom: .75rem;
}
.booking-hero h1 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text);
}
.booking-hero .tagline {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .15rem;
}

/* Steps */
.wizard-step { display: none; }
.wizard-step.active { display: block; }

.step-header {
    text-align: center;
    margin-bottom: 1.25rem;
}
.step-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: .25rem;
}
.step-header p {
    color: var(--text-muted);
    font-size: .85rem;
}

/* Progress indicator */
.wizard-progress {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.wizard-progress .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    transition: all var(--transition);
}
.wizard-progress .dot.active { background: var(--black); transform: scale(1.3); }
.wizard-progress .dot.done { background: var(--gray-600); }

/* Calendar view */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.calendar-nav .cal-month {
    font-size: 1rem;
    font-weight: 700;
    text-transform: capitalize;
}
.calendar-nav button {
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition);
}
.calendar-nav button:hover { background: var(--gray-200); }
.calendar-nav button:disabled { opacity: .3; cursor: not-allowed; }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}
.calendar-weekdays span {
    text-align: center;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    padding: .35rem 0;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: .85rem;
    cursor: default;
    transition: all var(--transition);
    border: 2px solid transparent;
    position: relative;
}
.cal-day.empty { background: transparent; }
.cal-day.past {
    color: var(--gray-300);
}
.cal-day.no-slots {
    color: var(--gray-300);
}
.cal-day.avail {
    cursor: pointer;
    background: var(--gray-50);
    border-color: var(--border);
}
.cal-day.avail:hover { border-color: var(--black); }
.cal-day.avail.selected {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}
/* High availability (60-100%) — normal */
.cal-day.avail-high { background: var(--gray-50); }
/* Medium availability (1-60%) — yellowish */
.cal-day.avail-mid { background: #fef9c3; border-color: #facc15; }
.cal-day.avail-mid:hover { border-color: var(--black); }
.cal-day.avail-mid.selected { background: var(--black); color: var(--white); border-color: var(--black); }
/* Full (0%) — red */
.cal-day.avail-full {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #fca5a5;
    cursor: not-allowed;
}
.cal-day .day-num {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}
.cal-day .day-label {
    font-size: .6rem;
    opacity: .6;
}
.cal-day.avail-full .day-label { opacity: .8; }

/* Slot grid */
.slot-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
}
.slot-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--gray-50);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    cursor: pointer;
    transition: all var(--transition);
}
.slot-btn:hover { border-color: var(--black); }
.slot-btn.selected { background: var(--black); color: var(--white); border-color: var(--black); }
.slot-btn .slot-turno { font-size: 1rem; font-weight: 600; }
.slot-btn .slot-turno small { font-size: .75rem; font-weight: 400; opacity: .7; }
.slot-btn.disabled {
    opacity: .4;
    cursor: not-allowed;
    border-color: var(--border);
}

/* People selector */
.people-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .5rem;
}
.people-btn {
    background: var(--gray-50);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem;
    text-align: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all var(--transition);
}
.people-btn:hover { border-color: var(--black); }
.people-btn.selected { background: var(--black); color: var(--white); border-color: var(--black); }
.people-btn.disabled { opacity: .3; cursor: not-allowed; }

/* Confirmation */
.confirm-summary {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.confirm-row {
    display: flex;
    justify-content: space-between;
    padding: .4rem 0;
    font-size: .9rem;
}
.confirm-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.confirm-label { color: var(--text-muted); }
.confirm-value { font-weight: 600; }

/* Success state */
.booking-success {
    text-align: center;
    padding: 2rem 0;
}
.booking-success .icon { font-size: 3rem; color: var(--success); }
.booking-success h2 { font-size: 1.3rem; margin: .75rem 0 .5rem; }
.booking-success p { color: var(--text-muted); font-size: .9rem; }

/* Back link */
.step-back {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.step-back:hover { color: var(--text); }

/* Step summary badge */
.step-summary {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--gray-100);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .4rem .85rem;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.step-summary .material-icons-outlined { font-size: 1rem; color: var(--text-muted); }

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Guest checkout */
.guest-checkout {
    margin-top: 1.25rem;
}
.guest-checkout-title {
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}
.auth-tabs {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.auth-tab {
    flex: 1;
    padding: .65rem .5rem;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
    background: var(--gray-50);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.auth-tab + .auth-tab { border-left: 1px solid var(--border); }
.auth-tab.active {
    background: var(--black);
    color: var(--white);
}
.auth-tab:hover:not(.active) { background: var(--gray-100); color: var(--text); }
.auth-tab-panel { display: none; }
.auth-tab-panel.active { display: block; }

/* ==========================================================================
   PROFILE PAGE
   ========================================================================== */
.profile-section { margin-bottom: 2rem; }
.profile-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

/* Booking list */
.booking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}
.booking-item:last-child { border-bottom: none; }
.booking-item.past {
    opacity: .45;
    filter: grayscale(1);
}
.booking-info { flex: 1; min-width: 0; }
.booking-date { font-weight: 700; font-size: .95rem; }
.booking-details { font-size: .85rem; color: var(--text-muted); }
.booking-status {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .2rem .55rem;
    border-radius: var(--radius-sm);
}
.status-confirmada { background: var(--success-bg); color: var(--success); }
.status-cancelada { background: var(--danger-bg); color: var(--danger); }

.no-bookings {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}
.no-bookings .material-icons-outlined { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .4; }

/* ==========================================================================
   AUTH PAGES (Login / Register)
   ========================================================================== */
.auth-page {
    max-width: 400px;
    margin: 0 auto;
    padding: 1.5rem 0;
}
.auth-page h1 {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-page .auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: .85rem;
    color: var(--text-muted);
}
.auth-page .auth-switch a { font-weight: 600; text-decoration: underline; }

/* ==========================================================================
   404 PAGE
   ========================================================================== */
.page-404 {
    text-align: center;
    padding: 4rem 1rem;
}
.page-404 .material-icons-outlined { font-size: 4rem; color: var(--gray-300); }
.page-404 h1 { font-size: 1.5rem; margin: 1rem 0 .5rem; }
.page-404 p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: var(--black);
    color: var(--gray-400);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
}
.footer-inner {
    max-width: 960px;
}
.footer-logo { height: 40px; margin-bottom: .5rem; }
.footer-tagline {
    font-size: .8rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    letter-spacing: .1em;
}
.footer-info {
    margin-bottom: 1.2rem;
    font-size: .82rem;
    color: var(--gray-400);
    line-height: 1.6;
}
.footer-info p { margin: 0; }
.footer-info a { color: var(--gray-300); text-decoration: none; }
.footer-info a:hover { color: var(--white); }
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.footer-links a {
    color: var(--gray-400);
    font-size: .85rem;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }
.footer-copy { font-size: .75rem; color: var(--gray-600); }

/* ==========================================================================
   RESPONSIVE — Mobile first
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --container: 100%;
    }
    
    .hamburger { display: flex; }
    
    .site-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100%;
        background: var(--black);
        flex-direction: column;
        align-items: flex-start;
        padding: calc(var(--header-h) + 1rem) 1.5rem 1.5rem;
        z-index: 95;
        transition: right .3s ease;
        gap: 1rem;
    }
    .site-nav.open { right: 0; }
    .site-nav a { font-size: 1rem; }
    .site-nav .btn { width: 100%; justify-content: center; }

    .booking-hero img { height: 60px; }
    .booking-hero h1 { font-size: 1rem; }
    
    .people-grid { grid-template-columns: repeat(5, 1fr); }
    
    .booking-item { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

@media (min-width: 769px) {
    .people-grid { grid-template-columns: repeat(5, 1fr); }
    .slot-grid { grid-template-columns: 1fr 1fr; }
}

