/* WC Custom Options — 商品ページ フロントエンドスタイル */

.wcco-options-wrap {
    margin: 20px 0;
    padding: 18px 20px;
    background: #f8f8f8;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
}

/* 並べ替え完了までオプション/サマリーを不可視にしてちらつき防止。
   JS が完了時に body.wcco-ready を付けて表示（JS無効時は<noscript>で表示）。 */
.wcco-options-wrap,
.wcco-price-summary {
    visibility: hidden;
}
.wcco-ready .wcco-options-wrap,
.wcco-ready .wcco-price-summary {
    visibility: visible;
}
.wcco-option { margin-bottom: 18px; }
.wcco-option:last-of-type { margin-bottom: 4px; }

.wcco-opt-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95em;
}
.wcco-required { color: #cc0000; margin-left: 3px; font-size: 0.9em; }

/* ドロップダウン */
.wcco-select {
    min-width: 200px; max-width: 100%;
    padding: 6px 10px; border: 1px solid #ccc;
    border-radius: 4px; font-size: 0.95em; background: #fff;
}

/* テキスト入力 */
.wcco-text-input {
    width: 100%; max-width: 400px;
    padding: 7px 10px; border: 1px solid #ccc;
    border-radius: 4px; font-size: 0.95em;
    background: #fff; box-sizing: border-box;
}

/* ============================================================
   共通：選択肢グループ（横並び折り返し）
   ============================================================ */
.wcco-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: flex-start;
}

/* input は視覚的に隠す */
.wcco-choice-group input[type="radio"],
.wcco-choice-group input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.wcco-choice-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    transition: all .15s;
    position: relative;
}
.wcco-choice-text { display: inline; }

/* 料金タグ */
.wcco-price-tag {
    display: inline-block;
    font-size: 0.78em;
    color: #555;
    background: #e8e8e8;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 3px;
    font-weight: 600;
}

/* ============================================================
   ラジオボタン（横並び、カスタム丸ラジオ）
   ============================================================ */
.wcco-type-radio .wcco-choice-item {
    padding: 5px 12px 5px 8px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    color: #444;
    background: #fff;
}
.wcco-type-radio .wcco-choice-item:hover {
    border-color: #2271b1;
    background: #f0f4fb;
}
.wcco-type-radio .wcco-choice-item::before {
    content: '';
    flex-shrink: 0;
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid #aaa;
    border-radius: 50%;
    background: #fff;
    transition: all .12s;
}
.wcco-type-radio .wcco-choice-item.selected {
    border-color: #2271b1;
    background: #f0f4fb;
    color: #1a4a8a;
}
.wcco-type-radio .wcco-choice-item.selected::before {
    border-color: #2271b1;
    /* 中心に白い丸（塗りつぶし＋インセット白） */
    background: #2271b1;
    box-shadow: inset 0 0 0 3px #fff;
}
.wcco-type-radio .wcco-choice-item.selected .wcco-price-tag {
    background: #dde8f8;
    color: #1a4a8a;
}

/* ============================================================
   チェックボックス（横並び折り返し、カスタムチェック）
   ============================================================ */
.wcco-type-checkbox {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 8px;
}
.wcco-type-checkbox .wcco-choice-item {
    padding: 5px 12px 5px 8px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    color: #444;
    background: #fff;
    gap: 6px;
}
.wcco-type-checkbox .wcco-choice-item:hover {
    border-color: #2271b1;
    background: #f0f4fb;
}
.wcco-type-checkbox .wcco-choice-item::before {
    content: '';
    flex-shrink: 0;
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 1.5px solid #aaa;
    border-radius: 3px;
    background: #fff;
    transition: all .12s;
}
.wcco-type-checkbox .wcco-choice-item.selected {
    border-color: #2271b1;
    background: #f0f4fb;
    color: #1a4a8a;
}
.wcco-type-checkbox .wcco-choice-item.selected::before {
    background: #2271b1;
    border-color: #2271b1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5l3.5 3.5L11 1' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

/* ============================================================
   画像つき選択肢（カード表示）
   ============================================================ */
.wcco-has-images { gap: 8px; }
.wcco-choice-item.wcco-has-img {
    flex-direction: column;
    align-items: center;
    padding: 6px 8px 8px;
    min-width: 80px; max-width: 120px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    text-align: center;
    gap: 5px;
    background: #fff;
}
.wcco-choice-item.wcco-has-img::before { display: none; }
.wcco-choice-item.wcco-has-img:hover { border-color: #2271b1; }
.wcco-choice-item.wcco-has-img.selected {
    border-color: #2271b1;
    background: #e8f0fe;
}
.wcco-choice-img {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    pointer-events: none;
}
.wcco-choice-item.wcco-has-img .wcco-choice-text {
    font-size: 0.80em;
    line-height: 1.3;
    word-break: break-all;
}

/* ============================================================
   価格サマリー
   ============================================================ */
.wcco-price-summary {
    margin: 14px 0 12px;
    border: 1px solid #d8e4f0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    font-size: 0.93em;
}
.wcco-ps-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 14px;
    border-bottom: 1px solid #eef2f7;
}
.wcco-ps-row:last-child { border-bottom: none; }
.wcco-ps-label { color: #666; }
.wcco-ps-value { font-weight: 600; color: #333; }

/* オプション内訳行 */
.wcco-ps-opt-row .wcco-ps-label { color: #555; padding-left: 10px; font-size: 0.92em; }
.wcco-ps-opt-row .wcco-ps-value { color: #2a6db5; }

/* 合計行 */
.wcco-ps-total {
    background: #f2f7fd;
    border-top: 2px solid #c8ddf0 !important;
}
.wcco-ps-total .wcco-ps-label { font-weight: 700; color: #222; font-size: 0.97em; }
.wcco-ps-total-val { font-size: 1.15em; font-weight: 700; color: #1a4a8a; }

.wcco-ps-qty-note {
    display: block;
    text-align: right;
    padding: 0 14px 7px;
    color: #888;
    font-size: 0.82em;
    background: #f2f7fd;
}
