/* ==========================================================================
   LUNASENS — Product Detail Page (PDP) Styles
   Scoped to pages that include <body data-page-detail="true">.
   This file is loaded only on the product detail template.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens (PDP-only; do not leak into site-wide scope)
   -------------------------------------------------------------------------- */
body[data-page-detail="true"] {
    --pdp-ink:    #111111;
    --pdp-muted:  #6B6B6B;
    --pdp-line:   #E9E4DD;
    --pdp-cream:  #FAF7F2;
    --pdp-cream2: #F2EBE0;
    --pdp-sale:   #C23A3A;
    --pdp-trust:  #0F766E;
    --pdp-gold:   #B8935A;
    --pdp-ok:     #10B981;
}

/* Page background & scroll — unified with home (#fff) */
body[data-page-detail="true"] {
    background: #fff;
    font-feature-settings: "palt" 1;
    font-variant-numeric: proportional-nums tabular-nums;
    scroll-behavior: smooth;
}

@media (max-width: 1023px) {
    body[data-page-detail="true"] { padding-bottom: 5.5rem; }
}

/* --------------------------------------------------------------------------
   Announcement bar (top strip) — pinned above fixed header on PDP
   -------------------------------------------------------------------------- */
/* Announcement bar removed — the site already has a global header */

/* --------------------------------------------------------------------------
   Breadcrumb (one-line, horizontal scroll suppressed)
   -------------------------------------------------------------------------- */
.pdp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: #9a9388;
    white-space: nowrap;
    overflow: hidden;
    flex-wrap: nowrap;
}
@media (min-width: 1024px) {
    .pdp-breadcrumb { gap: 0.5rem; letter-spacing: 0.18em; }
}
.pdp-breadcrumb a { color: #9a9388; flex-shrink: 0; transition: color .2s ease; }
.pdp-breadcrumb a:hover { color: #111; }
.pdp-breadcrumb > span.current {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(17,17,17,0.6);
}

/* --------------------------------------------------------------------------
   Product title — slightly tighter than home hero, bigger than section titles
   -------------------------------------------------------------------------- */
.pdp-title {
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
    font-size: clamp(1.4rem, 4.2vw, 1.95rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: #111;
}

.pdp-eyebrow {
    letter-spacing: 0.32em;
    text-transform: uppercase;
    font-size: 10px;
    color: #9a9388;
    font-weight: 500;
}

/* Unified with home: use the same Noto Sans JP stack, no italic on Japanese text */
.pdp-serif {
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
    font-style: normal;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.pdp-num   { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.pdp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
}
.pdp-badge-new   { background: #111; color: #fff; }
.pdp-badge-sale {
    background: #FEF2F2;
    color: #C23A3A;
    border: 1px solid rgba(194,58,58,0.25);
}
.pdp-badge-trust {
    background: #EEF9F6;
    color: #0F766E;
    border: 1px solid rgba(15,118,110,0.18);
}
.pdp-badge-ghost {
    background: #fff;
    color: #111;
    border: 1px solid #D9D3C8;
}

/* Alias kept for existing markup */
.pdp-sale-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    background: #FEF2F2;
    color: #C23A3A;
    border: 1px solid rgba(194,58,58,0.25);
}
.pdp-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    background: #EEF9F6;
    color: #0F766E;
    border: 1px solid rgba(15,118,110,0.18);
    letter-spacing: 0.04em;
}

/* Animated in-stock dot */
.pdp-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #10B981;
    position: relative;
    display: inline-block;
}
.pdp-stock-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    background: rgba(16,185,129,0.35);
    animation: pdp-stock-pulse 1.8s ease-out infinite;
}
@keyframes pdp-stock-pulse {
    0%   { transform: scale(.7); opacity: .8 }
    100% { transform: scale(1.6); opacity: 0 }
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
.pdp-gallery-viewport {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: 12px;
    overflow: hidden;
    background: #F2EBE0;
    box-shadow: 0 1px 2px rgba(17,17,17,0.04), 0 12px 40px -18px rgba(17,17,17,0.12);
}
.pdp-gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.015);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.4s ease;
}
.pdp-gallery-slide.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.pdp-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdp-gallery-counter {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    z-index: 20;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    font-size: 11px;
    color: #6B6B6B;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.pdp-gallery-thumb {
    display: block;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #F2EBE0;
    aspect-ratio: 1 / 1;
    transition: transform 0.2s ease, outline-color 0.2s ease;
    outline: 2px solid transparent;
    outline-offset: 2px;
}
.pdp-gallery-thumb > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pdp-gallery-thumb:hover { transform: translateY(-1px); }
.pdp-gallery-thumb.is-active {
    outline-color: #111;
}

