/* ============================================================================
   Tasiang Kitchen & Taps - Premium Stylesheet v2.0
   Based on Branding V9.0
   ============================================================================ */

/* ---------- 1. Variables & Design Tokens ---------- */
:root {
    /* --- Brand Palette --- */
    --color-primary: #B25C2E;
    /* Amber Wood: The soul, warm, appetizing */
    --color-primary-dark: #8C421F;
    /* Darker shade for hover/active */
    --color-background: #F4EDE6;
    /* Cream Light: The canvas, soft, welcoming */
    --color-text: #2E2E2E;
    /* Charcoal: The ink, clear, readable */
    --color-text-light: #5d5d5d;
    /* Softer text for descriptions */
    --color-accent: #F6D27A;
    /* Warm Glow: Highlights */
    --color-secondary: #365C73;
    /* Dusk Blue: The cool contrast */
    --color-success: #10B981;
    /* Fresh Green: Indicators */
    --color-surface: #FFFFFF;
    /* Pure White: Cards and inputs */

    /* --- Typography --- */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* --- Spacing System --- */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;

    /* --- UI Components --- */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 4px rgba(46, 46, 46, 0.05);
    --shadow-md: 0 4px 12px rgba(46, 46, 46, 0.08);
    --shadow-lg: 0 8px 24px rgba(46, 46, 46, 0.12);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ---------- 2. Reset & Base Styles ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-top: 0;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

h2 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
    text-align: center;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

/* Decorative underline for H2 */
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-accent);
    margin: 8px auto 0;
    border-radius: 2px;
}

h3 {
    font-size: 1.4rem;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

p {
    margin: 0 0 var(--space-md) 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ---------- 3. Layout Utilities ---------- */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    box-sizing: border-box;
}

.section-divider {
    border: 0;
    border-top: 1px dashed #CAB8A8;
    margin: var(--space-lg) 0;
}

/* --- Header (V2: Dark Charcoal & Gold) --- */
header {
    background-color: #2E2E2E;
    /* Charcoal */
    border-bottom: 4px solid var(--color-accent);
    /* Warm Glow border */
    padding: var(--space-lg) 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

header img {
    max-width: 180px;
    height: auto;
    border-radius: var(--radius-sm);
    /* Keep logo mostly as is, maybe add white glow if needed, but standard plain is ok */
    background: white;
    padding: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto;
}

.brand-tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.1rem;
    color: #E2E8F0;
    /* Off-white for readability on dark */
    margin-top: var(--space-md);
    letter-spacing: 0.5px;
}

/* ---------- 5. Cards & Containers ---------- */
/* --- Components --- */

/* Cards (V2: Deeper shadows, 'Lifted' look) */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* Tailwind shadow-xl equivalent */
    margin-bottom: var(--space-lg);
    border: none;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    /* Slight lift on desktop */
    box-shadow: var(--shadow-lg);
}

/* Decor strip at top of cards */
/* .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-primary);
} */

/* Top accents for cards */
.card.accent-blue {
    border-top: 5px solid var(--color-secondary);
}

.card.accent-green {
    border-top: 5px solid var(--color-success);
}

.card.green-top {
    border-top: 5px solid var(--color-success);
}

/* Alias */

/* ---------- 6. Buttons & Interactive ---------- */
.btn {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.btn:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-submit,
.btn-primary {
    width: 100%;
    margin-top: var(--space-md);
    font-size: 1.1rem;
    padding: 14px;
}

.btn-order {
    width: 100%;
    background-color: var(--color-success);
    padding: 16px;
    font-size: 1.2rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.btn-order:hover {
    background-color: #059669;
    /* Darker green */
    filter: brightness(1.05);
}

.btn:disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
    transform: none;
}

/* Secondary Button / Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
    color: var(--color-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Large Checkbox for Pre-order Toggle */
.toggle-header input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-textarea {
    min-height: 150px;
    width: 100%;
    resize: vertical;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

/* Toggle Content (Pre-order section) */
.toggle-content {
    display: none;
    /* Hidden by default */
}

.toggle-content.visible {
    display: block;
    /* Shown when checkbox is checked */
}

/* ---------- 7. Forms & Inputs ---------- */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-primary-dark);
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
    background-color: #F8FAFC;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(178, 92, 46, 0.1);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 4px;
    font-style: italic;
}

/* Radio Option Cards (Desktop/Mobile) */
.radio-cards-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
}

@media (min-width: 600px) {
    .radio-cards-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

.radio-card-label {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
}

.radio-card-label:hover {
    border-color: #D1D5DB;
}

.radio-card-label input[type="radio"] {
    margin-right: var(--space-md);
    transform: scale(1.2);
    accent-color: var(--color-primary);
}

.radio-card-label input[type="radio"]:checked+div {
    color: var(--color-primary);
}

/* Targeting sibling if structure allows, or JS handles class */

/* Enhance checked state via parent class or :has selector if supported (using simpler CSS for compatibility) */
.radio-card-label:has(input:checked) {
    border-color: var(--color-primary);
    background-color: #FFF8F3;
    /* Very light orange tint */
}

/* ---------- 8. Complex Menu Items (Mobile First) ---------- */
.menu-group {
    margin-bottom: var(--space-xl);
}

.menu-title,
.menu-category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-secondary);
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    font-family: var(--font-display);
}

