/* ================================================
   WP Takeout Reservation - フロントエンドCSS
   全セレクタに wpto- プレフィクス付与でテーマ干渉を防止
   ================================================ */

/* -- 全体ラッパー -- */
.wpto-reservation-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #111;
}

/* -- セクションタイトル -- */
.wpto-section-title {
    font-family: Dosis, 'Open Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 20px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 40px;
    color: #111;
}

.wpto-section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: #111;
    margin: 12px auto 0;
}

.wpto-notice-text {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 0;
}

/* -- 商品カード -- */
.wpto-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.wpto-product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow .3s, transform .2s;
}

.wpto-product-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, .1);
    transform: translateY(-3px);
}

.wpto-product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.wpto-product-info {
    padding: 18px 20px;
}

.wpto-product-name {
    font-family: Dosis, 'Open Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #111;
}

.wpto-product-desc {
    color: #999;
    font-size: 12px;
    margin: 0 0 10px;
}

.wpto-product-price {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin: 0 0 12px;
}

.wpto-product-price span {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.wpto-quantity-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpto-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    border-radius: 2px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    color: #111;
    line-height: 1;
}

.wpto-qty-btn:hover {
    background: #eee;
}

.wpto-qty-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 5px;
    font-size: 14px;
}

.wpto-qty-input::-webkit-inner-spin-button,
.wpto-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.wpto-qty-input[type=number] {
    -moz-appearance: textfield;
}

/* BPP（基本＋追加人前）表示 */
.wpto-bpp-display {
    display: inline-block;
    min-width: 120px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 2px;
    background: #f8f8f8;
}

.wpto-bpp-active .wpto-bpp-display {
    color: #111;
    border-color: #111;
    background: #fff;
    font-weight: 600;
}

.wpto-product-card.wpto-bpp-active {
    border-color: #111;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

/* -- 合計欄 -- */
.wpto-order-summary {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 20px 25px;
    margin-bottom: 30px;
    text-align: center;
}

.wpto-total-label {
    font-family: Dosis, 'Open Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 13px;
    color: #777;
    margin-bottom: 5px;
}

.wpto-total-amount {
    font-size: 28px;
    font-weight: 700;
    color: #111;
}

.wpto-total-amount small {
    font-size: 13px;
    color: #999;
    font-weight: 400;
}

/* -- フォームセクション -- */
.wpto-form-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 0 0 40px;
}

.wpto-reservation-form {
    max-width: 900px;
    margin: 0 auto;
}

.wpto-reservation-columns {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.wpto-reservation-col-left {
    flex: 0 0 auto;
    min-width: 0;
}

.wpto-reservation-col-right {
    flex: 1;
    min-width: 0;
}

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

.wpto-form-group label {
    display: block;
    font-family: Dosis, 'Open Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 12px;
    color: #777;
    margin-bottom: 6px;
}

.wpto-required {
    color: #e41919;
    margin-left: 3px;
}

.wpto-form-group input[type="text"],
.wpto-form-group input[type="email"],
.wpto-form-group input[type="tel"],
.wpto-form-group input[type="date"],
.wpto-form-group select,
.wpto-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    color: #111;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s;
}

.wpto-form-group input:focus,
.wpto-form-group select:focus,
.wpto-form-group textarea:focus {
    outline: none;
    border-color: #111;
}

.wpto-form-group textarea {
    height: 80px;
    resize: vertical;
}

.wpto-form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='6'%3E%3Cpath d='M0 0l6 6 6-6z' fill='%23777'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

/* -- 送信ボタン -- */
.wpto-btn-reserve {
    display: block;
    width: 100%;
    padding: 14px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 2px;
    font-family: Dosis, 'Open Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
    margin-top: 10px;
}

.wpto-btn-reserve:hover {
    background: #333;
}

.wpto-btn-reserve:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* -- メッセージ -- */
.wpto-msg-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.wpto-msg-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px 20px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    white-space: pre-line;
}

/* ================================================
   カレンダーウィジェット
   ================================================ */
.wpto-calendar-widget {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    max-width: 400px;
}

.wpto-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1a1a2e;
    color: #fff;
}

