/**
 * BBQ予約 フロントエンドスタイル
 */
.woocommerce-content {
    border-color:var(--border-color);
    --border-color:#ddd;
    --layer-color:#d3f5ffa0;
}
.bbq-term-wrapper { 
    margin:1em 0 2em;
    font-size:.875em;
    max-height:480px;
    overflow-y:auto;
    border-radius:8px; border-width:1px;
    padding:16px;
}
/* フォームセクション */
.bbq-form-section {
    margin-bottom: 2em;
    padding: 1.5em;
    background: #f9f9f9;
    border-radius: 8px;
}

.bbq-form-section h2 {
    font-size: 1.1em;
    margin: 0 0 1em 0;
    padding-bottom: .5em;
    border-bottom-width: 1px;
}

/* フォーム行 */
.bbq-form-row {
    margin-bottom: 1em;
}

.bbq-form-row:last-child {
    margin-bottom: 0;
}

.bbq-form-row > label {
    display: block;
}

.bbq-label {
    display: block;
    font-weight: 500;
    margin-bottom: .5em;
}

.bbq-label .required {
    color: #c00;
}

.bbq-form-row input[type="text"],
.bbq-form-row input[type="email"],
.bbq-form-row input[type="tel"],
.bbq-form-row input[type="date"],
.bbq-form-row input[type="number"],
.bbq-form-row textarea {
    width: 100%;
    max-width: 400px;
    padding: .6em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

.bbq-form-row input[type="number"] {
    max-width: 100px;
}

.bbq-suffix {
    margin-left: .5em;
}

/* 時間帯選択 */
.bbq-slot-options {
    display: flex;
    flex-direction: column;
    gap: .5em;
}

.bbq-slot-option {
    display: flex;
    align-items: center;
    padding: .75em 1em;
    background: #fff;
    border-width: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
}

.bbq-slot-option:hover {
    border-color: var(--gray-color);
}

.bbq-slot-option input[type="radio"] {
    margin: 0;
}

.bbq-slot-option input[type="radio"]:checked + .bbq-slot-label {
    font-weight: 600;
}

.bbq-slot-label {
    flex: 1;
}

.bbq-slot-availability {
    font-size: .875em;
    color: var(--gray-color);
}

.bbq-slot-availability.full {
    color: #c00;
}

.bbq-slot-option:has(input:disabled) {
    pointer-events: none;
    cursor: not-allowed;
}

.bbq-slot-option:has(input:disabled) .bbq-slot-label {
    opacity: 0.5;
}

.bbq-guest-count-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap:1em;

}
.bbq-guest-count-item{
    display: flex;
    align-items: center;
    gap: .25em;
}

.bbq-form-row input.bbq-guest-input {
    width:6em;
}

.bbq-guest-type {
    display:block;
    word-break: keep-all;
    line-height:1.4;
}
.bbq-guest-type small { display:block; word-break: keep-all; font-size:10px; }

/* フォームアクション */
.bbq-form-actions {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top-width: 1px ;
}

.bbq-form-notice {
    flex: 1;
    font-weight: 500;
}

.bbq-form-notice.success {
    color: #090;
}

.bbq-form-notice.error {
    color: #c00;
}

.bbq-form-error {
    padding: 1em;
    margin-bottom: 1.5em;
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    color: #c00;
}

.bbq-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* 予約サマリー */
.bbq-summary {
    margin-bottom: 2em;
}

.bbq-summary h2 {
    font-size: 1em;
    margin: 0 0 1em 0;
}

.bbq-summary-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .5em 1em;
    padding:1em;
    border-width:1px;
    margin: 0 0 1em;
}

.bbq-summary-list dt {
    font-weight: 500;
    color: var(--gray-color);
}

.bbq-summary-list dd {
    margin: 0;
}

/* 商品選択 */
.bbq-product-selection h2 {
    font-size: 1.1em;
    margin-bottom: .5em;
}

.bbq-description {
    color: var(--gray-color);
    margin-bottom: 1.5em;
}

.bbq-product-cat {
    margin:0;
    border-top-width:1px;
}
.bbq-product-cat-heading { 
    margin:0;
    padding:16px 80px;
    min-height:96px;
    display:flex;
    flex-direction:column;
    position: relative;
    justify-content:center;
    cursor: pointer;
}

.bbq-product-cat-heading:hover::after {
    color:var(--hover-color);
}
.bbq-product-cat-heading img.bbq-product-cat-img { width:64px; height:64px; object-fit:cover; position:absolute; left:0; top:0; bottom:0; margin: auto 0; border-radius: 50%;}

