/**
 * 肉問屋たかはし — グローバルデザインCSS
 * 落ち着いた和風パレット・フォント・角丸の統一
 */

/* ══════════════════════════════════════════════
   サイト全体のベースタイポグラフィ
══════════════════════════════════════════════ */

body {
    font-family: var(--tcf-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--tcf-text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--tcf-font-serif);
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--tcf-text);
}

/* ══════════════════════════════════════════════
   アクセントカラー（和風・落ち着いた赤茶）
══════════════════════════════════════════════ */

/* WooCommerce のプライマリボタン */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    background-color: var(--tcf-accent);
    color: #fff;
    border: none;
    border-radius: var(--tcf-radius);
    font-family: var(--tcf-font-sans);
    font-weight: 700;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
    background-color: var(--tcf-accent-dark);
    color: #fff;
}

/* WC Blocks ボタン */
.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button {
    background-color: var(--tcf-accent) !important;
    border-color: var(--tcf-accent) !important;
    border-radius: var(--tcf-radius) !important;
    font-family: var(--tcf-font-sans) !important;
    font-weight: 700 !important;
}
.wc-block-components-checkout-place-order-button:hover,
.wc-block-cart__submit-button:hover {
    background-color: var(--tcf-accent-dark) !important;
    border-color: var(--tcf-accent-dark) !important;
}

/* ══════════════════════════════════════════════
   フォームインプット
══════════════════════════════════════════════ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
    font-family: var(--tcf-font-sans);
    border-radius: var(--tcf-radius) !important;
    border-color: var(--tcf-border);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: var(--tcf-accent) !important;
    outline-color: var(--tcf-accent) !important;
    box-shadow: 0 0 0 2px rgba(124, 74, 45, 0.15) !important;
}

/* ══════════════════════════════════════════════
   WooCommerce 価格・強調テキスト
══════════════════════════════════════════════ */

.woocommerce-Price-amount,
.price ins,
.woocommerce .price {
    color: var(--tcf-accent);
    font-family: var(--tcf-font-sans);
    font-weight: 700;
}

/* ══════════════════════════════════════════════
   マイアカウント ページ
══════════════════════════════════════════════ */

/* ページ全体の背景 */
.woocommerce-account .woocommerce {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
@media (max-width: 768px) {
    .woocommerce-account .woocommerce {
        flex-direction: column;
        gap: 20px;
    }
}

/* ── サイドナビゲーション ── */
.woocommerce-MyAccount-navigation {
    min-width: 200px;
    width: 220px;
    flex-shrink: 0;
    background: var(--tcf-surface);
    border: 1px solid var(--tcf-border);
    border-radius: var(--tcf-radius-lg);
    box-shadow: var(--tcf-shadow);
    overflow: hidden;
}
@media (max-width: 768px) {
    .woocommerce-MyAccount-navigation {
        width: 100%;
    }
}

.woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 8px 0 !important;
}

.woocommerce-MyAccount-navigation ul li {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* 区切り線 */
.woocommerce-MyAccount-navigation ul li + li {
    border-top: 1px solid var(--tcf-border-light) !important;
}

.woocommerce-MyAccount-navigation ul li a {
    display: flex !important;
    align-items: center !important;
    padding: 13px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--tcf-text-muted) !important;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s, padding-left 0.15s !important;
    font-family: var(--tcf-font-sans) !important;
    letter-spacing: 0.03em !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background: var(--tcf-accent-light) !important;
    color: var(--tcf-accent) !important;
    padding-left: 26px !important;
}

/* アクティブ項目 */
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--is-active a {
    background: var(--tcf-accent) !important;
    color: #fff !important;
    font-weight: 700 !important;
    padding-left: 20px !important;
}
.woocommerce-MyAccount-navigation ul li.is-active a:hover,
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--is-active a:hover {
    background: var(--tcf-accent-dark) !important;
    color: #fff !important;
}

/* ログアウトは薄めに */
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: var(--tcf-text-soft) !important;
    font-size: 13px !important;
    opacity: 0.8;
}
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    color: var(--tcf-accent) !important;
    background: var(--tcf-accent-light) !important;
}

/* ── コンテンツエリア ── */
.woocommerce-MyAccount-content {
    flex: 1;
    min-width: 0;
    background: var(--tcf-surface);
    border: 1px solid var(--tcf-border);
    border-radius: var(--tcf-radius-lg);
    box-shadow: var(--tcf-shadow);
    padding: 28px 32px !important;
}
@media (max-width: 768px) {
    .woocommerce-MyAccount-content {
        padding: 20px 16px !important;
    }
}

