/* =============================================
   予約システム共通スタイル
   ============================================= */

/* ---- 予約ページ レイアウト ---- */
.reserve-page-outer {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px 80px;
    box-sizing: border-box;
}

.reserve-page-card {
    background: #fff;
    border-radius: 16px;
    padding: 50px 50px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.reserve-page-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: 0.05em;
}

.reserve-page-title span {
    font-size: 0.5825em;
    font-weight: 400;
    letter-spacing: 0;
    margin-left: 8px;
    color: #666;
    letter-spacing: 0.4px;
}

@media (max-width: 640px) {
    .reserve-page-card {
        padding: 28px 20px;
    }
}

/* ---- カレンダーラッパー ---- */
.reservation-calendar-wrap {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    font-family: inherit;
    color: #1d1d1d;
}

/* ---- 月ナビゲーション ---- */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    margin-bottom: 30px;
}

.cal-nav-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.cal-nav-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #888;
}

.cal-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.cal-month-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ---- カレンダー本体 ---- */
.cal-body {
    width: 100%;
}

.cal-loading {
    text-align: center;
    padding: 32px 0;
    color: #888;
    font-size: 0.9rem;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

/* 曜日ヘッダー */
.cal-weekday {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    padding: 4px 0 8px;
    font-weight: 500;
}

.cal-weekday.sun { color: #c0392b; }
.cal-weekday.sat { color: #2980b9; }

/* 日付セル */
.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    gap: 3px;
}

.cal-day.empty {
    cursor: default;
}

.cal-day:not(.empty):not(.past):not(.closed):hover {
    background: rgba(0, 0, 0, 0.06);
}

.cal-day.past {
    opacity: 0.35;
    cursor: default;
}

.cal-day.closed {
    opacity: 0.4;
    cursor: default;
}

.cal-day.today .cal-day-num {
    background: #1d1d1d;
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-day.selected {
    background: rgba(0, 0, 0, 0.08);
}

.cal-day-num {
    font-size: 0.85rem;
    line-height: 1;
}

.cal-day.sun .cal-day-num { color: #c0392b; }
.cal-day.sat .cal-day-num { color: #2980b9; }

/* 空き状態ドット */
.cal-day-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.cal-day-dot.available { background: #27ae60; }
.cal-day-dot.few       { background: #e67e22; }
.cal-day-dot.full      { background: #c0392b; }
.cal-day-dot.closed    { background: #bbb; }

/* ---- 凡例 ---- */
.cal-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #666;
}

.cal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.cal-dot.available { background: #27ae60; }
.cal-dot.few       { background: #e67e22; }
.cal-dot.full      { background: #c0392b; }
.cal-dot.closed    { background: #bbb; }

/* ---- タイムスロット ---- */
.cal-slots-wrap {
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.cal-slots-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    font-weight: 600;
}

.cal-slots-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #888;
    padding: 0 4px;
    line-height: 1;
}

.cal-slots {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.cal-slot-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    gap: 3px;
}

.cal-slot-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #aaa;
}

.cal-slot-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.cal-slot-time {
    font-size: 0.85rem;
    font-weight: 600;
}

.cal-slot-avail {
    font-size: 0.7rem;
    color: #666;
}

.cal-slot-btn.full {
    background: #fef0f0;
    border-color: #f5c6c6;
}

.cal-slot-btn.few .cal-slot-avail {
    color: #e67e22;
}

/* ---- 予約フォームページ ---- */
.reserve-subtitle {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 30px;
    letter-spacing: 0.4px;
}

/* フォーム */
.reservation-form .form-row {
    margin-bottom: 20px;
}

.reservation-form label {
    display: flex;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    letter-spacing: 0.4px;
}

.reservation-form label .required {
    color: #c0392b;
    margin-top: 1px;
    margin-left: 4px;
    font-size: 0.75rem;
}

.reservation-form input[type="text"],
.reservation-form input[type="email"],
.reservation-form input[type="tel"],
.reservation-form input[type="date"],
.reservation-form input[type="time"],
.reservation-form input[type="number"],
.reservation-form select,
.reservation-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    letter-spacing: 0.4px;
    height: 42px;
}

.reservation-form input:focus,
.reservation-form select:focus,
.reservation-form textarea:focus {
    outline: none;
    border-color: #1d1d1d;
}

.reservation-form textarea {
    height: 100px;
    resize: vertical;
}

.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

.table-count-note {
    display: flex;
    align-items: flex-start;
    margin: 5px 0 0;
    padding:5px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #555;
    line-height: 1.4;
}

.table-count-note-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.reserve-submit-btn {
    width: 100%;
    padding: 14px;
    background: #1d1d1d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.2s;
    margin-top: 8px;
}

.reserve-submit-btn:hover {
    background: #444;
}

.reserve-submit-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.policy-agree-wrap {
    margin: 20px 0 12px;
    padding: 14px 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.reservation-form .policy-agree-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: #333;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.policy-agree-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    /* margin-top: 1px; */
    accent-color: #1d1d1d;
    cursor: pointer;
}

.policy-agree-label a {
    color: #1d1d1d;
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-right: 5px;
}

.policy-agree-label a:hover {
    color: #555;
}

.policy-agree-label span {
    margin-top: -2px;
    letter-spacing: 0.4px;
    font-size: 0.9945em;
    line-height: 1.5;
}

/* フォームメッセージ */
.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
}

.form-message.success {
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #a9dfbf;
    display: block;
}

.form-message.error {
    background: #fef0f0;
    color: #922b21;
    border: 1px solid #f5b7b1;
    display: block;
}

/* 予約確認サマリー */
.reserve-summary {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    letter-spacing: 0.4px;
}

.reserve-summary-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reserve-summary dl {
    display: grid;
    grid-template-columns: 6em 1fr;
    gap: 6px 12px;
    margin: 0;
}

.summary-optional-row {
    display: contents;
}

.reserve-summary dt {
    color: #888;
    font-size: 0.8125rem;
}

.reserve-summary dd {
    margin: 0;
    font-weight: 500;
    font-size: 0.875rem;
}

/* ---- モーダル ---- */
.reserve-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.reserve-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px 32px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    z-index: 1001;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.reserve-modal.is-open,
.reserve-modal.is-open ~ .reserve-modal-overlay,
.reserve-modal-overlay:has(~ .reserve-modal.is-open) {
    display: block;
}

/* overlayはmodalより前にDOMにあるので別途対応 */
.reserve-modal.is-open {
    display: block;
}

.reserve-modal-overlay.is-open {
    display: block;
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

.modal-icon.success {
    background: #eafaf1;
    color: #1e8449;
}

.modal-icon.error {
    background: #fef0f0;
    color: #c0392b;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1d1d1d;
}

.modal-body {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.7;
    margin: 0 0 24px;
    white-space: pre-line;
}

.modal-close-btn {
    width: 100%;
    padding: 12px;
    background: #1d1d1d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: #444;
}

/* ---- レスポンシブ ---- */
@media (max-width: 480px) {
    .cal-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-row-2col {
        grid-template-columns: 1fr;
    }

    .table-count-note {
        padding: 5px 14px;
    }
}

/* ---- ポリシーページ ---- */
.policy-page-card {
    max-width: 720px;
}

.policy-body {
    margin-top: 24px;
}

.policy-section {
    margin-bottom: 32px;
}

.policy-section h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #1d1d1d;
}

.policy-section p {
    font-size: 0.875rem;
    color: #444;
    line-height: 1.8;
    margin: 0;
}

.policy-section ul {
    margin: 8px 0 0;
    padding-left: 1.4em;
}

.policy-section ul li {
    font-size: 0.875rem;
    color: #444;
    line-height: 1.8;
}

.policy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.policy-table th,
.policy-table td {
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.policy-table thead th {
    background: #1d1d1d;
    color: #fff;
    font-weight: 600;
}

.policy-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}

.policy-back-wrap {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.policy-back-btn {
    /* background: none; */
    display: block;
    margin: 0 auto;
    border: none;
    padding: 10px 12px;
    font-size: 0.875rem;
    color: #1d1d1d;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.policy-back-btn:hover {
    text-decoration: underline;
}

/* ---- 予約オプション ---- */
.option-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.option-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 0.88rem;
    color: #333;
    cursor: pointer;
    font-weight: normal;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 0;
}

.option-check-label:hover {
    border-color: #1d1d1d;
    background: #f7f7f7;
}

.option-check-label span {
    /* margin-top: -2px; */
    line-height: 1.5;
}

.option-check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1d1d1d;
    cursor: pointer;
    flex-shrink: 0;
}

.option-check-label:has(input:checked) {
    border-color: #1d1d1d;
    background: #1d1d1d;
    color: #fff;
}

/* ---- パンくずリスト ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 0.8125rem;
    color: #888;
}

.breadcrumb a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #1d1d1d;
}

.breadcrumb-sep {
    color: #ccc;
}

.breadcrumb span:last-child {
    color: #1d1d1d;
}