.bbq-product-cat-heading h3.bbq-product-cat-h3 {
    font-size: 1.3em;
    margin:0;
    padding: 0;
    background:transparent;
}

.bbq-product-cat-heading p { 
    margin:0;
}
.bbq-product-cat-heading::after { transition:transform .25s; content:'▼'; font-size:16px; line-height:1; padding:16px; width:48px; height:48px; display:block; margin: auto 0; position:absolute; right:0; top:0; bottom:0; }

.bbq-product-cat.open .bbq-product-cat-heading::after { color:var(--gray-color); transform:rotate(-180deg);}

.bbq-category-description {
    font-size: .875em;
    color: var(--gray-color);
    margin-bottom: .5em;
}


.bbq-product-list {
    display:none;
    position:relative;
    background-color:var(--border-color);
    padding:1em;
}

.bbq-product-item {
    display: flex;
    align-items: flex-start;
    background-color:#fff;
    border-radius:4px;
    margin:1em 0 0;
    gap: 1em;
    padding:1em;
    position: relative;
}
.bbq-product-item:first-child {margin-top:0; }


.bbq-product-item.in-cart {
    background: #f0fff0;
}

.bbq-product-item.bbq-product-disabled {
    overflow:hidden;
    pointer-events: none;
    cursor: not-allowed;
}
.bbq-product-item.bbq-product-disabled::before {
    content:''; display:block; z-index:2; background-color:rgba(255,255,255,.8); position:absolute;
    left:0; top:0; bottom:0; right:0;
}
.bbq-product-item.bbq-product-disabled::after{
    content:'ご指定日にはご注文頂けません'; display:block; z-index:3; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
}

.bbq-product-item.bbq-product-disabled .bbq-qty-btn,
.bbq-product-item.bbq-product-disabled .bbq-qty-select {
    background: #eee;
    border-color: #ccc;
    color: #999;
}

.bbq-product-thumbnail {
    flex-shrink: 0;
    width:160px;
    height:160px;
}

.bbq-product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.bbq-product-info {
    flex: 1;
    min-width: 0;
}

p.bbq-product-excerpt {
    display: flex;
    font-size: .875em;
    color:var(--gray-color);
    margin:0 0 .25em;
    line-height:1.4;
}

h4.bbq-product-name {
    display: block;
    font-weight: 600!important;
    font-size:1.1em;
    margin:0 0 .25em;
    line-height:1.4;
}
h4.bbq-product-name::before { 
    display:none!important; 
}

p.bbq-product-price {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    margin:0 0 .25em;
    line-height:1.4;
}

p.bbq-product-content {
    display: block;
    font-size: .875em;
    color: var(--gray-color);
    margin:.25em 0 0;
    line-height:1.6;
}

p.bbq-product-sku {
    display: inline-block;
    font-size: .75em;
    color: var(--gray-color);
    margin:.25em 0 0;
    line-height:1.4;
}

a.bbq-product-url, a.bbq-product-edit-url {
    display: inline-block;
    font-size: .75em;
    color: var(--gray-color);
    margin:.25em 0 0;
    line-height:1.4;
}

.bbq-product-qty {
    display: flex;
    align-items: center;
    gap: .5em;
    flex-shrink: 0;
    margin-left: auto;
}

.bbq-qty-select {
    height: 36px;
    padding: 0 4px; 
    width:36px;
    text-align:center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    background: #fff;
    cursor: pointer;
}

.bbq-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    padding:0;
    color:inherit;
}

.bbq-qty-btn:hover {
    background: #f5f5f5;
    color:inherit;
}

/* カートサマリー */
.bbq-cart-summary {
    margin: 2em 0;
    padding: 1.5em;
    background: #f9f9f9;
    border-radius: 8px;
}

.bbq-cart-summary h2 {
    font-size: 1.1em;
    margin: 0 0 1em 0;
}

.bbq-cart-empty {
    color: var(--gray-color);
    text-align: center;
    padding: 1em;
}

.bbq-cart-table {
    width: 100%;
    border-collapse: collapse;
    background-color:#fff;
    text-align: left;
}

.bbq-cart-table th {
    color:var(--gray-color);
}

.bbq-cart-table th, .bbq-cart-table td {
    padding: .5em;
}

.bbq-cart-table .bbq-cart-name { 
    width:auto;
}

.bbq-cart-table .bbq-cart-qty { 
    width:5em;
    text-align:center;
}

.bbq-cart-table .bbq-cart-total { 
    width:8em;
    text-align:center;
}

