/* ===== Design Tokens ===== */
:root {
    /* ── Brand ──
       primary を変更する際は --color-primary-rgb を書き換える。
       alpha 系（--color-primary-alpha-*）は自動追従する。
       light/dark/darker/disabled は手調整カラーのため個別に更新する。 */
    --color-primary-rgb: 30, 160, 164;
    --color-primary: rgb(var(--color-primary-rgb));
    --color-primary-light: #42babe;
    --color-primary-dark: #1EA0A4;
    --color-primary-disabled: #8fcfd1;
    --color-on-primary: #ffffff;

    /* ── Icon ── */
    --color-icon-nav: #222;

    /* ── Semantic ── */
    --color-error: #c53030;
    --color-error-strong: #e53e3e;
    --color-success: #2e7d32;

    /* ── Text (3階調 base / muted / hint) ── */
    --color-text: #222;
    --color-text-muted: #64748b;
    --color-text-hint: #94a3b8;

    /* ── Link ── */
    --color-link: #2162a1;
    --color-link-hover: #0c3353;

    /* ── Surface ── */
    --color-bg-card: #ffffff;
    --color-bg-error: #fff5f5;

    /* ── Border (3階調 strong / base / soft) ── */
    --color-border-strong: #ccc;
    --color-border: #d1d5db;
    --color-border-soft: #e0e0e0;

    /* ── Accent (Brand red — 強調用途全般) ── */
    --color-accent: #E6002D;
    --color-bg-accent-soft: #fef0f0;

    /* ── Surface 追加 ── */
    --color-bg-subtle: #f5f5f5;
    --color-bg-muted: #f7f9fa;

    /* ── State 追加 ── */
    --color-bg-success: #dff0d8;
    --color-success-strong: #338b59;
    --color-bg-success-soft: #f0fff0;
    --color-success-light: #88cc88;
    --color-error-light: #ee8888;

    /* ── Warning palette ── */
    --color-warning: #ffc107;
    --color-warning-text: #856404;
    --color-bg-warning: #fff3cd;

    /* shipping notice */
    --color-notice:#ffb300;
    --color-notice-bg: #fff8e1;

    /* ── Info ── */
    --color-info: #0286CD;

    /* ── Overlay ── */
    --color-overlay-white-strong: rgba(255, 255, 255, 0.92);
    --color-overlay-white-base: rgba(255, 255, 255, 0.80);
    --color-overlay-white-soft: rgba(255, 255, 255, 0.75);
    --color-overlay-gray: rgba(165, 165, 165, 0.82);

    /* ── Shadow color (4段階) ── */
    --shadow-color-soft: rgba(0, 0, 0, 0.05);
    --shadow-color-base: rgba(0, 0, 0, 0.10);
    --shadow-color-strong: rgba(0, 0, 0, 0.20);
    --shadow-color-deep: rgba(0, 0, 0, 0.45);

    /* ── Primary alpha（--color-primary-rgb から自動派生） ── */
    --color-primary-alpha-50: rgba(var(--color-primary-rgb), 0.5);
    --color-primary-alpha-40: rgba(var(--color-primary-rgb), 0.4);
    --color-primary-alpha-35: rgba(var(--color-primary-rgb), 0.35);
    --color-primary-alpha-20: rgba(var(--color-primary-rgb), 0.2);
    --color-primary-alpha-10: rgba(var(--color-primary-rgb), 0.1);
    --color-primary-alpha-08: rgba(var(--color-primary-rgb), 0.08);

    /* ── Footer ── */
    --color-bg-footer: #86837f;

    /* ── Component-specific buttons (個別に色変更したい用途) ── */
    --color-btn-add-to-cart-bg: #ffa41c;
    --color-btn-subscribe-bg: #ffce12;

    /* ── Component-specific colors ── */
    --color-card-pay-grad-from: #0db4f7;
    --color-card-pay-grad-to: #2255ff;
    --color-survey-title: #41afb2;

    /* ── Typography ── */
    --font-base: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic Medium", sans-serif;

    /* ── Radius ── */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    /* ── Shadow ── */
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/********************************
    リセット
 */
 html, div{
    /* weight, hightの計算に、padding&marginを含める */
    box-sizing: border-box;
}


body, div, h1, h2, h3, h4, h5, h6, p, ol, ul {
    margin: 0;
    padding: 0;
    font-weight: normal;
}

body { font-family: var(--font-base); }

/* form コントロールは UA 既定で font を継承しないため明示 */
button, input, select, textarea, optgroup { font-family: inherit; }

img{
    /* 画面アスペクト比を維持するように */
    height: auto;
}

li{
    list-style: none;
}

a{
    text-decoration: none;
    color: var(--color-link);
}

a:hover{
    color: var(--color-link-hover);
}

/* ===== Form Controls (shared base) =====
 * `:where()` で specificity を 0 にし、ページ固有のクラスからの上書きを容易にする。
 * 対象: .form-group / .customer-info 配下の text 系 input と select。
 */
:where(.form-group, .customer-info) input:not([type="hidden"], [type="checkbox"], [type="radio"]),
:where(.form-group, .customer-info) select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-size: 15px;
    font-weight: 500;
    background: var(--color-bg-card);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

:where(.form-group, .customer-info) input:focus,
:where(.form-group, .customer-info) select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-alpha-20);
}

:where(.form-group, .customer-info) input::placeholder {
    opacity: 0.35;
}

:where(.form-group, .customer-info) select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

:where(.form-group, .customer-info) input.touched:invalid,
:where(.form-group, .customer-info) select.touched:invalid {
    border-color: var(--color-error);
    background-color: var(--color-bg-error);
}