/* コンテンツ内の見出し */
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
    font-family: var(--tcf-font-serif) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--tcf-text) !important;
    border-bottom: 2px solid var(--tcf-border-light) !important;
    padding-bottom: 12px !important;
    margin-bottom: 20px !important;
}

/* 注文履歴テーブル */
.woocommerce-orders-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 13px !important;
}
.woocommerce-orders-table thead th {
    background: var(--tcf-bg) !important;
    color: var(--tcf-text-muted) !important;
    font-weight: 700 !important;
    padding: 10px 14px !important;
    border-bottom: 2px solid var(--tcf-border) !important;
    text-align: left !important;
    white-space: nowrap !important;
}
.woocommerce-orders-table tbody td {
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--tcf-border-light) !important;
    vertical-align: middle !important;
    color: var(--tcf-text) !important;
}
.woocommerce-orders-table tbody tr:hover td {
    background: var(--tcf-accent-light) !important;
}
.woocommerce-orders-table .woocommerce-button {
    background: var(--tcf-accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--tcf-radius) !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
}
.woocommerce-orders-table .woocommerce-button:hover {
    background: var(--tcf-accent-dark) !important;
}

/* ══════════════════════════════════════════════
   スクロールバーの細め統一（任意）
══════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--tcf-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--tcf-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--tcf-accent);
}

/* ══════════════════════════════════════════════
   【決定版】受取方法選択モーダル：和モダン・重厚感デザイン
   サイト全体の「重厚感・和の柔らかさ」・肉問屋たかはしらしい落ち着き
══════════════════════════════════════════════ */

#delivery-method-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    background: rgba(44, 47, 51, 0.75) !important;
    backdrop-filter: blur(10px);
    align-items: center !important;
    justify-content: center !important;
}

#delivery-method-modal.is-active {
    display: flex !important;
    animation: tcfModalFadeIn 0.4s ease-out;
}

@keyframes tcfModalFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#delivery-method-modal .modal-content-inner {
    background: #fdfaf5 !important;
    padding: 28px 32px 24px !important;
    border-radius: 12px !important;
    border: 1px solid #e0d1b6 !important;
    max-width: 400px !important;
    width: 88% !important;
    text-align: center;
    box-shadow: 0 20px 48px rgba(0,0,0,0.18) !important;
    position: relative;
}

#delivery-method-modal .delivery-modal-lead {
    font-size: 0.75rem !important;
    letter-spacing: 0.12em !important;
    color: #9a8f7c !important;
    margin: 0 0 6px !important;
    text-transform: uppercase;
}

#delivery-method-modal .modal-content-inner h3 {
    font-family: "Shippori Mincho", serif !important;
    font-size: 1.25rem !important;
    margin: 0 0 12px !important;
    color: #332f29 !important;
    letter-spacing: 0.06em;
    line-height: 1.5;
}

#delivery-method-modal .delivery-modal-note {
    font-size: 0.875rem !important;
    color: #6b5b4a !important;
    margin: 0 0 14px !important;
    line-height: 1.5;
}
#delivery-method-modal .delivery-modal-note .delivery-note-frozen {
    color: #5a9bb8 !important;
    font-weight: 700;
}

#delivery-method-modal .delivery-modal-hint {
    font-size: 0.8rem !important;
    color: #9a8f7c !important;
    margin: 0 0 20px !important;
    line-height: 1.5;
}

#delivery-method-modal .modal-buttons {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    margin-top: 0 !important;
}

#delivery-method-modal .modal-btn {
    padding: 12px 24px !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: bold !important;
    font-size: 0.95rem !important;
    transition: all 0.25s ease !important;
    flex: 1;
    min-width: 0;
}

#delivery-method-modal .btn-store {
    background: #8b2e2e !important;
    color: #fff !important;
    border-radius: 8px !important;
}

#delivery-method-modal .btn-delivery {
    background: #2c353f !important;
    color: #fff !important;
    border-radius: 8px !important;
}

#delivery-method-modal .modal-btn:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* 確認モーダル用：店頭で受け取る｜配送で受け取る｜キャンセル（元ボタン色を継承） */
#delivery-method-modal .modal-buttons--confirm {
    margin-top: 0 !important;
}
#delivery-method-modal .btn-confirm {
    border-radius: 8px !important;
}
#delivery-method-modal .delivery-modal-confirm.confirm-store {
    background: #8b2e2e !important;
    color: #fff !important;
}
#delivery-method-modal .delivery-modal-confirm.confirm-delivery {
    background: #2c353f !important;
    color: #fff !important;
}
/* キャンセル: 主張を抑えた枠線のみ・柔らかい印象 */
#delivery-method-modal .btn-cancel {
    background: transparent !important;
    color: #5c4a3a !important;
    border: 1px solid #e0d5c4 !important;
    border-radius: 8px !important;
}
#delivery-method-modal .btn-cancel:hover {
    background: #faf8f5 !important;
    border-color: #d4c4a8 !important;
}
#delivery-method-modal .modal-btn.btn-cancel.delivery-modal-close {
    border: 1px solid #e0d5c4 !important;
}