.menu-item {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    display: grid;
    /* Grid Layout for Existing HTML Structure */
    /* Label (Checkbox+Name) | Qty | Price */
    grid-template-columns: 1fr auto auto;
    gap: var(--space-sm);
    align-items: center;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.menu-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* Target the existing HTML structure */
.menu-item>label {
    grid-column: 1;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    line-height: 1.3;
}

.menu-item>label>div {
    display: flex;
    flex-direction: column;
    /* Stack name and badge */
}

.menu-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
    margin-top: 2px;
}

.menu-item-text {
    font-weight: 600;
    color: var(--color-text);
    font-size: 1rem;
}

.menu-item .qty-container {
    grid-column: 2;
    display: flex;
    align-items: center;
}

.menu-item .price {
    grid-column: 3;
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.1rem;
    white-space: nowrap;
}

.menu-item .soda-options {
    grid-column: 1 / -1;
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    border-radius: var(--radius-sm);
    display: none;
    /* JS toggles class 'visible' */
}

.menu-item .soda-options.visible {
    display: block;
}

/* Mobile Optimization for Menu Items */
@media (max-width: 550px) {
    .menu-item {
        grid-template-columns: 1fr auto;
        /* Label | Price */
        grid-template-rows: auto auto auto;
        gap: var(--space-sm) var(--space-xs);
    }

    .menu-item>label {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: 4px;
    }

    .menu-item .qty-container {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .menu-item .price {
        grid-column: 2;
        /* Stick directly to right of qty or right edge */
        grid-row: 2;
        justify-self: end;
    }

    .menu-item .soda-options {
        grid-column: 1 / -1;
        grid-row: 3;
    }
}

/* Quantity Control Styles */
.qty-container {
    border: 1px solid #D1D5DB;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: white;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #F9FAFB;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.qty-btn:hover {
    background: #E5E7EB;
}

.qty-input {
    width: 36px;
    height: 32px;
    text-align: center;
    border: none;
    border-left: 1px solid #D1D5DB;
    border-right: 1px solid #D1D5DB;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0;
    border-radius: 0;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---------- 9. Specific Page Components ---------- */

/* Welcome Page Grid */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

@media (min-width: 600px) {
    .choice-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 2px solid transparent;
    color: var(--color-text);
}

.choice-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.choice-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.choice-title {
    font-size: 1.5rem;
    color: var(--color-primary);
    font-family: var(--font-display);
    margin-bottom: var(--space-sm);
}

.choice-desc {
    color: var(--color-text-light);
}

/* Banners / Alerts */
.banner {
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.banner-info {
    background: #EFF6FF;
    color: #1E40AF;
    border-left: 4px solid #3B82F6;
}

.banner-promo {
    background: linear-gradient(135deg, var(--color-primary), #D97706);
    color: white;
    text-align: center;
    justify-content: center;
    font-weight: 500;
}

.banner-warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* Footer */
footer {
    text-align: center;
    padding: var(--space-xl) 0;
    color: #9CA3AF;
    font-size: 0.85rem;
    margin-top: auto;
}

/* Badge tags */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    vertical-align: middle;
    margin-left: var(--space-xs);
}

.badge-free {
    background-color: var(--color-success);
}

.badge-info {
    background-color: var(--color-secondary);
}

.free-soda {
    display: inline-block;
    width: 100px;
    /* Fixed width for uniformity */
    text-align: center;
    background-color: var(--color-success);
    color: white;
    padding: 2px 0;
    /* Reduced side padding since width is fixed */
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
    /* Prevent wrapping */
}

/* ---------- 10. Mobile Optimization ---------- */
@media (max-width: 480px) {
    :root {
        --space-lg: 20px;
        --space-xl: 24px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .card {
        padding: var(--space-md);
    }

    /* Stack menu item content better on small screens */
    .menu-item {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        gap: var(--space-xs) var(--space-sm);
    }

    .menu-checkbox-area {
        grid-column: 1;
        grid-row: 1;
    }

    .menu-info-area {
        grid-column: 2;
        grid-row: 1;
    }

    .menu-price-area {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
        padding-top: 4px;
    }

    .menu-controls-area {
        grid-column: 1 / -1;
        grid-row: 3;
    }
}

/* Summary Card */
.summary-card {
    background-color: #F8FAFC;
    border: 2px solid var(--color-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
    box-shadow: var(--shadow-sm);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-size: 1.1rem;
    color: var(--color-text);
}

.total-row {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 2px dashed #CBD5E1;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--color-primary);
    display: flex;
    justify-content: space-between;
}

/* ---------- 11. Welcome Page Styles ---------- */
.info-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
    text-align: left;
}

.info-card p {
    margin-bottom: var(--space-sm);
}

.info-card p:last-child {
    margin-bottom: 0;
}

.welcome-text {
    text-align: center;
    margin: var(--space-xl) 0 var(--space-md);
}

.welcome-text h2 {
    display: block;
    width: 100%;
}

.welcome-text p {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.choice-card .icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.choice-card h3 {
    font-family: var(--font-display);
    color: var(--color-text);
    margin-bottom: var(--space-sm);
    font-size: 1.25rem;
}

.choice-card p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin: 0;
}

.walk-in-note {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.95rem;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
    margin-top: var(--space-md);
}

/* Welcome page footer - uses .footer class */
.footer {
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-top: var(--space-lg);
}

/* Free Soda Badge in menu items */
.free-soda {
    display: inline-block;
    background-color: var(--color-success);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: var(--space-xs);
    vertical-align: middle;
}

/* Item Details (sub-text) */
.item-details {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 2px;
}