/* ============================================================
   Product detail page — aligned to the home v3 design system.
   Namespace: .pd-*  ·  Tokens: --hp-* (from general.css)
   ============================================================ */

.pd-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 56px 0 48px;
    font-size: 13px;
    color: var(--hp-fg-muted);

    /* g-loop wrapper for each category crumb. `display: contents`
       dissolves the wrapper so the chevron + link inside it become
       direct flex items of the breadcrumb and pick up the row gap. */
    .pd-breadcrumb-crumb {
        display: contents;
    }

    a {
        color: var(--hp-fg-muted);
        text-decoration: none;
        transition: color 160ms ease;

        &:hover {
            color: var(--hp-accent);
        }
    }

    i {
        font-size: 9px;
        color: var(--hp-fg-faint);
    }

    .pd-breadcrumb-current {
        color: var(--hp-fg);
        font-weight: 500;
    }
}

/* ---- Shell: gallery + summary ------------------------------- */

.pd-shell {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
    align-items: start;
}

/* ---- Gallery ------------------------------------------------ */

.pd-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.pd-gallery-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* White plate — product photos aren't uniformly transparent;
       the hairline border defines the edge, not a gray fill. */
    background: #ffffff;
    border: 1px solid var(--hp-hairline);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

.pd-gallery-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.pd-gallery-thumbs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pd-gallery-thumb {
    width: 72px;
    height: 72px;
    padding: 8px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid var(--hp-hairline);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 160ms ease;

    img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    &:hover {
        border-color: var(--hp-hairline-strong);
    }

    &.is-active {
        border-color: var(--hp-accent);
    }
}

/* ---- Summary column ----------------------------------------- */

.pd-summary {
    position: sticky;
    top: 24px;
    align-self: start;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;

    &:empty {
        display: none;
    }
}

.pd-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;

    i {
        font-size: 10px;
    }
}

.pd-tag-popular {
    background: var(--hp-accent-soft);
    color: var(--hp-accent);
}

.pd-tag-featured {
    background: rgba(245, 184, 0, 0.14);
    color: #9a7400;
}

.pd-namespace {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-family: var(--hp-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hp-fg-muted);
}

.pd-namespace-sep {
    color: var(--hp-fg-faint);
}

.pd-title {
    margin: 12px 0 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--hp-fg);
}

.pd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-top: 20px;

    &:empty {
        display: none;
    }
}

.pd-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pd-meta-label {
    font-family: var(--hp-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hp-fg-faint);
}

.pd-meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-fg);
}

.pd-promo {
    margin: 24px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--hp-fg-muted);
}

.pd-points {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;

    li {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 14px;
        color: var(--hp-fg);
    }

    i {
        flex-shrink: 0;
        width: 30px;
        height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        background: var(--hp-accent-soft);
        color: var(--hp-accent);
        font-size: 13px;
    }
}

/* ---- Buy box ------------------------------------------------ */

.pd-buybox {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--hp-hairline);
}

.pd-price {
    margin-bottom: 16px;
}

.pd-price-value {
    font-family: var(--hp-mono);
    font-size: 28px;
    font-weight: 600;
    color: var(--hp-fg);
    font-variant-numeric: tabular-nums;
}

.pd-price-ask {
    font-size: 17px;
    font-weight: 600;
    color: var(--hp-fg-muted);
}

/* Unit-of-measure suffix on the product price (e.g. "/ kom.") —
   smaller and quieter than the price figure. */
.pd-price-unit {
    font-size: 16px;
    font-weight: 400;
    color: var(--hp-fg-faint, #727b8a);
}

.pd-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    font-size: 13.5px;
    color: var(--hp-fg-muted);

    i {
        font-size: 14px;
    }

    strong {
        color: var(--hp-fg);
        font-weight: 600;
    }
}

.pd-stock-in i {
    color: var(--clr-success-600);
}

.pd-stock-ask i {
    color: var(--hp-accent);
}

.pd-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.pd-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--hp-hairline-strong);
    border-radius: 999px;
    overflow: hidden;

    button {
        width: 38px;
        height: 42px;
        border: none;
        background: transparent;
        cursor: pointer;
        color: var(--hp-fg-muted);
        font-size: 12px;
        transition: background 160ms ease, color 160ms ease;

        &:hover {
            background: var(--hp-accent-soft);
            color: var(--hp-accent);
        }
    }

    span {
        min-width: 36px;
        text-align: center;
        font-family: var(--hp-mono);
        font-size: 14px;
        font-weight: 600;
        color: var(--hp-fg);
        font-variant-numeric: tabular-nums;
    }
}

.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 26px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: filter 160ms ease, transform 160ms ease;

    i {
        font-size: 13px;
    }
}

.pd-btn-primary {
    background: var(--hp-accent);
    color: #fff;
    border-color: var(--hp-accent);
    flex: 1;
    min-width: 180px;

    &:hover,
    &:focus-visible {
        filter: brightness(0.95);
        transform: translateY(-1px);
        outline: none;
    }
}

/* ---- Service callout --------------------------------------- */

.pd-service {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
    padding: 16px 18px;
    border: 1px solid var(--hp-hairline);
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease;

    &:hover {
        border-color: var(--hp-accent);
        background: var(--hp-accent-soft);
    }
}

.pd-service-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--hp-accent-soft);
    color: var(--hp-accent);
    font-size: 15px;
}

.pd-service-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.pd-service-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--hp-fg);
}

.pd-service-copy {
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--hp-fg-muted);
}

.pd-service-arrow {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--hp-fg-faint);
}

