/**
 * Part detail page — scoped to .pd-* to avoid colliding with listing CSS.
 * KMC Japan navy / blue branding.
 */
.pd-page {
    --pd-navy: #0a2540;
    --pd-navy-2: #123056;
    --pd-blue: #0066cc;
    --pd-blue-dark: #0052a3;
    --pd-bg: #f4f7fb;
    --pd-card: #ffffff;
    --pd-muted: #5c6b7a;
    --pd-line: #d9e2ec;
    --pd-ok: #0f7b4a;
    --pd-radius: 14px;
    background: var(--pd-bg);
    margin: -1.5rem 0 0;
    padding: 1.25rem 0 4.5rem;
}

.pd-wrap {
    max-width: 1180px;
}

.pd-crumb {
    background: transparent;
    padding: 0.25rem 0 1rem;
    margin: 0;
    font-size: 0.85rem;
}
.pd-crumb .breadcrumb-item + .breadcrumb-item::before {
    color: #8aa0b5;
}
.pd-crumb a { color: var(--pd-blue); }
.pd-crumb .breadcrumb-item.active {
    color: var(--pd-navy);
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pd-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1.5rem;
    align-items: start;
}

.pd-gallery,
.pd-buy,
.pd-panel {
    background: var(--pd-card);
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius);
    box-shadow: 0 8px 24px rgba(10, 37, 64, 0.06);
}

.pd-gallery {
    padding: 0.85rem;
}

.pd-stage {
    position: relative;
    background: linear-gradient(180deg, #eef3f8 0%, #f8fafc 100%);
    border-radius: 10px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pd-stage img {
    max-width: 100%;
    max-height: 460px;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
}
.pd-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 37, 64, 0.78);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.pd-gallery.has-many .pd-nav { display: inline-flex; }
.pd-nav:hover { background: var(--pd-blue); }
.pd-nav.prev { left: 10px; }
.pd-nav.next { right: 10px; }

.pd-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.pd-thumbs button {
    flex: 0 0 72px;
    height: 72px;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0;
    background: #eef3f8;
    overflow: hidden;
}
.pd-thumbs button.is-active,
.pd-thumbs button:hover {
    border-color: var(--pd-blue);
}
.pd-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-buy {
    padding: 1.35rem 1.4rem 1.25rem;
    position: sticky;
    top: 88px;
}
.pd-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--pd-blue);
    margin-bottom: 0.45rem;
}
.pd-title {
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    line-height: 1.25;
    color: var(--pd-navy);
    font-weight: 700;
    margin: 0 0 0.55rem;
    word-break: break-word;
}
.pd-orig {
    font-size: 0.8rem;
    color: var(--pd-muted);
    margin: 0 0 0.85rem;
}
.pd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.pd-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: #eef4fb;
    color: var(--pd-navy);
    border: 1px solid #d5e4f5;
}
.pd-chip.ok { background: #e7f6ee; color: var(--pd-ok); border-color: #c6ead5; }
.pd-chip.warn { background: #fff6e5; color: #9a6700; border-color: #f3e0b5; }

.pd-price-block {
    background: linear-gradient(135deg, var(--pd-navy) 0%, var(--pd-navy-2) 60%, #164a86 100%);
    color: #fff;
    border-radius: 12px;
    padding: 1rem 1.1rem 0.95rem;
    margin-bottom: 1rem;
}
.pd-price-label {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.8;
    margin: 0;
}
.pd-price {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0.15rem 0 0.35rem;
    letter-spacing: -0.02em;
}
.pd-price-jpy,
.pd-price-note {
    font-size: 0.8rem;
    opacity: 0.82;
    margin: 0;
}

.pd-actions {
    display: grid;
    gap: 0.55rem;
}
.pd-actions .btn {
    border-radius: 10px;
    font-weight: 650;
    padding: 0.7rem 1rem;
}
.pd-actions .btn-primary {
    background: var(--pd-blue);
    border-color: var(--pd-blue);
}
.pd-actions .btn-primary:hover {
    background: var(--pd-blue-dark);
    border-color: var(--pd-blue-dark);
}
.pd-hint {
    font-size: 0.8rem;
    color: var(--pd-muted);
    margin: 0.7rem 0 0;
}

.pd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.pd-panel { padding: 1.25rem 1.35rem 1.4rem; }
.pd-panel h2 {
    font-size: 1.05rem;
    color: var(--pd-navy);
    font-weight: 700;
    margin: 0 0 1rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid var(--pd-blue);
    display: inline-block;
}

.pd-specs {
    width: 100%;
    margin: 0;
}
.pd-specs th,
.pd-specs td {
    padding: 0.65rem 0.2rem;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
    font-size: 0.93rem;
}
.pd-specs th {
    width: 38%;
    color: var(--pd-muted);
    font-weight: 600;
}
.pd-specs td {
    color: var(--pd-navy);
    font-weight: 600;
}
.pd-specs code {
    font-size: 0.86rem;
    color: var(--pd-blue-dark);
    background: #eef4fb;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
}

.pd-desc {
    color: #334155;
    font-size: 0.98rem;
    line-height: 1.7;
}
.pd-desc p { margin-bottom: 0.75rem; }
.pd-points {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pd-points li {
    position: relative;
    padding: 0.35rem 0 0.35rem 1.4rem;
    color: #334155;
}
.pd-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pd-blue);
}

.pd-form .form-control {
    border-radius: 8px;
    border-color: #cdd8e4;
}
.pd-form .form-control:focus {
    border-color: var(--pd-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}
.pd-share a {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.pd-related {
    margin-top: 2rem;
}
.pd-related h2 {
    font-size: 1.15rem;
    color: var(--pd-navy);
    font-weight: 700;
    margin-bottom: 1rem;
}
.pd-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}
.pd-rel {
    background: #fff;
    border: 1px solid var(--pd-line);
    border-radius: 12px;
    overflow: hidden;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pd-rel:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(10, 37, 64, 0.1);
    color: inherit;
}
.pd-rel-img {
    height: 140px;
    background: #eef3f8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-rel-img img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}
.pd-rel-body { padding: 0.75rem 0.85rem 0.95rem; }
.pd-rel-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--pd-navy);
    line-height: 1.3;
    margin: 0 0 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pd-rel-price {
    color: var(--pd-blue);
    font-weight: 800;
    margin: 0;
}

.pd-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 36, 0.92);
    z-index: 1080;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.pd-lightbox.is-open { display: flex; }
.pd-lightbox img {
    max-width: min(1100px, 96vw);
    max-height: 90vh;
    object-fit: contain;
}
.pd-lightbox button {
    position: absolute;
    top: 16px;
    right: 16px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
}

.pd-sticky {
    display: none;
}

@media (max-width: 991.98px) {
    .pd-hero,
    .pd-grid {
        grid-template-columns: 1fr;
    }
    .pd-buy { position: static; }
    .pd-stage { min-height: 240px; }
    .pd-stage img { max-height: 320px; }
    .pd-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-sticky {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        background: #fff;
        border-top: 1px solid var(--pd-line);
        padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
        box-shadow: 0 -6px 18px rgba(10, 37, 64, 0.08);
    }
    .pd-sticky .pd-price {
        font-size: 1.2rem;
        color: var(--pd-navy);
        margin: 0;
    }
    .pd-sticky .btn { white-space: nowrap; }
}

@media (max-width: 575.98px) {
    .pd-related-grid { grid-template-columns: 1fr 1fr; }
    .pd-title { font-size: 1.28rem; }
    .pd-price { font-size: 1.65rem; }
}
