/* =====================================
   Root Variables / Base
===================================== */
:root {
    --c-border:#e5e5e5;
    --c-text:#111;
    --c-sub:#666;
    --c-red:#E32020;
}

body {
    background:#fafafa;
    color:var(--c-text);
}

/* =====================================
   Layout
===================================== */
.product-page {
    max-width: 1100px;
    width: calc(100% - 32px);
    margin:20px auto 80px;
    display:grid;
    grid-template-columns: minmax(0,1fr) 420px;
    grid-template-areas:
        "hero info"
        "detail info"
        "back info";
    column-gap:16px;
    row-gap:40px;
    padding: 0;
    padding-bottom: 120px;
    align-items:flex-start;
}

@media(min-width:960px){
    .product-page {
        padding: 0;
    }
}

/* =====================================
   Hero (Main Image)
===================================== */
.hero-card {
    background:#fff;
    border:1px solid var(--c-border);
    border-radius:20px;
    padding:20px;
    box-shadow:0 6px 18px rgba(0,0,0,0.04);
    width: 100%;
}
.hero-headline {
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-bottom:12px;
}
.pill-row {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.pill {
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:6px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    border:1px solid transparent;
}
.pill-ghost { background:#f1f3f5; color:#111; }
.pill-soft { background:#ffe8e3; color:#c62828; }
.pill-outline { background:#fff; border-color:#e5e5e5; color:#444; }
.hero-inline {
    background:#f7f7f9;
    border:1px solid #ededf1;
    color:#444;
    padding:10px 12px;
    border-radius:12px;
    font-size:13px;
}
@media(min-width:960px){
    .hero-card {
        width: 100%;
    }
}


.hero-slider { position: relative; }
.hero-main {
    position:relative;
    background:linear-gradient(135deg, #fbfbfd, #f5f6f8);
    border-radius:16px;
    overflow:hidden;
    min-height:320px;
    display:grid;
    place-items:center;
    color:#e2e2e2;
    font-size:64px;
    font-weight:800;
}
.hero-card { grid-area: hero; }
.info-card { grid-area: info; }
.accordion { grid-area: detail; }
.product-back { grid-area: back; }

.hero-main img {
    max-width:100%;
    max-height:100%;
    object-fit:contain;
}
.hero-nav {
    position:absolute;
    top:50%;
    left:0;
    right:0;
    display:flex;
    justify-content:space-between;
    /* padding:0 10px; */
    transform:translateY(-50%);
    pointer-events:none;
}
.hero-nav button {
    pointer-events:all;
    width:36px;
    height:36px;
    border-radius:50%;
    border:1px solid #ddd;
    /* background:#fff; */
    display:grid;
    place-items:center;
    box-shadow:0 6px 18px rgba(0,0,0,0.08);
}
.hero-nav svg { width:16px; height:16px; stroke:#000; }

.hero-thumbs {
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap:10px;
    margin-top:14px;
    /* background:#f8f9fb; */
    /* border:1px solid #eceef1; */
    padding:8px;
    border-radius:12px;
}
.hero-color-label {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin: 10px 0 4px;
    min-height: 20px;
}

.thumb {
    width:100%;
    aspect-ratio: 1 / 1;
    border-radius:12px;
    border:1px solid transparent;
    cursor:pointer;
    display:grid;
    place-items:center;
    font-size:12px;
    font-weight:800;
    background:#fff;
    overflow:hidden;
    box-shadow:0 3px 10px rgba(0,0,0,0.03);
}
.thumb::after {
    display: none !important;
    content: "" !important;
}

.thumb.is-active {
    border-color:#111;
    box-shadow:0 8px 18px rgba(0,0,0,0.07);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* =====================================
   Product Info
===================================== */
.info-card {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    width: 100%;
}
.info-card {
    position: static;
    max-width: 100%;
    max-height: none;
    overflow: visible;
}
.info-box {
    background:#fff;
    border:1px solid var(--c-border);
    border-radius:20px;
    padding:20px;
    box-shadow:0 6px 18px rgba(0,0,0,0.04);
    width: 100%;
}

.product-title {
    font-size:22px;
    font-weight:800;
    margin:0 0 6px;
}

.product-price {
    font-size:26px;
    font-weight:900;
    color: var(--c-red);
}

.price-area {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px 12px;
    padding-bottom:12px;
    margin-bottom:14px;
    border-bottom: 1px solid var(--c-border);
}

.price-label {
    font-size:12px;
    color:#9ca3af;
    font-weight:400;
}

.price-breakdown {
    background:transparent;
    border:none;
    border-radius:0;
    padding:0;
    color:#6b7280;
    width:100%;
    margin-top:2px;
}

.price-breakdown .row {
    display:flex;
    justify-content:space-between;
    align-items:flex-start; /* keep price aligned to first line */
    column-gap:12px;
    margin-bottom:4px;
    font-size:13px;
    line-height:1.4;
}

.price-breakdown .row:last-child {
    margin-bottom:0;
}

.price-breakdown .row span:first-child {
    flex:1;
    min-width:0;
    word-break:break-word;
}

.price-breakdown .row span:last-child {
    flex:0 0 auto;
    display:inline-block;
    /* min-width:80px; */
    text-align:right;
    white-space:nowrap;
    margin-left:-8px;
}

.price-breakdown .row strong {
    font-size:14px;
}

.inline-meta {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:12px;
}
.meta-chip {
    display:inline-flex;
    align-items:center;
    gap:6px;
    background:#f7f7f9;
    border:1px solid #ededf1;
    border-radius:999px;
    color:#444;
    font-size:12px;
    font-weight:700;
    padding:8px 12px;
}
.meta-chip.meta-ghost {
    background:#fff;
}

/* =====================================
   Option Sections (Color / Size / Position)
===================================== */
.section-title {
    font-size:14px;
    /* font-weight:800; */
    margin:16px 0 8px;
}
.selected-note {
    font-size: 12px;
    color: #777;
    font-weight: normal;
}

/* Color */
.swatches {
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap:8px;
}

.swatches .swatch-card {
    width:100%;
    border-radius:10px;
    border:1px solid var(--c-border);
    background:#fff;
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 10px;
    cursor:pointer;
    /* box-shadow:0 3px 10px rgba(0,0,0,0.02); */
    /* transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease; */
}
.swatches .swatch-card .swatch-dot {
    width:28px;
    height:28px;
    border-radius:50%;
    background:var(--color);
    border:4px solid #fff;
    box-shadow:0 2px 8px rgba(0,0,0,0.05);
    box-sizing:border-box;
    flex-shrink:0;
}
.swatches .swatch-card .swatch-name {
    font-size:12px;
    font-weight:700;
    color:#111;
    line-height:1.3;
    text-align: left;
}
.swatches .swatch-card.is-active {
    border:2px solid var(--c-red);
    box-shadow:0 10px 24px rgba(0,0,0,0.06);
    /* background-color: var(--c-red); */
    color:#fff;
}
.swatches .swatch-card.is-active .swatch-name { color:#fff; color: var(--c-red);}
/* .swatches .swatch-card.is-active .swatch-dot { box-shadow:0 0 0 1px #fff; } */
.swatches .swatch-card:focus-visible {
    outline:2px solid var(--c-red);
    outline-offset:2px;
}

/* Size */
.grid-buttons {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(40px,1fr));
    gap:10px;
}

.grid-buttons button {
    padding:14px 12px;
    border-radius:10px;
    border:1px solid #ccc;
    background:#fff;
    font-weight:600;
    font-size:13px;
    cursor:pointer;
    transition:all .15s ease;
}
.pos-buttons {
    gap:14px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.pos-buttons button {
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
    /* gap:8px; */
    padding:16px;
    min-height:150px;
    height:auto;
    border:1px solid #ddd;
    background:#fff;
    border-radius:12px;
    color: #111;
}
.pos-label {
    font-weight:800;
    color:#111;
    font-size:14px;
    margin-top: 20px;
}
.pos-meta {
    font-size:12px;
    color:#666;
    line-height:1.5;
    font-weight: 400 !important;
    margin-top: 4px;
}
.pos-preview {
    width:100%;
    aspect-ratio: 1 / 1;
    /* border:1px solid #e5e5e5; */
    border-radius:8px;
    background:#fff;
    position:relative;
    overflow:hidden;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.pos-preview::after {
    content:"";
    position:absolute;
    width:28%;
    height:22%;
    background:rgba(227,32,32,0.18);
    border:1px solid rgba(227,32,32,0.5);
    border-radius:4px;
    top:38%;
    left:36%;
}
.pos-options button.is-active,
.pos-buttons button.is-active,
.pos-options button.active,
.pos-buttons button.active {
    background: #111;
    border-color: #111;
    color: #fff;
}
.pos-options button.is-active .pos-preview,
.pos-buttons button.is-active .pos-preview,
.pos-options button.active .pos-preview,
.pos-buttons button.active .pos-preview {
    /* background: #fff; */
    border-color: #f0f0f0;
}
.pos-options button.is-active .pos-label,
.pos-buttons button.is-active .pos-label,
.pos-options button.active .pos-label,
.pos-buttons button.active .pos-label,
.pos-options button.is-active .pos-meta,
.pos-buttons button.is-active .pos-meta,
.pos-options button.active .pos-meta,
.pos-buttons button.active .pos-meta {
    /* color: #fff; */
}
.pos-preview.pos-front::after { top:36%; left:36%; }
.pos-preview.pos-left_chest::after { top:34%; left:24%; }
.pos-preview.pos-right_chest::after { top:34%; left:52%; }
.pos-preview.pos-left_sleeve::after { top:50%; left:18%; }
.pos-preview.pos-right_sleeve::after { top:50%; left:60%; }
.pos-preview.pos-sleeve::after { top:50%; left:60%; }
.pos-preview.pos-back::after { width:46%; height:50%; top:24%; left:27%; }
.pos-preview.pos-has-img::after { display:none; }

.grid-buttons button.is-active {
    border:2px solid var(--c-red);
    background:var(--c-red);
    color:#fff;
    font-weight: 400;
    color: var(--c-red);
    background-color: #fff;
    font-weight: 800;
}

/* Position */
.pos-options {
    display:grid;
    gap:12px;
    grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
}

.pos-options button {
    padding:14px 18px;
    border-radius:8px;
    border:1px solid #ccc;
    background:#fafafa;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    height:60px;
}

.pos-options button.active {
    border:2px solid #000;
    background:#fff;
}

.add-fee {
    font-size:12px;
    color:#666;
}

/* ------------------------------
   カラー選択（円デザイン）
------------------------------ */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 4px 0 14px;
}

.color-options button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--color);
    cursor: pointer;
    transition: 0.15s;
    position: relative;
    box-sizing: border-box;
}

/* 選択中のリング（外側の白→黒ライン） */
.color-options button.is-active {
    border: 2px solid #000;          /* 外枠（黒） */
    box-shadow:
        0 0 0 4px #fff,              /* 白リング */
        0 0 0 5px #000;              /* 外側の黒線で存在感UP */
}


/* =====================================
   Estimate Box
===================================== */
.estimate-box {
    background:#fafafa;
    padding:20px;
    border-radius:14px;
    border:1px solid #eee;
    margin-top:35px;
    font-size:14px;
}

.estimate-price {
    font-size:22px;
    font-weight:800;
    margin-top:8px;
}
.summary-card {
    display: none;
}

/* =====================================
   CTA Buttons
===================================== */
.cta-area {
    margin-top:20px;
    display:flex;
    flex-direction:row;
    gap:12px;
    align-items:center;
    flex-wrap:wrap;
}

.cta-primary {
    background:var(--c-red);
    color:#fff;
    padding:16px 28px;
    border:none;
    border-radius:999px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    flex: 0 0 auto;
    min-width: 220px;
        display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(227, 32, 32, 0.25);
}
.cta-primary:hover {
        background: #c91818;
    border-color: #c91818;
    transform: translateY(-1px);
    border-color: #cfcfcf;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.08);
}

.cta-secondary {
    background:#fff;
    color:#000;
    border:1px solid #ddd;
    padding:14px;
    border-radius:12px;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
}
.product-back {
    margin: 0 auto;
    text-align: left;
}
.product-back .cta-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    min-width: auto;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-weight: 700;
    color: #111;
    min-width: 220px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    justify-content: center;
    margin-top: 20px;
}
.cta-back svg {
        width: 14px;
    height: 14px;
    stroke: currentColor;
}
.cta-back {
    text-align: center;
}
.product-back .cta-back:hover {
    border-color: #d5d8de;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.selection-inline {
    font-size: 13px;
    color: #777;
    flex: 2 1 200px;
}

.product-cta {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    width: 100%;
}
.product-cta .cta-primary {
    min-width: 220px;
    width: 240px;
    padding-left: 24px;
    padding-right: 24px;
}
.accordion {
    grid-column: 1 / 2;
}
.product-back {
    grid-column: 1 / 2;
}
.mobile-fab {
    display:flex;
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    background:rgba(255,255,255,0.96);
    backdrop-filter: blur(6px);
    border-top:1px solid #e5e7eb;
    padding:12px 32px;
    gap:12px;
    align-items:flex-start;
    box-shadow:0 -6px 18px rgba(0,0,0,0.06);
    z-index: 20;
}
.fab-main {
    flex:1;
    display:flex;
    flex-direction:column;
    gap:8px;
    align-items:flex-end;
}
.fab-summary {
    flex:1;
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
    align-items: flex-end;
}
.fab-price {
    font-size:18px;
    font-weight:800;
    color:var(--c-red);
    display:flex;
    align-items:baseline;
    gap:6px;
}
.fab-price-note {
    font-size:12px;
    color:#9ca3af;
    font-weight:400;
}
.fab-text {
    font-size:12px;
    color:#555;
    line-height:1.4;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.fab-detail {
    width:100%;
    display:flex;
    flex-direction:column;
    gap:6px;
    align-items:flex-end;
}
.fab-name {
    font-size:12px;
    font-weight:700;
    color:#111;
    text-align:right;
}
.fab-breakdown {
    width:100%;
    max-width:260px;
    font-size:12px;
    color:#555;
}
.fab-breakdown .row {
    display:flex;
    justify-content:space-between;
    margin:2px 0;
}
.fab-chips {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    justify-content:flex-end;
    width:100%;
}
.fab-chips .meta-chip {
    padding:6px 10px;
    font-size:11px;
}
.fab-btn {
    flex:0 0 auto;
    border:none;
    background:var(--c-red);
    color:#fff;
    border-radius:999px;
    padding:12px 16px;
    font-size:13px;
    font-weight:700;
    min-width: 140px;
    box-shadow:0 10px 18px rgba(227,32,32,0.25);
}
@media(min-width:960px){
    .product-cta {
        justify-content: left;
    }
    .product-back {
        grid-column: 1;
    }
}


/* =====================================
   Detail Section (Accordion)
===================================== */
.accordion {
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:-24px;
}

.acc-item {
    border:1px solid var(--c-border);
    border-radius:12px;
    background:#fff;
    box-shadow:0 4px 12px rgba(0,0,0,0.02);
    overflow:hidden;
}

.acc-header {
    padding:14px 16px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    position:relative;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.acc-header::after {
    content:"";
    width:6px;
    height:6px;
    border-right:1px solid #ccc;
    border-bottom:1px solid #ccc;
    position:absolute;
    right:20px;
    top:50%;
    transform:translateY(-50%) rotate(45deg);
    transition:.2s;
}

.acc-item.is-open .acc-header::after {
    /* transform:translateY(-50%) rotate(-135deg); */
}

.acc-body {
    padding:0 16px 16px;
    display:none;
    font-size:14px;
    line-height:1.8;
}

.acc-item.is-open .acc-body {
    display:block;
}

.acc-body p { margin:0 0 10px; }

/* =====================================
   Size Table
===================================== */
.size-table {
    width:100%;
    border-collapse:collapse;
    font-size:13px;
    margin-top:6px;
}
.size-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.size-table thead th {
    padding:10px 8px;
    font-weight:700;
    border-bottom:1px solid var(--c-border);
}

.size-table tbody td {
    padding:9px 8px;
    border-bottom:1px solid var(--c-border);
    text-align: center;
}

.size-table tbody tr:nth-child(odd) {
    background:#fafafa;
}

.size-table tbody tr:last-child td {
    border-bottom:none;
}

@media(max-width:720px){
    .product-page {
        width: 100%;
        padding: 0 14px;
        gap: 16px;
        grid-template-areas:
            "hero"
            "info"
            "detail"
            "back";
        row-gap: 24px;
    }
    .hero-card { padding: 14px; margin-bottom: 0; grid-area: hero; }
    .hero-main { min-height: 280px; }
    .hero-thumbs { justify-content: center; display: none; }
    .hero-nav { display: none; }
    .info-card { grid-area: info; }
    .accordion { grid-area: detail; }
    .product-back { grid-area: back; }
    .swatches {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }
    .swatches .swatch-card { padding: 10px; }
    .thumb.is-active::after { display: none; }
}

@media(max-width:720px){
    .product-page {
        grid-template-columns: 1fr;
        padding-bottom: 90px;
    }
    .accordion,
    .product-back {
        grid-column: 1 / -1;
        max-width: 100%;
    }
    .mobile-fab {
        display:flex;
        position:fixed;
        left:0;
        right:0;
        bottom:0;
        background:rgba(255,255,255,0.96);
        backdrop-filter: blur(6px);
        border-top:1px solid #e5e7eb;
        padding:12px 14px;
        gap:12px;
        align-items:center;
        box-shadow:0 -6px 18px rgba(0,0,0,0.06);
        z-index: 20;
    }
    .fab-summary {
        flex:1;
        display:flex;
        flex-direction:column;
        gap:4px;
        min-width:0;
    }
    .fab-price {
        font-size:18px;
        font-weight:800;
        color:var(--c-red);
        display:flex;
        align-items:baseline;
        gap:6px;
    }
    .fab-price-note {
        font-size:12px;
        color:#9ca3af;
        font-weight:600;
    }
    .fab-text {
        font-size:12px;
        color:#555;
        line-height:1.4;
        white-space:normal;
        word-break:break-word;
    }
    .fab-btn {
        flex:0 0 auto;
        border:none;
        background:var(--c-red);
        color:#fff;
        border-radius:999px;
        padding:12px 16px;
        font-size:13px;
        font-weight:700;
        min-width: 140px;
        box-shadow:0 10px 18px rgba(227,32,32,0.25);
    }
}