/* ---- Body sections ----------------------------------------- */

.pd-body {
    display: flex;
    flex-direction: column;
    gap: 96px;
    margin-top: 104px;
}

.pd-section-head {
    margin-bottom: 32px;
}

.pd-section-head-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
    flex-wrap: wrap;
}

.pd-eyebrow {
    margin: 0 0 10px;
    font-family: var(--hp-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--hp-fg-muted);
}

.pd-heading {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--hp-fg);
}

.pd-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-accent);
    text-decoration: none;
    transition: gap 200ms ease;

    i {
        font-size: 11px;
    }

    &:hover {
        gap: 12px;
    }
}

/* ---- Description prose ------------------------------------- */

.pd-prose {
    max-width: 760px;

    p {
        margin: 0;
        font-size: 15.5px;
        line-height: 1.7;
        color: var(--hp-fg-muted);
        white-space: pre-line;
    }
}

/* ---- Specs -------------------------------------------------- */

.pd-specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 40px;
}

.pd-spec-group {
    border: 1px solid var(--hp-hairline);
    border-radius: 4px;
    overflow: hidden;
}

.pd-spec-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f7f9fb;
    border-bottom: 1px solid var(--hp-hairline);
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-fg);

    i {
        color: var(--hp-accent);
        font-size: 13px;
        width: 16px;
        text-align: center;
    }
}

.pd-spec-table {
    width: 100%;
    border-collapse: collapse;

    tr + tr th,
    tr + tr td {
        border-top: 1px solid var(--hp-hairline);
    }

    th,
    td {
        padding: 11px 18px;
        text-align: left;
        vertical-align: top;
        font-size: 13.5px;
        line-height: 1.5;
    }

    th {
        width: 42%;
        font-weight: 500;
        color: var(--hp-fg-muted);
    }

    td {
        color: var(--hp-fg);
    }
}

/* ---- Features ----------------------------------------------- */

.pd-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.pd-feature {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--hp-hairline);
    border-radius: 4px;
    transition: border-color 160ms ease;

    &:hover {
        border-color: var(--hp-hairline-strong);
    }
}

.pd-feature-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--hp-accent-soft);
    color: var(--hp-accent);
    font-size: 16px;
}

.pd-feature-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--hp-fg);
}

.pd-feature-copy {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--hp-fg-muted);
}

/* ---- Files -------------------------------------------------- */

.pd-files {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;

    a {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        border: 1px solid var(--hp-hairline);
        border-radius: 4px;
        font-size: 14px;
        font-weight: 500;
        color: var(--hp-fg);
        text-decoration: none;
        transition: border-color 160ms ease, color 160ms ease;

        i {
            color: var(--hp-accent);
            font-size: 14px;
        }

        &:hover {
            border-color: var(--hp-accent);
            color: var(--hp-accent);
        }
    }
}

/* ---- Product rails (similar / featured) -------------------- */

.pd-rail {
    margin-top: 96px;
}

/* ---- Ecosystem band ---------------------------------------- */

.pd-eco {
    margin-top: 112px;
    padding: 88px 0;
    border-top: 1px solid var(--hp-hairline);
    background: #f7f9fb;
}

.pd-eco-inner {
    max-width: var(--hp-max, 1440px);
    margin: 0 auto;
    padding: 0 clamp(5px, 3.5vw, 65px);
}

.pd-eco-lede {
    margin: 14px 0 0;
    max-width: 640px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--hp-fg-muted);
}

.pd-eco-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.pd-eco-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 28px;
    background: var(--hp-bg);
    border: 1px solid var(--hp-hairline);
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 160ms ease, transform 200ms ease;

    &:hover {
        border-color: var(--hp-accent);
        transform: translateY(-2px);
    }
}

.pd-eco-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
}

.pd-eco-copy {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--hp-fg-muted);
    flex: 1;
}

.pd-eco-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--hp-mono);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--hp-accent);

    i {
        font-size: 11px;
    }
}

/* ---- Responsive --------------------------------------------- */

@media (max-width: 900px) {
    .pd-shell {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .pd-summary {
        position: static;
    }

    .pd-specs,
    .pd-features {
        grid-template-columns: 1fr;
    }

    .pd-body {
        margin-top: 72px;
        gap: 64px;
    }

    .pd-rail {
        margin-top: 72px;
    }

    .pd-eco {
        margin-top: 80px;
    }

    .pd-eco-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .pd-title {
        font-size: 25px;
    }

    .pd-heading {
        font-size: 22px;
    }

    .pd-gallery-stage {
        padding: 24px;
    }

    .pd-eco {
        padding: 56px 0;
    }
}


/* pd-qty-input v2 */
.pd-qty-input {
    /* Match the look of the legacy contenteditable span; the qty
       lives in a real <input type="number"> now so the form posts
       it cleanly. Native browser spin buttons are stripped — the
       custom +/- buttons drive the value. */
    width: 56px;
    min-width: 56px;
    text-align: center;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-family: var(--hp-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-fg);
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}
.pd-qty-input::-webkit-outer-spin-button,
.pd-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pd-qty-input:focus { outline: none; }
.pd-qty-btn {
    /* Mirrors .pd-qty button {} above so the +/- visually match.
       Needs an explicit selector now that the buttons are <button
       type="button" class="pd-qty-btn"> outside the SCSS nesting. */
    width: 38px;
    height: 42px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--hp-fg-muted);
    font-size: 12px;
    transition: background 160ms ease, color 160ms ease;
}
.pd-qty-btn:hover {
    background: var(--hp-accent-soft);
    color: var(--hp-accent);
}
