/* ================================================
   Reservation Page Styles (matched to cafeyu.xyz/reservation.html)
   ================================================ */

.reservation-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.gallery-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image img {
    width: 100%;
    height: auto;
}

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

.thumbnail-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail-grid img:hover {
    border-color: #2ea3f2;
}

.booking-section h1 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 400;
}

.price {
    font-size: 18px;
    color: #2ea3f2;
    margin-bottom: 15px;
}

.manage-link {
    background: #f0f8ff;
    border: 1px solid #2ea3f2;
    border-radius: 4px;
    padding: 12px 20px;
    margin-bottom: 30px;
    text-align: center;
}

.manage-link a {
    color: #2ea3f2;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.manage-link a:hover {
    text-decoration: underline;
}

.booking-legend-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #b3e5fc;
    vertical-align: middle;
}

.booking-legend-note {
    text-align: right;
    margin: -20px 0 20px;
}

.booking-legend-mark {
    color: #ff9800;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

.booking-legend-text {
    font-size: 12px;
    font-weight: 600;
    color: #1976d2;
    letter-spacing: 0.02em;
}

.calendar-container {
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
}

.calendar-header button:hover {
    background: #f0f0f0;
}

.calendar-title {
    font-size: 18px;
    font-weight: 700;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 12px;
    color: #999;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    background: #fff;
}

.calendar-day.other-month {
    color: #ccc;
    background: #f9f9f9;
}

.calendar-day.weekend {
    background: #e8f5e9;
}

.calendar-day.weekday-evening {
    background: #fff9e6;
}

.calendar-day.closed {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.calendar-day.available:hover {
    background: #e3f2fd;
    border-color: #2ea3f2;
}

.calendar-day.selected {
    background: #2ea3f2;
    color: #fff;
    border-color: #2ea3f2;
}

.calendar-day .times {
    font-size: 9px;
    color: #666;
    margin-top: 2px;
}

.calendar-day .booking-mark {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    line-height: 1;
    color: #ff9800;
    font-weight: 700;
}

.calendar-day.selected .booking-mark {
    color: #ffffff;
}

.time-slots {
    margin-top: 20px;
}

.time-slots-help {
    background: #e3f2fd;
    padding: 10px 15px;
    border-left: 4px solid #2196f3;
    margin-bottom: 15px;
    font-size: 13px;
    color: #1976d2;
}

.time-slot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.time-slot {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
    cursor: pointer;
    background: #fff;
    font-size: 13px;
}

.time-slot.available {
    background: #e8f5e9;
}

.time-slot.available:hover {
    background: #c8e6c9;
    border-color: #4caf50;
}

.time-slot.booked {
    background: #ffcdd2;
    color: #999;
    cursor: not-allowed;
}

.time-slot.selected {
    background: #2ea3f2;
    color: #fff;
    border-color: #2ea3f2;
}

.time-slot.first-selected {
    background: #ff9800;
    color: #fff;
    border-color: #ff9800;
    position: relative;
}

.time-slot.first-selected::after {
    content: '開始';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.options-section {
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.options-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 400;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
}

.option-item input[type='checkbox'] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-item label {
    cursor: pointer;
    flex: 1;
}

.summary-section {
    margin-top: 30px;
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
}

.summary-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 400;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
}

.booking-form {
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.payment-methods {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.payment-methods label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 0;
    white-space: nowrap;
}

.payment-methods input[type='radio'] {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.card-payment-section {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    background: #fafafa;
}

.card-brand {
    width: 100%;
    margin-bottom: 10px;
}

.card-brand img {
    width: 100%;
    max-height: 54px;
    object-fit: contain;
    object-position: left center;
    display: block;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    padding: 6px 10px;
}

#card-container {
    min-height: 42px;
}

.form-group input:not([type='radio']):not([type='checkbox']),
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-family: inherit;
}

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

.submit-button {
    width: 100%;
    padding: 15px;
    background: #000;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-button:hover {
    background: #333;
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .reservation-container {
        grid-template-columns: 1fr;
        margin: 20px auto;
        padding: 0 15px;
    }

    .time-slot-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 480px) {
    .reservation-container {
        margin: 15px auto;
        padding: 0;
    }

    .gallery-section {
        margin-bottom: 20px;
    }

    .main-image {
        margin-bottom: 10px;
        margin-left: 15px;
        margin-right: 15px;
    }

    .main-image img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        margin: 0 15px;
    }

    .thumbnail-grid img {
        width: 100%;
        height: 60px;
        object-fit: cover;
    }

    .calendar-container {
        padding: 8px;
        margin-bottom: 15px;
    }

    .calendar-header {
        margin-bottom: 10px;
    }

    .calendar-header button {
        padding: 5px 8px;
        font-size: 16px;
    }

    .calendar-title {
        font-size: 15px;
    }

    .calendar-day {
        min-height: 40px;
        padding: 2px;
        font-size: 11px;
    }

    .calendar-day .times {
        font-size: 7px;
        margin-top: 0;
        line-height: 1.1;
        white-space: nowrap;
    }

    .calendar-weekdays {
        font-size: 10px;
        margin-bottom: 5px;
    }

    .calendar-days {
        gap: 2px;
    }

    .time-slot-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .time-slot {
        padding: 12px;
        font-size: 14px;
    }

    .summary-section {
        margin-left: 15px;
        margin-right: 15px;
        padding: 15px;
    }

    .booking-form {
        padding-left: 15px;
        padding-right: 15px;
    }

    .summary-item {
        font-size: 13px;
        padding: 8px 0;
    }

    .summary-total {
        font-size: 18px;
        padding: 12px 0;
    }
}