/* ===== Primary Action Button ===== */
.confirm {
    display: block;
    align-self: center;
    color: var(--color-on-primary);
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    border-radius: var(--radius-pill);
    width: 75%;
    padding: 14px 0;
    font-weight: 700;
    font-size: 17px;
    border: none;
    box-shadow: 0 4px 14px var(--color-primary-alpha-35);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.confirm:hover {
    transform: scale(1.02);
    filter: brightness(1.06);
    box-shadow: 0 6px 20px var(--color-primary-alpha-50);
}

.confirm:active {
    transform: scale(0.99);
}

.confirm.disabled-btn {
    background: var(--color-primary-disabled);
    cursor: not-allowed;
    box-shadow: none;
}

.confirm.disabled-btn:hover {
    transform: none;
    filter: none;
}

/* ===== Utility ===== */
.hidden {
    display: none !important;
}

/* ===== Card Layout ===== */
.select-item {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.select-item > h2.title,
.customer-info > h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: none;
    border-left: 4px solid var(--color-primary);
    padding-left: 12px;
    padding-bottom: 0;
}

.customer-info {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== Order Items ===== */
.display-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-order-item {
    background: var(--color-primary-alpha-08);
    border: 1.5px solid var(--color-primary-alpha-10);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-order-item-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    word-break: break-word;
}

.cart-order-item-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--color-text-muted);
}

.cart-order-item-subtotal {
    font-weight: 700;
    font-size: 15px;
}

.tax {
    font-size: 11px;
    color: var(--color-text-hint);
    font-weight: 400;
}

.cart-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.cart-order-total-label {
    font-size: 15px;
    color: var(--color-text);
}

.cart-order-total-price {
    font-size: 18px;
}

.cart-order-payment-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: var(--color-text);
}

.cart-order-payment-method > .cart-order-total-label {
    font-weight: 700;
}

/* ===== Form Components ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
}

.badge-required {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--color-bg-card);
    background: var(--color-error-strong);
    border-radius: 3px;
    padding: 1px 6px;
    line-height: 1.4;
    letter-spacing: 0.05em;
}

.form-section {
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border-soft);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--color-text-hint);
    line-height: 1.4;
}

/* ===== Footer (Order Flow) ===== */
.order-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    gap: 18px;
}

.footer-consent-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* ===== Island Consent ===== */
.island_consent_wrap {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    max-width: 380px;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.island_consent_wrap p {
    font-size: 9px;
    text-align: center;
}

.island-consent-check {
    display: flex;
    align-items: center;
    gap: 5px;
}

.island_consent_wrap input[type=checkbox] {
    transform: scale(1.7);
    accent-color: var(--color-primary);
}

.island_consent_wrap span {
    display: block;
    font-size: 9px;
    color: var(--color-text-hint);
}

/* ===== Mail Container (newsletter opt-in) ===== */
.mail-container {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
    text-align: center;
}

.mail-container input[type="checkbox"] {
    transform: scale(1.2);
    position: relative;
    left: -5px;
    top: 1.7px;
    display: inline;
    accent-color: var(--color-primary);
    width: 18px;
}

/* ===== Mail & Consent Text ===== */
.mail_attention {
    text-align: center;
}

.mail_attention p {
    font-size: 10.5px;
}

.precautions {
    color: var(--color-error);
    font-weight: bold;
    font-size: 12.5px;
    line-height: 1.7;
}

.mail_attention,
.common-gray-text {
    font-weight: 700;
    color: var(--color-text-muted);
    line-height: 1.9;
    font-size: 12.3px;
}

div.common-gray-text {
    display: inline-block;
    font-size: 15.3px;
}

/* member promotion */
.member-promotion {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: 20px;
    max-width: 414px;
    width: 100%;
    box-sizing: border-box;
    align-self: center;
}

.member-promotion-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--color-text);
    text-align: center;
    line-height: 1.5;
}

.member-promotion-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.8;
}

.member-promotion-highlight {
    color: var(--color-error);
    font-weight: bold;
    text-decoration: underline;
    text-decoration-color: var(--color-error);
    text-underline-offset: 2px;
}

.member-promotion-features {
    background-color: var(--color-bg-card);
    border-left: 3px solid var(--color-primary);
    padding: 12px 16px;
    border-radius: 2px;
}

.member-promotion-features ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* padding-left: 20px; */
    list-style: none;
}

.member-promotion-features li {
    position: relative;
    padding-left: 20px;
    font-size: 13px;
    color: var(--color-text);
}

.member-promotion-features li::before {
    content: '・';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.member-promotion-features .member-promotion-highlight {
    font-weight: 900;
    text-decoration: underline;
    text-decoration-color: var(--color-error);
    text-underline-offset: 2px;
}

.member-promotion-link {
    display: block;
    text-align: center;
    padding: 10px 18px;
    background-color: var(--color-primary-dark);
    color: var(--color-on-primary);
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-weight: bold;
    font-size: 13px;
    transition: all 0.2s ease;
    border: 1px solid var(--color-primary-dark);
    position: relative;
}

.member-promotion-link::after {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 6px;
    vertical-align: -2px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center / contain;
}

.member-promotion-link:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    color: var(--color-on-primary);
}

.member-promotion-link:active {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(0);
}

@media (max-width: 414px) {
    .member-promotion {
        padding: 16px;
        width: calc(100% - 20px);
    }

    .member-promotion-title {
        font-size: 15px;
    }

    .member-promotion-content {
        font-size: 12px;
    }
}