.bbq-cart-menu .bbq-cart-row-menu {
    cursor: pointer;
    transition: background-color .2s;
}

.bbq-cart-grand-total {
     text-align:right;
}

#bbq-grand-total { 
    font-size:2em;
}

.bbq-cart-row-menu:hover {
    background-color: var(--focus-color);
}

.bbq-cart-table tfoot th,
.bbq-cart-table tfoot td {
    border-bottom: none;
    font-weight: 600;
}

.bbq-cart-table tfoot .bbq-cart-qty, 
.bbq-cart-table tfoot .bbq-cart-total {
    font-size: 1.2em;
}

.bbq-cart-summary h2 { 
    margin-top:2em;
}
.bbq-cart-summary h2:first-child {
    margin-top:0;
}

.bbq-order-comments { 
    width:100%;
}


.bbq-remove-item {
    background: none;
    border: none;
    text-decoration: underline;
    color: var(--link-color);
    cursor: pointer;
    font-size: .75em;
}

/* 商品詳細ポップアップ */
.bbq-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.6);
    overflow-y: auto;
    padding: 2em 1em;
}

.bbq-popup-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

body.bbq-popup-open {
    overflow: hidden;
}

.bbq-popup {
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 1.5em;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}

/* ポップアップ内の商品アイテム */
.bbq-popup .bbq-product-item {
    display: block;
    padding: 0;
    border: none;
    cursor: default;
    background: none;
}

.bbq-popup .bbq-product-item:hover {
    background: none;
}

.bbq-popup .bbq-product-thumbnail {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin-bottom: 1em;
}

.bbq-popup .bbq-product-info {
    margin-bottom: 1em;
}

.bbq-popup p.bbq-product-excerpt {
    font-size: .875em;
}

.bbq-popup h4.bbq-product-name {
    font-size: 1.2em;
}

.bbq-popup p.bbq-product-price {
    font-size: 1.2em;
    margin-bottom: .5em;
}

.bbq-popup p.bbq-product-content {
    display: block !important;
    font-size: .875em;
    margin-top: .75em;
    padding-top: .75em;
    border-top-width: 1px;
}
.bbq-popup p.bbq-product-sku {
    display: inline-block !important;
    font-size: .875em;
}
.bbq-popup a.bbq-product-url {
    display: inline-block !important;
    font-size: .875em;
}
.bbq-popup a.bbq-product-edit-url{
    display:none;
}

.bbq-popup .bbq-product-qty {
    justify-content: center;
    margin: 0;
}

.bbq-popup .bbq-qty-select {
    height: 44px;
    width: auto;
    min-width: 80px;
    padding: 0 1em;
    font-size: 1.1em;
}

.bbq-popup .bbq-qty-btn {
    display: none;
}

button.bbq-popup-delete,
button.bbq-popup-close {
    display: block;
    height: 44px;
    padding: 0 1em;
    font-size:1em;
    border: none;
    cursor: pointer;
    transition: background .2s;
}

button.bbq-popup-delete {
    color: #c62828;
    background: #fff;
    border: 1px solid #c62828;
}

@media (max-width: 980px) {
    .bbq-product-thumbnail {
        width:120px;
        height:120px;
    }
}


