/**
 * Restaurant Theme — component overrides (standalone, no Tailwind build required).
 * Typography: H1 26-28px, Section 18px, Card 16px, Body 14-15px, Labels 13-14px, Price 18px, Total 22px.
 * Buttons: Primary 48px / 12px radius, Secondary 40px, Small 36px. Focus: 2px ring.
 * Shared by default + restaurant themes for parity.
 */

/* --- Pre-header utility strip (address, tel, icons): readable on light bg for default + restaurant --- */
.site-header__utility-item,
.site-header__utility-phone {
    color: var(--theme-text, #334155) !important;
}
.site-header__utility-icon {
    color: var(--theme-text, #64748b) !important;
    opacity: 0.9;
}
.site-header__mobile-address {
    color: var(--theme-text, #334155) !important;
}

/* --- Typography scale --- */
.restaurant-theme-h1 {
    font-size: clamp(1.625rem, 4vw, 1.75rem);
    font-weight: 600;
    line-height: 1.3;
}
.restaurant-theme-section-title {
    font-size: 1.125rem;
    font-weight: 500;
}
.restaurant-theme-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text, #2D2926);
}
.restervation-summary-sidebar .restaurant-theme-card-title {
    color: var(--theme-heading, #1a1a1a);
    font-size: 1.0625rem;
}
.restaurant-theme-body { font-size: 0.9375rem; line-height: 1.6; }
.restaurant-theme-label {
    font-size: 0.8125rem;
    color: var(--theme-text, #2D2926);
    font-weight: 500;
}
.reservation-summary-sidebar .restaurant-theme-label {
    color: var(--theme-text, #4A4540);
}
.restaurant-theme-price,
.restaurant-menu-price { font-size: 1.125rem; font-weight: 700; color: #dc2626 !important; }
.restaurant-theme-total { font-size: 1.375rem; font-weight: 700; color: #dc2626 !important; }

/* --- Buttons: 48px primary, 12px radius, focus ring --- */
/* btn-lg: larger touch targets for reservation flow (user requirement) */
.btn-lg {
    min-height: 52px;
    padding: 14px 24px;
    font-size: 1rem;
}

.restaurant-btn-primary {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 12px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.restaurant-btn-primary.btn-lg {
    min-height: 52px;
    padding: 14px 24px;
    font-size: 1rem;
}
.restaurant-btn-primary:hover:not(:disabled) {
    background-color: var(--theme-button-primary-hover, #4A2323) !important;
    box-shadow: 0 4px 12px rgba(92, 45, 45, 0.2);
}
.restaurant-btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--theme-input-focus-shadow, rgba(92, 45, 45, 0.2));
}
.restaurant-btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}
.restaurant-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.restaurant-btn-secondary {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 12px;
}

.restaurant-btn-small {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    border-radius: 10px;
}

/* --- Inputs: 44px height, focus ring --- */
.restaurant-input,
.restaurant-theme input[type="text"],
.restaurant-theme input[type="email"],
.restaurant-theme input[type="tel"],
.restaurant-theme select,
.restaurant-theme textarea {
    min-height: 44px;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.restaurant-theme input:focus,
.restaurant-theme select:focus,
.restaurant-theme textarea:focus {
    outline: none;
    border-color: var(--theme-primary, #5C2D2D) !important;
    box-shadow: 0 0 0 2px rgba(92, 45, 45, 0.15);
}

/* --- Summary panel: 24px padding, 16px row gap, total row tinted --- */
.reservation-summary-sidebar .reservation-summary-content {
    padding: 24px;
}
.reservation-summary-sidebar .res-summary-row {
    padding-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--theme-border, #E5E0DB);
}
.reservation-summary-sidebar .res-summary-row:last-child {
    border-bottom: none;
}
.reservation-summary-sidebar .res-summary-row:nth-last-child(2) {
    border-bottom: none !important;
}
.reservation-summary-total-row {
    background-color: rgba(92, 45, 45, 0.05) !important;
    border: 1px solid var(--theme-border, #E5E0DB);
    border-radius: 12px;
    padding: 20px !important;
}

/* ============================================
   RESERVATION FLOW STEP INDICATOR
   Premium restaurant-style: 日時・人数 → メニュー選択 → 確認
   Enterprise-level clarity, Japanese reservation site standard.
   ============================================ */
.reservation-flow-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    padding: 0 0.5rem;
}
.reservation-flow-steps::before {
    content: '';
    position: absolute;
    top: 1.125rem;
    left: 2.5rem;
    right: 2.5rem;
    height: 2px;
    background: var(--theme-border, #E5E0DB);
    z-index: 0;
}
.reservation-flow-steps .reservation-flow-progress-wrap {
    position: absolute;
    top: 1.125rem;
    left: 2.5rem;
    right: 2.5rem;
    height: 2px;
    overflow: hidden;
    z-index: 1;
}
.reservation-flow-steps .reservation-flow-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--theme-primary, #5C2D2D), var(--theme-accent-gold, #C4A882));
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.reservation-flow-step {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 5rem;
}
.reservation-flow-step__circle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: var(--theme-font-secondary, 'Noto Sans JP'), sans-serif;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}
.reservation-flow-step.active .reservation-flow-step__circle {
    background: var(--theme-primary, #5C2D2D);
    color: #fff;
    box-shadow: 0 2px 8px rgba(92, 45, 45, 0.25);
}
.reservation-flow-step.completed .reservation-flow-step__circle {
    background: var(--theme-primary, #5C2D2D);
    color: #fff;
}
.reservation-flow-step.completed .reservation-flow-step__circle i {
    font-size: 0.625rem;
}
@media (min-width: 640px) {
    .reservation-flow-step.completed .reservation-flow-step__circle i {
        font-size: 0.6875rem;
    }
}
.reservation-flow-step.pending .reservation-flow-step__circle {
    background: var(--theme-card-background, #FFFFFF);
    color: var(--theme-muted, #A09A94);
    border: 2px solid var(--theme-border, #E5E0DB);
}
.reservation-flow-step__label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.3;
    max-width: 6.5rem;
}
.reservation-flow-step.active .reservation-flow-step__label {
    color: var(--theme-text, #2D2926);
}
.reservation-flow-step.completed .reservation-flow-step__label,
.reservation-flow-step.pending .reservation-flow-step__label {
    color: var(--theme-muted, #A09A94);
}
@media (min-width: 640px) {
    .reservation-flow-steps {
        max-width: 480px;
    }
    .reservation-flow-step__circle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.875rem;
    }
    .reservation-flow-step__label {
        font-size: 0.75rem;
        max-width: 5.5rem;
    }
}


.restaurant-menu-list .relative,
.restaurant-menu-list .restaurant-menu-card {
    border-radius: 12px;
    border: 1px solid var(--theme-border, #E5E0DB);
    background: var(--theme-card-background, #FFFFFF);
    box-shadow: 0 1px 3px rgba(45, 41, 38, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.restaurant-menu-list .relative:hover,
.restaurant-menu-list .restaurant-menu-card:hover {
    border-color: var(--theme-border-hover, #C4BEB6);
    box-shadow: 0 4px 12px rgba(45, 41, 38, 0.06);
}
/* Selected card: green border + subtle tint for clear selected indication */
.restaurant-menu-list .restaurant-menu-card:has(.order-menus.selected),
.restaurant-menu-list .relative:has(.order-menus.selected) {
    border-color: var(--theme-success, #16a34a) !important;
    border-width: 2px;
    background-color: rgba(var(--theme-success-rgb, 22, 163, 74), 0.08) !important;
    box-shadow: 0 0 0 1px var(--theme-success, #16a34a);
}
/* Selected button: green for clear selected indication */
.restaurant-menu-list .order-menus.selected {
    border-color: var(--theme-success, #16a34a) !important;
    background-color: var(--theme-success, #16a34a) !important;
    color: #fff !important;
}

.reservation-summary-sidebar {
    border-radius: 12px;
    border: 1px solid var(--theme-border, #E5E0DB);
    background: var(--theme-card-background, #FFFFFF);
}

.sticky-action-area .sticky-wrapper { position: relative; }
@media (max-width: 639px) {
    .sticky-action-area {
        position: sticky;
        bottom: 0;
        z-index: 30;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

#timePickerModal .bg-white,
#guestPickerModal .bg-white { border-radius: 12px; }

#timeSlotsGrid .time-slot-btn {
    border-radius: 8px;
    border: 1px solid var(--theme-border, #E5E0DB);
    padding: 8px 4px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}
#timeSlotsGrid .time-slot-btn:hover:not(.disabled) {
    border-color: var(--theme-primary, #5C2D2D);
    background-color: rgba(92, 45, 45, 0.04);
}
#timeSlotsGrid .time-slot-btn.selected {
    background-color: var(--theme-button-primary, var(--theme-primary));
    border-color: var(--theme-button-primary, var(--theme-primary));
    color: var(--theme-button-text, #fff);
}
#timeSlotsGrid .time-slot-btn.selected:hover:not(.disabled) {
    background-color: var(--theme-button-primary-hover, var(--theme-primary-hover));
    border-color: var(--theme-button-primary-hover, var(--theme-primary-hover));
    color: var(--theme-button-primary-text-hover, var(--theme-button-text, #fff));
}
#timeSlotsGrid .time-slot-btn.selected:active:not(.disabled) {
    background-color: var(--theme-button-primary-active, var(--theme-button-primary-hover));
    border-color: var(--theme-button-primary-active, var(--theme-button-primary-hover));
}

#guestNumberGrid .guest-btn,
#guestNumberGrid .guest-number-btn {
    border-radius: 8px;
    border: 1px solid var(--theme-border, #E5E0DB);
    padding: 8px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}
#guestNumberGrid .guest-btn:hover,
#guestNumberGrid .guest-number-btn:hover { border-color: var(--theme-primary, #5C2D2D); }
#guestNumberGrid .guest-btn.selected,
#guestNumberGrid .guest-number-btn.selected,
#guestNumberGrid .guest-number-btn-selected {
    background-color: var(--theme-button-primary, var(--theme-primary));
    border-color: var(--theme-button-primary, var(--theme-primary));
    color: var(--theme-button-text, #fff);
}
#guestNumberGrid .guest-btn.selected:hover,
#guestNumberGrid .guest-number-btn.selected:hover,
#guestNumberGrid .guest-number-btn-selected:hover {
    background-color: var(--theme-button-primary-hover, var(--theme-primary-hover));
    border-color: var(--theme-button-primary-hover, var(--theme-primary-hover));
    color: var(--theme-button-primary-text-hover, var(--theme-button-text, #fff));
}
#guestNumberGrid .guest-btn.selected:active,
#guestNumberGrid .guest-number-btn.selected:active,
#guestNumberGrid .guest-number-btn-selected:active {
    background-color: var(--theme-button-primary-active, var(--theme-button-primary-hover));
    border-color: var(--theme-button-primary-active, var(--theme-button-primary-hover));
}

.datepicker {
    border-radius: 12px !important;
    border: 1px solid var(--theme-border, #E5E0DB) !important;
    box-shadow: 0 8px 24px rgba(45, 41, 38, 0.08) !important;
    font-family: var(--theme-font-secondary, 'Noto Sans JP'), sans-serif !important;
}
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.highlighted {
    background-color: var(--theme-primary, #5C2D2D) !important;
    color: #fff !important;
}
.datepicker table tr td.today {
    background-color: rgba(92, 45, 45, 0.08) !important;
    color: var(--theme-primary, #5C2D2D) !important;
}
.datepicker table tr td:hover {
    background-color: var(--theme-background, #F7F5F3) !important;
}

#floatingSummaryBar,
#floatingActionBar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.theme-alert-info {
    background: rgba(59, 111, 160, 0.05);
    border-left: 2px solid var(--theme-info, #3B6FA0);
}
.theme-alert-warning {
    background: rgba(192, 139, 48, 0.05);
    border-left: 2px solid var(--theme-warning, #C08B30);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea,
select {
    font-family: var(--theme-font-secondary, 'Noto Sans JP'), sans-serif;
}

@keyframes pulse-subtle {
    0%, 100% { box-shadow: 0 0 0 0 rgba(92, 45, 45, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(92, 45, 45, 0); }
}
.animate-pulse-subtle {
    animation: pulse-subtle 2.5s ease-in-out infinite;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   SHOP HEADER TEXT (dynamic from JSON)
   Long text handling + responsive for restaurant theme overlay
   ============================================ */
.reservation-hero-block .shop-header-text {
    min-width: 0;
    max-width: min(28rem, calc(100% - 2rem));
    overflow: visible;
}
.reservation-hero-block .shop-header-overlay-title,
.reservation-hero-block .shop-header-overlay-subtitle {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}
.reservation-hero-block .shop-header-overlay-title {
    max-width: 100%;
}
.reservation-hero-block .shop-header-overlay-subtitle {
    max-width: 100%;
}
@media (max-width: 479px) {
    .reservation-hero-block .shop-header-text {
        max-width: calc(100% - 1.5rem);
        padding: 0.75rem 1rem;
    }
    .reservation-hero-block .shop-header-overlay-title {
        font-size: clamp(0.875rem, 4vw, 1.0625rem);
    }
    .reservation-hero-block .shop-header-overlay-subtitle {
        font-size: clamp(0.6875rem, 2.5vw, 0.8125rem);
    }
}
@media (min-width: 480px) and (max-width: 639px) {
    .reservation-hero-block .shop-header-text {
        max-width: min(22rem, calc(100% - 1.5rem));
    }
}
@media (min-width: 1024px) {
    .reservation-hero-block .shop-header-text {
        max-width: min(30rem, calc(100% - 3rem));
    }
}

/* QA: Desktop — 60/40 layout, step indicator primary, summary labels left/values right, total row tinted, CTA 48px.
 * QA: Tablet — 2-col or stacked, sticky CTA visible, no overflow.
 * QA: Mobile — stacked cards, sticky bar aligned container width, touch targets ≥44px, focus visible. */