/* キャンセルして閉じる（どちらを選ばなくても進める） */
#delivery-method-modal .delivery-modal-cancel-wrap {
    margin: 18px 0 0 !important;
    padding-top: 14px !important;
    border-top: 1px solid #f0ebe5 !important;
}
#delivery-method-modal .delivery-modal-cancel:not(.modal-btn) {
    background: none !important;
    border: none !important;
    color: #9a8f7c !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    padding: 4px 8px !important;
}
#delivery-method-modal .delivery-modal-close:not(.modal-btn) {
    background: none !important;
    border: none !important;
    color: #9a8f7c !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    padding: 4px 8px !important;
}
#delivery-method-modal .delivery-modal-cancel:hover,
#delivery-method-modal .delivery-modal-close:hover {
    color: #5c4a3a !important;
}

/* 古い受取方法ポップアップを無効化（新モーダル #delivery-method-modal に統一） */
#dps-change-modal,
#dps-modal {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ══════════════════════════════════════════════
   受取方法・カート整合性（TCF）
   ② 配送選択時のカート投入制限（グレーアウト・配送不可表示）
══════════════════════════════════════════════ */
.tcf-add-to-cart-disabled {
    display: inline-block;
    padding: 0.6em 1em;
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border-radius: var(--tcf-radius, 6px);
    font-size: 0.9rem;
    cursor: not-allowed;
    pointer-events: none;
}
body.tcf-single-delivery-unavailable .single_add_to_cart_button,
body.tcf-single-delivery-unavailable .cart .single_add_to_cart_button {
    display: none !important;
}
.tcf-single-delivery-unavailable-msg {
    color: #6b7280;
    font-weight: 600;
    margin: 0.5em 0;
}

/* ③ 配送切り替え時の警告モーダル（カート内配送不可商品あり） */
#tcf-incompatible-warning-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: rgba(44, 47, 51, 0.75);
    backdrop-filter: blur(8px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
#tcf-incompatible-warning-modal[aria-hidden="true"] {
    display: none !important;
}
#tcf-incompatible-warning-modal .tcf-modal-inner {
    background: #fdfaf5;
    padding: 28px 32px;
    border-radius: 12px;
    border: 1px solid #e0d1b6;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 48px rgba(0,0,0,0.18);
}
#tcf-incompatible-warning-modal .tcf-modal-lead {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #9a8f7c;
    margin: 0 0 8px;
}
#tcf-incompatible-warning-modal .tcf-modal-message {
    font-size: 1rem;
    color: #332f29;
    line-height: 1.6;
    margin: 0 0 24px;
}
#tcf-incompatible-warning-modal .tcf-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
#tcf-incompatible-warning-modal .tcf-modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}
#tcf-incompatible-warning-modal .tcf-modal-confirm {
    background: #2c353f;
    color: #fff;
}
#tcf-incompatible-warning-modal .tcf-modal-cancel {
    background: transparent;
    color: #5c4a3a;
    border: 1px solid #e0d5c4;
}
#tcf-incompatible-warning-modal .tcf-modal-cancel:hover {
    background: #faf8f5;
}

/* 会計画面：お渡し方法セクション（通販トップ・カートと同一UI） */
.tcf-checkout-delivery-selector {
    margin-bottom: 1.5rem;
}
.tcf-checkout-delivery-selector .tcf-checkout-delivery-title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: var(--tcf-text);
}
.tcf-checkout-delivery-selector .dps-method-buttons {
    display: flex;
    gap: 12px;
}
.tcf-checkout-delivery-selector .dps-method-button {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--tcf-border);
    border-radius: var(--tcf-radius);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}
.tcf-checkout-delivery-selector .dps-method-button.active {
    border-color: var(--tcf-accent);
    background: var(--tcf-accent-light);
    color: var(--tcf-accent);
    font-weight: 600;
}
.tcf-modal-inner--wamodern {
    border-color: #e0d1b6;
    box-shadow: 0 20px 48px rgba(42,22,16,0.18);
}
