/* Product detail page (/product/<slug>/).
   Loads after style.css and reuses its tokens (--text, --border, --accent,
   --fdl-*); nothing here redefines a token. Layout, top to bottom:
   title + meta line, hero (image | best-price card), offers, price history,
   alerts, related links. Phones stack in the same order with a 16px gutter. */

.product-page.pp {
    max-width: var(--fdl-page-wide);
}

.product-page-inner.pp-inner {
    padding: 20px 16px 48px;
}

.pp .product-breadcrumb {
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

/* ── Title + meta line ── */
.pp-head {
    margin-bottom: 18px;
}

.pp .product-detail-title.pp-title {
    margin: 0 0 6px;
    font-size: 1.45rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.pp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 0;
    margin: 0;
    color: var(--text-dim);
    font-size: 0.8rem;
    line-height: 1.5;
}

.pp-meta-item {
    overflow-wrap: anywhere;
}

.pp-meta-item + .pp-meta-item::before {
    content: "\00b7";
    margin: 0 8px;
    color: var(--text-muted);
}

/* ── Hero ── */
.pp-hero {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.pp-hero > * {
    min-width: 0;
}

.pp .pp-hero-image {
    min-height: 240px;
}

.pp .pp-hero-image img {
    display: block;
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.pp-price-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--fdl-shadow-card);
}

.pp-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.pp-price {
    color: var(--green);
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0;
}

.pp-price.price--map-masked {
    color: var(--fdl-warning);
    font-size: 1.5rem;
}

.pp-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-raised);
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.pp-badge--oos {
    border-color: transparent;
    background: var(--red-bg);
    color: var(--red);
}

.pp-badge--deal {
    border-color: transparent;
    background: var(--accent-bg);
    color: var(--accent);
}

a.pp-badge--deal:hover {
    text-decoration: underline;
}

.pp-price-source {
    margin: 6px 0 0;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.pp-price-source strong {
    color: var(--text);
    font-weight: 700;
}

.pp-price-ammo {
    display: flex;
    flex-wrap: wrap;
    margin: 2px 0 0;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.pp .product-page-primary-actions {
    margin: 16px 0 12px;
}

.pp .pp-cta {
    font-size: 0.95rem;
    padding: 13px 16px;
    overflow-wrap: anywhere;
}

.pp-price-range {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.pp-this-listing {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.pp-this-listing a {
    color: var(--text-dim);
    text-decoration: underline;
    text-decoration-color: var(--border-light);
    text-underline-offset: 2px;
}

.pp-this-listing a:hover {
    color: var(--accent);
}

.pp-price-card .product-cta-disclosure {
    margin-top: 12px;
}

/* ── Sections ── */
.pp-section {
    margin-top: 32px;
    min-width: 0;
}

.pp-section .section-title {
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.pp-section-head {
    margin-bottom: 12px;
}

.pp-section-head .product-page-offers-copy {
    margin: 0;
    font-size: 0.85rem;
}

/* ── Offers ── */
.pp .product-page-offers-list {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.pp .product-page-offers-list .modal-group-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    font-size: 0.85rem;
}

.pp .product-page-offers-list .modal-group-price-row + .modal-group-price-row {
    border-top: 1px solid var(--border);
}

.pp .product-page-offers-list .modal-group-price-row--best {
    background: var(--green-bg);
}

.pp .product-page-offers-list .modal-group-price-row.pp-offer--this {
    background: rgba(var(--fdl-action-rgb), 0.06);
    box-shadow: inset 3px 0 0 var(--accent);
}

.pp .product-page-offer-main {
    flex: 1 1 auto;
}

.pp .product-page-offer-side {
    flex: 0 0 auto;
    gap: 12px;
}

.pp .modal-group-price-val {
    font-size: 1rem;
}

.pp-offer-marker {
    color: var(--accent);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: var(--fdl-letter-label);
    text-transform: uppercase;
}

#this-listing {
    scroll-margin-top: calc(var(--shell-banner-height) + var(--shell-nav-height) + 16px);
}

/* ── Price history ── */
.pp-history .section-heading-row {
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pp-history-note {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.pp-history .chart-wrap {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.pp-figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 0;
}

.pp-figure dt {
    margin: 0 0 2px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: var(--fdl-letter-label);
    text-transform: uppercase;
}

.pp-figure dd {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.pp-verdict {
    margin: 12px 0 0;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* The embed snippets stay available behind one small text link. */
.chart-share.pp-share {
    margin-top: 10px;
    border: 0;
    background: none;
}

.pp-share > .chart-share-toggle {
    display: inline;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pp-share > .chart-share-toggle::-webkit-details-marker {
    display: none;
}

.pp-share > .chart-share-toggle:hover {
    color: var(--accent);
}

.pp-share .chart-share-body {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
}

.pp-share .chart-share-input {
    min-width: 0;
}

/* ── Alerts: one inline row ── */
.pp-alerts .ammo-alert-capture {
    margin: 0 0 12px;
}

.pp .alert-signup-box.pp-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0;
    padding: 12px 14px;
}

.pp-alert .alert-signup-title {
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* auth-hydration.js rebuilds this box for signed-in users with a longer
   description; the inline row has no room for it. */
.pp-alert .alert-signup-desc {
    display: none;
}

.pp .pp-alert .alert-signup-form {
    flex: 1 1 380px;
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
}

.pp-alert .alert-signup-target {
    flex: 1 1 150px;
    max-width: none;
    min-width: 0;
}

.pp-alert .alert-signup-btn {
    flex: 0 0 auto;
}

.pp-alert .alert-signup-msg {
    flex-basis: 100%;
    margin-top: 0;
}

/* ── Related categories: plain text links ── */
.pp-related {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
}

.pp-related-label {
    color: var(--text-muted);
    font-weight: 600;
}

.pp-related a {
    color: var(--accent);
    text-decoration: none;
}

.pp-related a:hover {
    text-decoration: underline;
}

/* ── Phones: same order, single column, 16px gutter ── */
@media (max-width: 640px) {
    .product-page-inner.pp-inner {
        padding: 12px 16px 40px;
    }

    .pp .product-detail-title.pp-title {
        font-size: 1.15rem;
    }

    .pp-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .pp .pp-hero-image {
        min-height: 0;
    }

    .pp .pp-hero-image img {
        max-height: 240px;
    }

    .pp-price-card {
        padding: 16px;
    }

    .pp-price {
        font-size: 1.9rem;
    }

    .pp-section {
        margin-top: 24px;
    }

    .pp .product-page-offers-list .modal-group-price-row {
        flex-wrap: wrap;
        padding: 12px;
    }

    .pp .product-page-offer-main,
    .pp .product-page-offer-side {
        width: 100%;
    }

    .pp .product-page-offer-side {
        justify-content: space-between;
    }

    .pp-history .chart-wrap {
        padding: 8px;
    }

    .pp-figures {
        gap: 8px;
    }

    .pp-figure dd {
        font-size: 0.95rem;
    }

    .pp-alert .alert-signup-title {
        flex-basis: 100%;
    }
}