.pdp-sold-out-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.22);
}
.pdp-sold-out-overlay > span {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255,255,255,0.85);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.24em;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Buy card (right column)
   -------------------------------------------------------------------------- */
.pdp-buy-card {
    border: 1px solid var(--pdp-line);
    background: #fff;
    border-radius: 28px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(17,17,17,0.04), 0 12px 40px -18px rgba(17,17,17,0.12);
}
@media (min-width: 1024px) {
    .pdp-buy-card { padding: 1.75rem; }
}

/* Promise cards (3つの約束) */
.pdp-promise-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}
.pdp-promise-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--pdp-line);
}
.pdp-promise-card svg { width: 22px; height: 22px; color: #111; }
.pdp-promise-text {
    margin-top: 0.5rem;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
    color: #111;
}

/* Color swatch (future multi-color) */
.pdp-swatch {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    padding: 3px;
    background: #fff;
    border: 1px solid transparent;
    transition: border-color 0.18s ease, transform 0.18s ease;
}
.pdp-swatch > span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 11px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.pdp-swatch:hover { border-color: #D9D3C8; }
.pdp-swatch.is-active { border-color: #111; }

/* Single-value size/color static display */
.pdp-static-value {
    border: 1px solid var(--pdp-line);
    background: rgba(250,247,242,0.7);
    border-radius: 16px;
    padding: 0.85rem 1rem;
}
.pdp-static-value > .value {
    font-size: 14px;
    font-weight: 500;
    color: #111;
}
.pdp-static-value > .hint {
    margin-top: 2px;
    font-size: 11.5px;
    color: #6B6B6B;
}

/* Chip buttons (variant pick) */
.pdp-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 60px;
    padding: 0 18px;
    border: 1px solid #D9D3C8;
    border-radius: 12px;
    background: #fff;
    color: #111;
    font-size: 13px;
    font-weight: 500;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease, opacity .18s ease;
}
.pdp-chip:hover:not(:disabled) {
    border-color: #111;
    transform: translateY(-1px);
}
.pdp-chip.is-active {
    border-color: #111;
    background: #111;
    color: #fff;
}
.pdp-chip.is-disabled,
.pdp-chip:disabled {
    cursor: not-allowed;
    opacity: 0.38;
    transform: none;
    box-shadow: none;
}

/* Qty stepper */
.pdp-qty-shell {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--pdp-line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.pdp-qty-btn {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111;
    background: #fff;
    transition: background .15s ease;
    font-size: 18px;
    line-height: 1;
}
.pdp-qty-btn:hover:not(:disabled) { background: #FAF7F2; }
.pdp-qty-btn:disabled { cursor: not-allowed; opacity: 0.4; }

/* Delivery promise card (gold/cream gradient) */
.pdp-delivery {
    background: linear-gradient(180deg, #FBF5E9 0%, #F2EBE0 100%);
    border: 1px solid #E5DBC5;
    border-radius: 22px;
    padding: 1rem;
}
.pdp-delivery-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.pdp-delivery-icon svg { width: 20px; height: 20px; color: #111; }

/* Primary CTA — brand red for conversion */
.pdp-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 58px;
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.14em;
    box-shadow: 0 10px 24px -10px rgba(194,58,58,0.35);
    transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.pdp-cta:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -10px rgba(194,58,58,0.45);
}
.pdp-cta:active:not(:disabled) { transform: translateY(0); }
.pdp-cta:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    box-shadow: none;
}

/* Mobile sticky bar CTA — brand red */
.pdp-mobile-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    transition: background .2s ease, opacity .2s ease;
}
.pdp-mobile-cta:hover:not(:disabled) { background: var(--primary-hover); }
.pdp-mobile-cta:disabled { cursor: not-allowed; opacity: 0.42; }

/* Payment card icons row under CTA */
.pdp-pay-card {
    display: inline-block;
    width: 40px;
    height: 26px;
    border: 1px solid var(--pdp-line);
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
    background: #fff;
}
.pdp-pay-card svg { width: 100%; height: 100%; display: block; }

/* --------------------------------------------------------------------------
   Option dropdown (accessible custom <select>)
   -------------------------------------------------------------------------- */
.pdp-dropdown { position: relative; min-width: 0; }
.pdp-dropdown-native {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    border: 0;
    opacity: 0;
    pointer-events: none;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.pdp-dropdown-trigger {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--pdp-line);
    border-radius: 16px;
    background: #faf8f4;
    color: #111;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.pdp-dropdown-trigger:hover {
    border-color: rgba(17,17,17,0.14);
    background: #fff;
}
.pdp-dropdown.is-open .pdp-dropdown-trigger,
.pdp-dropdown-trigger:focus-visible {
    outline: none;
    border-color: rgba(17,17,17,0.4);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(17,17,17,0.06);
}
.pdp-dropdown-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #111;
    font-size: 0.92rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pdp-dropdown-icon {
    width: 1rem; height: 1rem;
    flex-shrink: 0;
    color: #6b7280;
    transition: transform 0.2s ease;
}
.pdp-dropdown.is-open .pdp-dropdown-icon { transform: rotate(180deg); }
.pdp-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 30;
    display: none;
    overflow: hidden;
    border: 1px solid var(--pdp-line);
    border-radius: 16px;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 45px rgba(17,17,17,0.1);
}
.pdp-dropdown.is-open .pdp-dropdown-menu { display: block; }
.pdp-dropdown-options {
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.45rem;
}
.pdp-dropdown-option {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    color: #111;
    text-align: left;
    transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.pdp-dropdown-option:hover:not(.is-disabled),
.pdp-dropdown-option.is-focus:not(.is-disabled) { background: #f9fafb; }
.pdp-dropdown-option.is-selected { background: rgba(17,17,17,0.04); }
.pdp-dropdown-option.is-disabled { cursor: not-allowed; opacity: 0.4; }
.pdp-dropdown-option-note { font-size: 0.74rem; color: #9ca3af; }
.pdp-color-dot {
    width: 0.72rem;
    height: 0.72rem;
    flex-shrink: 0;
    border: 1px solid rgba(17,17,17,0.1);
    border-radius: 999px;
    background: #d1d5db;
}

/* --------------------------------------------------------------------------
   Content cards (product detail, FAQ, reviews)
   -------------------------------------------------------------------------- */
.pdp-panel {
    border-radius: 28px;
    background: #fff;
    border: 1px solid var(--pdp-line);
    box-shadow: 0 1px 2px rgba(17,17,17,0.04), 0 12px 40px -18px rgba(17,17,17,0.12);
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.pdp-faq details {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--pdp-line);
}
.pdp-faq details:last-child { border-bottom: 0; }
.pdp-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 500;
    color: #111;
}
.pdp-faq summary::-webkit-details-marker { display: none; }
.pdp-faq summary svg {
    transition: transform .2s ease;
    flex-shrink: 0;
    color: #9a9388;
}
.pdp-faq details[open] summary svg { transform: rotate(180deg); }
.pdp-faq details > p {
    margin-top: 0.75rem;
    font-size: 13px;
    line-height: 1.8;
    color: #6B6B6B;
}
.pdp-faq details > p b {
    color: #111;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Rich text (rendered from admin WYSIWYG into #detailDescriptionContent)
   -------------------------------------------------------------------------- */
.pdp-richtext {
    color: #1a1a1a;
    font-size: 14.5px;
    line-height: 2;
}
.pdp-richtext > * + * { margin-top: 1.25rem; }
.pdp-richtext > :first-child { margin-top: 0; }
.pdp-richtext h1 {
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
    font-weight: 700;
    font-size: clamp(1.28rem, 4.8vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-top: 3rem;
    color: #111;
}
.pdp-richtext h2 {
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
    font-weight: 700;
    font-size: clamp(1.18rem, 4.2vw, 1.72rem);
    line-height: 1.22;
    letter-spacing: -0.03em;
    margin-top: 2.5rem;
    position: relative;
    padding-left: 1rem;
    color: #111;
}
.pdp-richtext h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 4px;
    height: 1em;
    background: var(--pdp-gold);
    border-radius: 2px;
}
.pdp-richtext h3 {
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #9a9388;
    margin-top: 2rem;
    font-weight: 500;
}
.pdp-richtext h4 {
    font-size: 15px;
    font-weight: 500;
    color: #111;
    margin-top: 1.5rem;
}
.pdp-richtext p { color: #4a4a4a; }
.pdp-richtext strong,
.pdp-richtext b {
    color: #111;
    font-weight: 500;
}
.pdp-richtext em,
.pdp-richtext i {
    font-style: italic;
    color: #6B6B6B;
}
.pdp-richtext ul {
    list-style: none;
    padding-left: 0;
}
.pdp-richtext ul > li {
    position: relative;
    padding-left: 1.25rem;
    color: #4a4a4a;
}
.pdp-richtext ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.9em;
    width: 6px;
    height: 1px;
    background: var(--pdp-gold);
}
.pdp-richtext ol {
    padding-left: 1.25rem;
    color: #4a4a4a;
}
.pdp-richtext ol > li { list-style: decimal; }
.pdp-richtext li + li { margin-top: 0.35rem; }

.pdp-richtext blockquote {
    border-left: 2px solid var(--pdp-gold);
    padding: 0.2rem 0 0.2rem 1.25rem;
    font-style: italic;
    color: #6B6B6B;
}
.pdp-richtext img {
    width: 100%;
    border-radius: 8px;
    background: var(--pdp-cream2);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    display: block;
}
.pdp-richtext img + p,
.pdp-richtext img + h3,
.pdp-richtext img + h4 { margin-top: 1rem; }

.pdp-richtext hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pdp-line), transparent);
    margin: 3rem 0;
}
.pdp-richtext table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-top: 1.5rem;
}
.pdp-richtext table th,
.pdp-richtext table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--pdp-line);
    text-align: left;
    vertical-align: top;
    font-weight: 400;
}
.pdp-richtext table th {
    font-weight: 500;
    color: #6B6B6B;
    font-size: 12px;
    background: var(--pdp-cream);
}
.pdp-richtext table td:first-child,
.pdp-richtext table td[data-table-key="true"] {
    color: #6B6B6B;
    width: 30%;
    background: transparent;
}
.pdp-richtext td p,
.pdp-richtext th p { margin: 0; }
.pdp-richtext td p + p,
.pdp-richtext th p + p { margin-top: 0.5rem; }
.pdp-richtext a {
    color: #111;
    text-decoration: underline;
    text-underline-offset: 0.22em;
}
.pdp-richtext code {
    display: inline-block;
    padding: 0.16rem 0.42rem;
    border-radius: 0.45rem;
    background: #f3f4f6;
    color: #111;
    font-size: 0.86em;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Size guide table (built-in on page)
   -------------------------------------------------------------------------- */
.pdp-size-guide table {
    width: 100%;
    min-width: 520px;
    font-size: 13px;
}
.pdp-size-guide thead tr {
    border-bottom: 1px solid var(--pdp-line);
    color: #6B6B6B;
}
.pdp-size-guide tbody tr {
    border-bottom: 1px solid var(--pdp-line);
}
.pdp-size-guide thead th {
    padding: 0.75rem 0.5rem;
    font-weight: 400;
    text-align: left;
}
.pdp-size-guide tbody td {
    padding: 0.875rem 0.5rem;
    text-align: center;
    color: #6B6B6B;
}
.pdp-size-guide tbody td:first-child {
    text-align: left;
    color: #111;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Utility helpers scoped to PDP
   -------------------------------------------------------------------------- */
.pdp-no-scrollbar { scrollbar-width: none; }
.pdp-no-scrollbar::-webkit-scrollbar { display: none; }