.wpto-cal-title {
    font-size: 15px;
    font-weight: 600;
    font-family: Dosis, sans-serif;
    letter-spacing: 0.5px;
}

.wpto-cal-nav {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
}

.wpto-cal-nav:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

.wpto-cal-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #777;
    padding: 4px 0 8px;
    text-transform: uppercase;
}

.wpto-cal-weekday.sun {
    color: #c0392b;
}

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

.wpto-cal-cell {
    text-align: center;
    padding: 6px 2px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    position: relative;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpto-cal-cell.empty {
    cursor: default;
}

.wpto-cal-day {
    display: block;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.wpto-cal-cell[data-date]:hover {
    background: #f0f0f0;
}

.wpto-cal-cell.selected {
    background: #1a1a2e;
    color: #fff;
}

.wpto-cal-cell.selected .wpto-cal-day {
    color: #fff;
}

.wpto-cal-cell.today .wpto-cal-day {
    font-weight: 700;
}

.wpto-cal-cell.today:not(.selected):not(.closed):not(.disabled) {
    border: 2px solid #1a1a2e;
}

.wpto-cal-cell.sun .wpto-cal-day {
    color: #c0392b;
}

.wpto-cal-cell.sat .wpto-cal-day {
    color: #2980b9;
}

.wpto-cal-cell.selected.sun .wpto-cal-day,
.wpto-cal-cell.selected.sat .wpto-cal-day {
    color: #fff;
}

.wpto-cal-cell.disabled {
    cursor: default;
}

.wpto-cal-cell.out-of-range .wpto-cal-day {
    color: #ccc;
}

.wpto-cal-cell.regular-closed {
    background: #fde8e8;
    cursor: not-allowed;
}

.wpto-cal-cell.regular-closed .wpto-cal-day {
    color: #c0392b;
}

.wpto-cal-cell.regular-closed::after {
    content: '×';
    position: absolute;
    bottom: 1px;
    right: 4px;
    font-size: 9px;
    color: #e74c3c;
    font-weight: 700;
}

.wpto-cal-cell.adhoc-closed {
    background: #f5f5f5;
    cursor: not-allowed;
}

.wpto-cal-cell.adhoc-closed .wpto-cal-day {
    color: #999;
    text-decoration: line-through;
}

.wpto-cal-cell.special-open {
    cursor: pointer;
}

.wpto-cal-cell.special-open::after {
    content: '◎';
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 8px;
    color: #27ae60;
    font-weight: 700;
}

.wpto-cal-legend {
    display: flex;
    gap: 14px;
    padding: 8px 14px 10px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.wpto-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
}

.wpto-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.wpto-legend-dot.regular {
    background: #fde8e8;
    border: 1px solid #e74c3c;
}

.wpto-legend-dot.adhoc {
    background: #f5f5f5;
    border: 1px solid #999;
}

.wpto-legend-dot.special {
    background: #e8f5e9;
    border: 1px solid #27ae60;
}

/* -- 予約不可商品 -- */
.wpto-product-card.wpto-unavailable {
    opacity: 0.45;
    pointer-events: none;
    position: relative;
}

.wpto-product-card.wpto-unavailable .wpto-qty-btn,
.wpto-product-card.wpto-unavailable .wpto-qty-input {
    pointer-events: none;
}

.wpto-product-unavailable-note {
    background: #fff3e0;
    color: #bf360c;
    font-size: 12px;
    padding: 8px 14px;
    text-align: center;
    border-top: 1px solid #ffe0b2;
}

/* -- レスポンシブ -- */
@media (max-width: 768px) {
    .wpto-products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .wpto-reservation-columns {
        flex-direction: column;
    }

    .wpto-reservation-col-left,
    .wpto-reservation-col-right {
        width: 100%;
    }

    .wpto-calendar-widget {
        max-width: 100%;
    }

    .wpto-reservation-wrap {
        padding: 20px 15px;
    }

    .wpto-order-summary .wpto-total-amount {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .wpto-product-image {
        height: 160px;
    }

    .wpto-section-title {
        font-size: 17px;
    }
}