.main-wrapper { padding: 40px 20px; }
.product-container {
    display: flex; flex-direction: column; max-width: 1000px; margin: 0 auto;
    background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); gap: 28px;
}
/* スマホ: 左カラムを解体し、フォームを先・詳細表を後に並べ替え */
.left-column { display: contents; }
.product-sticky-preview {
    width: 100%;
    order: 1;
    position: sticky;
    top: 52px;
    z-index: 40;
    background: #fff;
    padding: 4px 0 10px;
    margin: 0 0 4px;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}
.product-sticky-preview .main-image-wrapper {
    width: min(100%, 52vw);
    max-width: 240px;
    margin: 0 auto 10px;
    aspect-ratio: 1 / 1;
}
.product-sticky-preview .thumbnail-row {
    justify-content: center;
    margin-bottom: 0;
    gap: 8px;
}
.product-sticky-preview .thumbnail-img,
.product-sticky-preview .thumbnail-logo-zoom-wrap {
    width: calc(18% - 7px);
    max-width: 56px;
}
.product-intro { width: 100%; order: 2; }
.right-column { width: 100%; order: 3; display: flex; flex-direction: column; gap: 20px; }
.product-reference {
    width: 100%;
    order: 4;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ref-shipping { order: 3; }
.ref-size { order: 1; }
.ref-stock { order: 2; }
.product-reference .size-chart-box.left-panel-box { margin-top: 0; }
.shipping-detail-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}
@media screen and (min-width: 900px) {
    .product-container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 40px;
    }
    .left-column {
        display: block;
        flex: 1;
        min-width: 300px;
        max-width: 450px;
        order: unset;
    }
    .product-sticky-preview {
        position: static;
        width: auto;
        order: unset;
        padding: 0;
        margin: 0;
        border-bottom: none;
        box-shadow: none;
        background: transparent;
    }
    .product-sticky-preview .main-image-wrapper {
        width: 100%;
        max-width: none;
        margin: 0 0 15px;
    }
    .product-sticky-preview .thumbnail-row {
        justify-content: flex-start;
        margin-bottom: 20px;
        gap: 10px;
    }
    .product-sticky-preview .thumbnail-img,
    .product-sticky-preview .thumbnail-logo-zoom-wrap {
        width: calc(25% - 7.5px);
        max-width: none;
    }
    .product-intro {
        width: auto;
        order: unset;
    }
    .right-column {
        flex: 1;
        min-width: 300px;
        width: auto;
        order: unset;
    }
    .product-reference {
        display: block;
        width: auto;
        order: unset;
    }
    .ref-shipping,
    .ref-size,
    .ref-stock { order: unset; }
    .product-reference .size-chart-box.left-panel-box { margin-top: 20px; }
    .shipping-detail-hint { display: none; }
}
.main-image-wrapper {
    width: 100%; aspect-ratio: 1/1; margin-bottom: 15px;
    border: 1px solid #ddd; border-radius: 4px; overflow: hidden; background-color: #fff;
    position: relative; cursor: zoom-in;
}
.main-image-wrapper img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    will-change: transform;
}
.main-image-wrapper.is-zooming img {
    transform: scale(2);
    transition: none;
}
@media (hover: none) {
    .main-image-wrapper { cursor: default; }
    .main-image-wrapper.is-zooming img { transform: none; }
}
.thumbnail-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.thumbnail-img {
    width: calc(25% - 7.5px); aspect-ratio: 1/1; object-fit: cover;
    border: 2px solid transparent; border-radius: 4px;
    cursor: pointer; transition: all 0.2s; background-color: #fff;
}
.thumbnail-img:hover { opacity: 0.7; }
.thumbnail-img.active { border-color: #0056b3; }
.thumbnail-logo-zoom-wrap {
    position: relative;
    width: calc(25% - 7.5px);
    aspect-ratio: 1/1;
}
.thumbnail-logo-zoom-wrap .thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f5f7fa;
    padding: 6px;
}
.thumbnail-logo-badge {
    position: absolute;
    left: 4px;
    bottom: 4px;
    background: rgba(0,42,101,0.88);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    line-height: 1.3;
}
.product-description { font-size: 14px; line-height: 1.5; color: #555; margin-bottom: 30px; }
.product-description strong { font-size: 16px; color: #111; display: block; margin-bottom: 5px; }
.feature-section { border-top: 1px dashed #ccc; padding-top: 20px; }
.feature-title {
    font-size: 16px; font-weight: bold; color: #333; margin-bottom: 15px;
    border-left: 4px solid #0056b3; padding-left: 8px; line-height: 1.2;
}
.feature-point { margin-bottom: 15px; }
.feature-point-title { font-size: 14px; font-weight: bold; color: #0056b3; margin-bottom: 5px; }
.feature-point-text { font-size: 13px; color: #555; line-height: 1.6; }
.material-info {
    background-color: #f9f9f9; border: 1px solid #eee; border-radius: 6px;
    padding: 15px; margin-top: 25px; font-size: 13px; color: #555;
}
.material-info dl { margin: 0; }
.material-info dt { font-weight: bold; float: left; width: 70px; clear: left; margin-bottom: 5px; color: #333; }
.material-info dd { margin-left: 70px; margin-bottom: 5px; }
.shipping-info-section {
    margin-top: 25px;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
}
.shipping-info-section .feature-title {
    margin-bottom: 10px;
    border-left-color: #17a2b8;
}
.shipping-info-note {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 12px;
}
.shipping-rate-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}
.shipping-rate-table th,
.shipping-rate-table td {
    border: 1px solid #dde3ea;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.shipping-rate-table thead th {
    background: #eef3f7;
    color: #333;
    font-weight: bold;
    white-space: nowrap;
}
.shipping-rate-table thead th:last-child {
    width: 28%;
    text-align: right;
}
.shipping-rate-table td.rate {
    text-align: right;
    font-weight: bold;
    color: #002A65;
    white-space: nowrap;
    width: 28%;
}
.shipping-rate-table td.area {
    color: #555;
    line-height: 1.5;
}
.shipping-info-foot {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}
.header-info { border-bottom: 2px solid #eee; padding-bottom: 15px; }
.shipping-date {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline;
    gap: 0 0.35em; text-align: right; font-size: 14px; color: #d9534f;
    font-weight: bold; margin-bottom: 10px; line-height: 1.45;
}
.shipping-date-main,
.shipping-date-estimate { white-space: nowrap; }
@media (max-width: 480px) {
    .shipping-date {
        justify-content: flex-start; text-align: left; font-size: 13px; gap: 2px 0;
    }
    .shipping-date-estimate { flex-basis: 100%; }
}
.product-title { font-size: 24px; font-weight: bold; margin-top: 5px; color: #111; }
.return-policy-note {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff8f0;
    border: 1px solid #f0d0a8;
    border-left: 4px solid #e67e22;
    border-radius: 4px;
    font-size: clamp(11px, 2.6vw, 13px);
    color: #8a4b08;
    line-height: 1.4;
    font-weight: bold;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
form { display: flex; flex-direction: column; gap: 40px; margin-top: 10px; }
.form-group { display: flex; flex-direction: column; gap: 12px; }
.form-label {
    font-weight: bold; font-size: 18px; color: #333;
    border-left: 4px solid #0056b3; padding-left: 10px; line-height: 1.2;
}
.form-label span.req { color: red; font-size: 12px; margin-left: 5px; font-weight: normal; vertical-align: middle; }
.option-group { display: flex; flex-wrap: wrap; gap: 20px 12px; }
.option-group input[type="radio"] { display: none; }
.option-group label {
    padding: 12px 20px; border: 1px solid #ccc; border-radius: 6px;
    cursor: pointer; background-color: #fff; font-size: 15px; font-weight: 600;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    user-select: none; text-align: center;
    box-shadow: 0 2px 4px transparent;
}
.option-group input[type="radio"]:checked + label {
    background-color: #0056b3; color: white; border-color: #0056b3;
    box-shadow: 0 2px 4px rgba(0,86,179,0.3);
}
.size-group label {
    min-width: 64px;
    padding: 12px 16px;
}
.size-chart-box {
    margin-top: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
}
.size-chart-title {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}
.size-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.size-chart-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    background: #fff;
    font-size: 12px;
}
.size-chart-table th,
.size-chart-table td {
    border: 1px solid #dde3ea;
    padding: 7px 8px;
    text-align: center;
    white-space: nowrap;
}
.size-chart-table th {
    background: #eef3f7;
    color: #333;
    font-weight: bold;
}
.size-chart-table th.size-chart-corner,
.size-chart-table td.size-chart-label {
    text-align: left;
    background: #f4f7fb;
    font-weight: bold;
    color: #444;
}
.size-chart-note {
    margin-top: 8px;
    font-size: 11px;
    color: #777;
    line-height: 1.5;
}
.stock-info-group { background: #eef7ff; padding: 15px; border-radius: 8px; border: 1px solid #b3d7ff; margin-top: 20px; }
.left-panel-box.size-chart-box { margin-top: 20px; }
.stock-table-wrapper { width: 100%; }
.stock-table {
    width: 100%; table-layout: fixed; border-collapse: collapse;
    text-align: center; font-size: 11px; background: #fff;
}
.stock-table th, .stock-table td {
    border: 1px solid #ccc; padding: 5px 2px; overflow: hidden;
}
.stock-table thead th {
    background: #f0f0f0; font-weight: bold; color: #333;
    font-size: 10px; white-space: nowrap; line-height: 1.2;
}
.stock-table th.stock-corner { width: 15%; font-size: 10px; }
.stock-table th.stock-color-name {
    width: 15%; font-size: 10px; white-space: nowrap; line-height: 1.2;
    background: #f0f0f0; font-weight: bold; color: #333;
}
.stock-table td {
    color: #333; font-weight: bold; font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.stock-table td.stock-x { color: #c0392b; }
.stock-table td.stock-triangle { color: #e67e22; }
.stock-table td.stock-circle { color: #2980b9; }
.stock-table td.stock-double { color: #27ae60; }
.stock-table td.stock-na { color: #999; }
.option-group input[type="radio"]:disabled + label {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f0f0f0;
    color: #999;
    border-color: #ddd;
    box-shadow: none;
    text-decoration: line-through;
}
.stock-note { font-size: 11px; color: #666; margin-top: 8px; text-align: left; line-height: 1.5; }
.stock-legend {
    display: flex; flex-wrap: wrap; gap: 10px 16px;
    margin-top: 8px; font-size: 11px; color: #555;
}
.stock-legend span { white-space: nowrap; }
@media (max-width: 480px) {
    .stock-table thead th { font-size: 9px; }
    .stock-table th.stock-color-name { font-size: 9px; }
    .stock-table td { font-size: 11px; padding: 4px 1px; }
}
.product-switcher {
    max-width: 1000px; margin: 0 auto 20px; display: flex; flex-wrap: wrap; gap: 10px;
}
.product-switcher a {
    padding: 10px 16px; border-radius: 6px; text-decoration: none;
    background: #fff; color: #0056b3; border: 1px solid #b3d7ff; font-weight: bold; font-size: 14px;
}
.product-switcher a.active {
    background: #0056b3; color: #fff; border-color: #0056b3;
}
.logo-panel-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
@media screen and (min-width: 768px) { .logo-panel-group { grid-template-columns: repeat(5, 1fr); } }
.logo-panel-group label {
    display: flex; flex-direction: column; align-items: center;
    box-sizing: border-box; min-width: 0; overflow: hidden;
    padding: 12px 8px; border: 2px solid #ddd; border-radius: 8px;
    cursor: pointer; background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    text-align: center;
    box-shadow: 0 4px 8px transparent;
}
.logo-panel-group label img {
    width: 100%;
    max-width: 72px;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
    object-position: center;
    margin-bottom: 8px;
    pointer-events: none;
    display: block;
}
.logo-panel-group label span { font-size: 18px; font-weight: bold; color: #333; line-height: 1.2; max-width: 100%; }
.logo-panel-group label.logo-panel-wide {
    grid-column: span 2;
}
.logo-panel-group label.logo-panel-wide span {
    white-space: nowrap;
}
.logo-panel-group label span.logo-name-compact {
    display: block;
    width: 100%;
    font-size: 12px;
    white-space: nowrap;
    letter-spacing: -0.02em;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}
.logo-panel-group input[type="radio"]:checked + label {
    border-color: #ff5722; background-color: #fff5f2; box-shadow: 0 4px 8px rgba(255,87,34,0.2);
}
.logo-panel-group input[type="radio"] { display: none; }
.logo-panel-group input[type="radio"]:checked + label span { color: #ff5722; }
.qty-input { width: 80px; padding: 12px; font-size: 16px; text-align: center; border: 1px solid #ccc; border-radius: 6px; }
.pref-select {
    flex: 1; min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box;
    padding: 12px 15px; font-size: 16px;
    border: 1px solid #ccc; border-radius: 6px; background-color: #fff;
    color: #333; cursor: pointer; outline: none;
}
.pref-select:focus { border-color: #0056b3; box-shadow: 0 0 5px rgba(0,86,179,0.3); }
.pref-select:disabled { background-color: #f5f5f5; color: #888; cursor: not-allowed; }
.shipping-choice-list { display: flex; flex-direction: column; gap: 12px; }
.shipping-choice {
    display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px 12px;
    padding: 14px 16px; border: 2px solid #ddd; border-radius: 8px;
    background: #fff; transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}
.shipping-choice:has(input:checked) {
    border-color: #0056b3; background: #f0f7ff;
}
/* 都道府県別選択中は引き取り日を強制的に操作不可へ */
.pickup-date-wrap.is-disabled,
.pickup-date-wrap[hidden] {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
.shipping-choice-stadium {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    row-gap: 10px;
}
.shipping-choice-stadium input[type="radio"] {
    grid-column: 1;
    grid-row: 1;
    margin: 2px 0 0;
}
.shipping-choice-stadium .shipping-choice-label {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    width: auto;
}
.shipping-choice-stadium .pickup-date-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
    padding-left: 0;
}
.shipping-choice input[type="radio"] {
    width: 18px; height: 18px; margin: 2px 0 0; cursor: pointer; flex-shrink: 0;
}
.shipping-choice-label {
    flex: 1; min-width: 0;
    font-size: 15px; font-weight: 600; color: #333; line-height: 1.45; cursor: pointer;
}
.shipping-choice-pref {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    row-gap: 10px;
}
.shipping-choice-pref input[type="radio"] {
    grid-column: 1;
    grid-row: 1;
    margin: 2px 0 0;
}
.shipping-choice-pref .shipping-choice-label {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    width: auto;
}
.shipping-choice-pref .pref-select {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    cursor: pointer;
}
.shipping-cart-note {
    font-size: 13px; color: #666; margin-top: 4px; width: 100%;
}
.shipping-choice-list.shipping-locked .shipping-choice {
    cursor: default; opacity: 0.55; background: #f7f7f7;
}
.shipping-choice-list.shipping-locked .shipping-choice:has(input:checked) {
    border-color: #0056b3; background: #eef7ff; opacity: 1;
}
.shipping-locked-badge {
    display: inline-block; font-size: 12px; font-weight: bold;
    color: #0056b3; background: #eef7ff; padding: 4px 10px;
    border-radius: 4px; margin-bottom: 8px;
}
.pickup-date-wrap {
    margin-top: 10px;
    padding-left: 28px;
    width: 100%;
}
.pickup-date-wrap > label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    font-weight: bold;
}
.pickup-date-select {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}
.pickup-date-select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}
.pickup-date-wrap.is-disabled {
    opacity: 0.65;
    pointer-events: none;
}
.pickup-date-wrap.is-disabled > label {
    color: #999;
}
.pickup-date-locked {
    font-size: 14px;
    color: #0056b3;
    font-weight: bold;
}
.pickup-date-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}
.price-display-area {
    background-color: #fff9f4; border: 2px solid #ffccbc; border-radius: 8px;
    padding: 20px; margin-top: -10px;
    overflow: hidden;
}
.price-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; font-size: 15px; color: #555; margin-bottom: 8px; line-height: 1.45;
}
.price-row > span:first-child {
    flex: 1; min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}
.price-row span.val {
    flex-shrink: 0; white-space: nowrap;
    font-weight: bold; color: #333; font-size: 18px;
}
.total-price-row {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 12px; margin-top: 15px; padding-top: 15px; border-top: 2px dashed #ffccbc;
}
.total-price-row .label {
    flex: 1; min-width: 0; font-size: 18px; font-weight: bold; color: #333; padding-bottom: 5px;
    overflow-wrap: anywhere; word-break: break-word;
}
.total-price-row > span:last-child { flex-shrink: 0; white-space: nowrap; }
.total-price-row .amount { font-size: 34px; font-weight: bold; color: #d9534f; line-height: 1; }
@media (max-width: 480px) {
    .price-display-area { padding: 16px; }
    .price-row { font-size: 13px; gap: 8px; }
    .price-row span.val { font-size: 16px; }
    .total-price-row .label { font-size: 15px; }
    .total-price-row .amount { font-size: 28px; }
    .shipping-choice { padding: 12px; }
    .shipping-choice-label { font-size: 14px; }
    .pickup-date-wrap { padding-left: 0; }
}
.tax-note { font-size: 12px; color: #666; font-weight: normal; }
.submit-btn {
    background-color: #ff5722; color: #fff; border: none; padding: 20px; font-size: 18px;
    font-weight: bold; border-radius: 6px; cursor: pointer; transition: background 0.3s;
    width: 100%; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.submit-btn:hover { background-color: #e64a19; }
.preview-purchase-note {
    margin: 0;
    padding: 18px 16px;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.6;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.error-banner {
    max-width: 1000px; margin: 0 auto 20px; padding: 15px 20px;
    background: #fff3f3; border: 1px solid #f5c6cb; border-radius: 8px;
    color: #721c24; font-size: 14px; font-weight: bold;
}

/* inline field errors */
.form-group.has-error .form-label {
  color: #c0392b;
}
.field-error {
  margin: 0;
  font-size: 13px;
  font-weight: bold;
  color: #c0392b;
  line-height: 1.5;
}
.form-group.has-error .option-group,
.form-group.has-error .logo-panel-group,
.form-group.has-error .shipping-choice-list,
.form-group.has-error .qty-input {
  outline: 2px solid rgba(192, 57, 43, 0.35);
  outline-offset: 2px;
  border-radius: 8px;
}
.shipping-choice-pref.has-error,
.pickup-date-wrap.has-error .pickup-date-select,
.form-group.has-error .pref-select,
.form-group.has-error .pickup-date-select {
  outline: 2px solid rgba(192, 57, 43, 0.35);
  outline-offset: 2px;
  border-radius: 8px;
}
.pickup-date-wrap.has-error > label,
.shipping-choice-pref.has-error .shipping-choice-label {
  color: #c0392b;
}
.pickup-date-wrap.has-error > .field-error,
.shipping-choice-pref.has-error > .field-error {
  margin-top: 8px;
}