/* レスポンシブ */
@media (max-width: 600px) {
    .bbq-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bbq-form-notice {
        text-align: center;
        margin-bottom: .5em;
    }

    .bbq-btn {
        text-align: center;
    }

    /* モバイル: +/-ボタンを非表示 */
    .bbq-qty-btn {
        display: none;
    }

    /* 商品一覧モバイル対応 */
    .bbq-product-cat {
        width:100vw;
        margin:0 calc(var(--column-gap) * -1);
    }
    .bbq-product-cat-heading {
        padding: 0 calc( 64px + var(--column-gap) );
    }
    .bbq-product-cat-heading img.bbq-product-cat-img {
        width:56px; height:54px; left:var(--column-gap);
    }
    .bbq-product-cat-heading::after {
        right:var(--column-gap);
    }
    .bbq-product-cat h3 {
        position: sticky;
        top: 0;
        z-index: 10;
        margin: 0 -1px;
        padding: .75em 1em;
        background: #333;
        color: #fff;
        font-size: .875em;
    }

    .bbq-product-list {
        border: none;
        border-radius: 0;
        padding:1em var(--column-gap);
    }

    .bbq-product-item {
        align-items:center;
        padding:.75em;
        border-bottom-width: 1px;
        cursor: pointer;
        border-width:0;
    }

    .bbq-qty-select { 
        border-width:2px;
    }

    .bbq-product-item.in-cart .bbq-qty-select {
        border-color:green;
    }

    .bbq-product-thumbnail {
        grid-row: 1 / 3;
        width: 72px;
        height: 72px;
    }

    .bbq-product-info {
        grid-column: 2;
        grid-row: 1;
    }

    p.bbq-product-excerpt {
        font-size: .75em;
        margin: 0 0 .15em;
    }

    h4.bbq-product-name {
        font-size:1em;
        margin: 0 0 .15em;
    }

    p.bbq-product-price {
        font-size:1em;
        margin: 0;
    }

    p.bbq-product-content {
        display: none;
    }

    p.bbq-product-sku {
        display: none;
    }

    a.bbq-product-url, a.bbq-product-url {
        display: none;
    }

    .bbq-product-qty {
        grid-column: 2;
        grid-row: 2;
        margin-left: 0;
        justify-content: flex-start;
    }

    .bbq-qty-select {
        height: 32px;
        min-width: 60px;
        font-size: .875em;
    }

    /* サムネなし時のレイアウト調整 */
    .bbq-product-item:not(:has(.bbq-product-thumbnail)) {
        grid-template-columns: 1fr;
    }

    .bbq-product-item:not(:has(.bbq-product-thumbnail)) .bbq-product-info,
    .bbq-product-item:not(:has(.bbq-product-thumbnail)) .bbq-product-qty {
        grid-column: 1;
    }

    /* 予約サマリーモバイル */
    .bbq-summary {
        padding: 1em;
        margin-bottom: 1.5em;
    }

    /* カートサマリーモバイル */
    .bbq-cart-summary {
        padding: 1em;
    }
    .bbq-cart-table {
        display:block;
    }
    .bbq-cart-table th,
    .bbq-cart-table td {
        display:inline-block;
        margin:0;
        padding:0;
    }

    .bbq-cart-table thead {
        display: none;
    }

    .bbq-cart-table tr {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:.25em .5em;
        padding: .5em;
        border-bottom-width: 1px;
    }
    .bbq-cart-table .bbq-cart-qty {
        width:auto; color:var(--gray-color);
    }

    .bbq-cart-table .bbq-cart-qty::before {
        content:"×";
    }
    .bbq-cart-table .bbq-cart-total {
        width:auto; font-size:1.1em;
    }
    .bbq-cart-table tbody td {
        border: none;
        padding: 0;
    }
    .bbq-cart-table tfoot tr {
        justify-content:flex-end;
        border-width:0;
    }
    .bbq-cart-table tfoot .bbq-cart-name {
        display:none
    }


    .bbq-cart-table tfoot th, .bbq-cart-table tfoot td {
        border-width:0;
    }
    /* ポップアップモバイル */
    .bbq-popup-overlay {
        padding: 1em;
        align-items: center;
    }

    .bbq-popup {
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .bbq-popup .bbq-product-thumbnail {
        aspect-ratio: 4/3;
    }
}

/* =============================================
   チェックアウト確認画面
   ============================================= */

#customer_details, #order_review_heading {
    display:none;
}

#order_review_heading {
    border-width:0;
}

.bbq-checkout-summary {
    display:block;
    margin-bottom:2em;
}

.bbq-checkout-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1em;
    background-color:#fff;
    padding: .5em;
    border-radius:4px;
}

.bbq-checkout-table th,
.bbq-checkout-table td {
    padding: .25em;
    text-align: left;
    vertical-align: top;
    border-width:0;
}

.bbq-checkout-table th {
    width: 10em;
    font-weight: 500;
    font-size:.875em;
    color: var(--gray-color);
}

.bbq-change-link {
    display: inline-block;
    padding: .5em 1em;
    font-size: .875em;
    text-decoration: none;
    border-width: 1px;
    border-radius: 4px;
    border-color: currentColor;
    transition: all .2s;
    color:var(--link-color);
}

.bbq-change-link:hover {
    color:var(--hover-color);
    background: #fff;
}

/* ご要望・備考（order_review後） */
.bbq-checkout-request {
    margin-top: 1.5em;
    padding: 1em;
    background: #f9f9f9;
    border-radius: 4px;
}

.bbq-checkout-request strong {
    display: block;
    font-size: .875em;
    color: var(--gray-color);
    margin-bottom: .5em;
}

.bbq-checkout-request p {
    margin: 0;
    white-space: pre-wrap;
}

/* order_review 後の変更リンク */
.bbq-checkout-request + .bbq-change-link,
.woocommerce-checkout-review-order + .bbq-change-link,
#order_review + .bbq-change-link {
    margin-top: 1em;
}
