/* ==========================================================================
   Canin — Product page modern skin  (DEMO / preview only)

   Everything here is scoped under .pd-modern, which is applied to the product
   <section> in the demo page. Nothing in this file can affect any other page,
   even if the file were loaded site-wide.

   No PHP, query, database, crawler, price or vendor logic is involved: this is
   presentation only. Vendor rank numbers and the "cheapest" badge are produced
   with CSS counters / :first-child, so no server-side calculation was added.
   ========================================================================== */

.pd-modern {
    --pd-gap: 14px;
    --pd-radius: 18px;
    --pd-radius-sm: 12px;
    --pd-ink: #0b2545;
    --pd-line: #e3edfb;
    --pd-ok: #047857;
    --pd-ok-bg: #ecfdf5;
    --pd-warn: #b45309;
    --pd-warn-bg: #fff8ec;
    --pd-off: #9aa6b8;
    --pd-off-bg: #f4f6fa;
    padding: 18px 0 0;
}

/* --------------------------------------------------------------- breadcrumb */
.pd-modern .pd-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 12px;
}

.pd-modern .pd-crumbs a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
}

.pd-modern .pd-crumbs a:hover { color: var(--primary); }

.pd-modern .pd-crumbs .pd-sep { opacity: .45; font-size: 11px; }

.pd-modern .pd-crumbs .pd-current {
    color: var(--pd-ink);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ------------------------------------------------------------------- shell */
.pd-modern .pd-top {
    display: grid;
    gap: var(--pd-gap);
    margin-bottom: var(--pd-gap);
}

.pd-modern .pd-card {
    background: var(--surface);
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius);
    box-shadow: 0 2px 10px rgba(16, 60, 120, .04);
}

/* ----------------------------------------------------------------- gallery */
.pd-modern .pd-gallery { padding: 12px; }

.pd-modern .pd-stage {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    background: #fff;
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius-sm);
    overflow: hidden;
}

.pd-modern .pd-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
    transition: transform .35s ease;
}

.pd-modern .pd-stage:hover img { transform: scale(1.04); }

.pd-modern .pd-noimg {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-size: 13px;
}

/* image counter — a small affordance that tells the user a gallery exists */
.pd-modern .pd-count {
    position: absolute;
    inset-inline-end: 10px;
    inset-block-end: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(11, 37, 69, .72);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.pd-modern .pd-count svg { width: 12px; height: 12px; }

.pd-modern .pd-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.pd-modern .pd-thumbs::-webkit-scrollbar { display: none; }

.pd-modern .pd-thumbs img {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    padding: 4px;
    background: #fff;
    border: 1.5px solid var(--pd-line);
    border-radius: 10px;
    object-fit: contain;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.pd-modern .pd-thumbs img.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}

/* ------------------------------------------------------------------ title */
.pd-modern .pd-head { padding: 16px; }

.pd-modern .pd-head h1 {
    margin: 0 0 10px;
    font-size: clamp(17px, 4.6vw, 22px);
    font-weight: 800;
    line-height: 1.6;
    color: var(--pd-ink);
    letter-spacing: -.2px;
}

.pd-modern .pd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pd-modern .pd-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--pd-line);
    color: #23507f;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
}

.pd-modern a.pd-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pd-modern .pd-chip .pd-chip-k {
    color: var(--muted);
    font-weight: 500;
}

/* ------------------------------------------------------------- price panel */
.pd-modern .pd-price {
    margin: 0 16px 14px;
    padding: 11px 14px 12px;
    border-radius: var(--pd-radius);
    background:
        radial-gradient(circle at 100% 0, rgba(255, 255, 255, .18), transparent 42%),
        linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(7, 87, 199, .22);
}

.pd-modern .pd-price-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 1px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.45;
    color: rgba(255, 255, 255, .85);
}

.pd-modern .pd-price-label svg { width: 13px; height: 13px; }

.pd-modern .pd-amount {
    display: block;
    font-size: clamp(22px, 6.6vw, 28px);
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -.5px;
    color: #fff;
    text-decoration: none;
}

.pd-modern .pd-seller {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .2);
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .9);
}

.pd-modern .pd-seller strong {
    color: #fff;
    font-weight: 700;
}

.pd-modern .pd-seller .pd-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
}

.pd-modern .pd-vcount {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    color: #fff;
}

/* ---------------------------------------------------------------- actions */
.pd-modern .pd-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 14px;
}

.pd-modern .pd-cta {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(22, 119, 255, .26);
    transition: transform .18s ease, box-shadow .18s ease;
}

.pd-modern .pd-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(22, 119, 255, .34);
}

.pd-modern .pd-cta svg { width: 17px; height: 17px; }

/* wishlist reduced to an icon button so it cannot compete with the main CTA */
.pd-modern .pd-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border: 1px solid var(--pd-line);
    border-radius: 14px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.pd-modern .pd-icon-btn:hover {
    border-color: var(--primary);
    background: var(--surface-2);
}

.pd-modern .pd-icon-btn svg { width: 19px; height: 19px; }

/* the report action becomes a quiet text link instead of a red full-width box */
.pd-modern .pd-report {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: auto;          /* neutralises width:100% from the base .btn-report-product rule */
    margin: 0 16px 14px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.pd-modern .pd-report:hover { color: #b91c1c; }

.pd-modern .pd-report svg { width: 13px; height: 13px; }

/* ------------------------------------------------------------ trust strip */
.pd-modern .pd-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 0 16px 16px;
    padding: 0;
    background: var(--pd-line);
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius-sm);
    overflow: hidden;
}

.pd-modern .pd-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 11px 6px;
    background: #fbfdff;
    text-align: center;
}

.pd-modern .pd-trust-item svg {
    width: 17px;
    height: 17px;
    color: var(--primary);
}

.pd-modern .pd-trust-item b {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--pd-ink);
    line-height: 1.4;
}

.pd-modern .pd-trust-item span {
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.4;
}

/* ------------------------------------------------------------------- tabs */
.pd-modern .pd-tabs { margin-bottom: var(--pd-gap); overflow: hidden; }

.pd-modern .pd-tabbar {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: #f4f8ff;
    border-bottom: 1px solid var(--pd-line);
}

.pd-modern .pd-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 40px;
    padding: 8px 6px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.pd-modern .pd-tab.active {
    background: #fff;
    color: var(--primary-strong);
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(16, 60, 120, .08);
}

/* count badge marks the vendors tab as the primary content of the page */
.pd-modern .pd-tab .pd-badge {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 10.5px;
    font-weight: 800;
}

.pd-modern .pd-tab.active .pd-badge {
    background: var(--primary);
    color: #fff;
}

.pd-modern .pd-panel { display: none; padding: 14px; }
.pd-modern .pd-panel.active { display: block; }

/* --------------------------------------------------------- vendor listing */
/* Online and in-person vendors are rendered as two separate groups, each in its
   own .pd-vendors container. Both lists arrive already sorted by price — online
   via ORDER BY pvp.price ASC, in-person via the usort in
   getProductOfflineVendors() — so :first-child inside a group really is that
   group's cheapest, and the rank counter restarts per group. */
.pd-modern .pd-group-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--pd-ink);
}

.pd-modern .pd-group-title + .pd-vendors { margin-bottom: 18px; }

.pd-modern .pd-group-title svg {
    width: 15px;
    height: 15px;
    color: var(--primary);
}

.pd-modern .pd-group-title .pd-group-count {
    display: inline-grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--primary-strong);
    font-size: 10.5px;
    font-weight: 800;
}

.pd-modern .pd-group-title--offline svg { color: #0e7490; }

.pd-modern .pd-group-title--offline .pd-group-count {
    background: #e0f2fe;
    color: #075985;
}

.pd-modern .pd-vendors {
    display: grid;
    gap: 10px;
    counter-reset: pdrank;
}

.pd-modern .pd-vendor {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "logo ident"
        "price price"
        "cta   cta";
    gap: 10px 11px;
    padding: 13px;
    background: #fff;
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius-sm);
    counter-increment: pdrank;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.pd-modern .pd-vendor:hover {
    border-color: rgba(22, 119, 255, .4);
    box-shadow: 0 6px 18px rgba(16, 60, 120, .07);
}

/* cheapest within its own group */
.pd-modern .pd-vendor:first-child {
    border-color: rgba(4, 120, 87, .35);
    background: linear-gradient(180deg, #f6fffb, #fff 60%);
}

.pd-modern .pd-vendor-logo {
    grid-area: logo;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--pd-line);
    border-radius: 11px;
    object-fit: contain;
    overflow: hidden;
}

.pd-modern span.pd-vendor-logo {
    background: var(--surface-2);
    color: var(--primary-strong);
    font-size: 13px;
    font-weight: 800;
}

.pd-modern .pd-vendor-ident {
    grid-area: ident;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.pd-modern .pd-vendor-name {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--pd-ink);
    line-height: 1.4;
}

/* rank number, generated from the CSS counter — no server-side numbering */
.pd-modern .pd-vendor-name::before {
    content: counter(pdrank);
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
}

.pd-modern .pd-vendor:first-child .pd-vendor-name::before {
    background: var(--pd-ok);
    color: #fff;
}

.pd-modern .pd-vendor-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 11px;
    color: var(--muted);
}

.pd-modern .pd-rate {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #b7791f;
    font-weight: 700;
}

.pd-modern .pd-rate svg { width: 12px; height: 12px; }

.pd-modern .pd-city {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.pd-modern .pd-city svg { width: 11px; height: 11px; opacity: .7; }

.pd-modern .pd-stock {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
}

.pd-modern .pd-stock.is-in { color: var(--pd-ok); background: var(--pd-ok-bg); }
.pd-modern .pd-stock.is-pre { color: var(--pd-warn); background: var(--pd-warn-bg); }
.pd-modern .pd-stock.is-out { color: var(--pd-off); background: var(--pd-off-bg); }

.pd-modern .pd-vendor-price {
    grid-area: price;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--pd-line);
}

.pd-modern .pd-vendor-price .pd-now {
    font-size: 17px;
    font-weight: 800;
    color: var(--pd-ink);
    letter-spacing: -.3px;
}

.pd-modern .pd-vendor:first-child .pd-vendor-price .pd-now { color: var(--pd-ok); }

.pd-modern .pd-vendor-price .pd-was {
    font-size: 12px;
    color: var(--muted);
    text-decoration: line-through;
}

.pd-modern .pd-best-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--pd-ok-bg);
    color: var(--pd-ok);
    font-size: 10.5px;
    font-weight: 800;
}

.pd-modern .pd-vendor:not(:first-child) .pd-best-tag { display: none; }

.pd-modern .pd-vendor-cta {
    grid-area: cta;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--primary);
    border-radius: 11px;
    background: #fff;
    color: var(--primary);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.pd-modern .pd-vendor-cta:hover {
    background: var(--primary);
    color: #fff;
}

.pd-modern .pd-vendor:first-child .pd-vendor-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(22, 119, 255, .24);
}

.pd-modern .pd-vendor-cta svg { width: 14px; height: 14px; }

/* honest note about what happens on click — this is a lead-gen platform */
.pd-modern .pd-redirect-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--pd-radius-sm);
    background: #f7fafe;
    border: 1px solid var(--pd-line);
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.7;
}

.pd-modern .pd-redirect-note svg {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-top: 3px;
    color: var(--primary);
}

.pd-modern .pd-empty {
    padding: 26px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ------------------------------------------------------- description/specs */
.pd-modern .pd-prose {
    font-size: 13.5px;
    line-height: 2;
    color: #35455c;
}

.pd-modern .pd-prose :is(h2, h3, h4) {
    margin: 16px 0 8px;
    font-size: 15px;
    color: var(--pd-ink);
}

.pd-modern .pd-prose img { border-radius: var(--pd-radius-sm); }

.pd-modern .pd-specs {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius-sm);
    overflow: hidden;
    font-size: 12.5px;
}

.pd-modern .pd-specs tr:nth-child(odd) { background: #fbfdff; }
.pd-modern .pd-specs tr + tr td { border-top: 1px solid var(--pd-line); }

.pd-modern .pd-specs td {
    padding: 11px 13px;
    text-align: right;
    line-height: 1.8;
}

.pd-modern .pd-specs .pd-k {
    width: 40%;
    color: var(--muted);
    font-weight: 600;
    border-inline-end: 1px solid var(--pd-line);
}

.pd-modern .pd-specs .pd-v {
    color: var(--pd-ink);
    font-weight: 600;
}

/* ---------------------------------------------------------------- summary */
.pd-modern .pd-summary {
    margin: 0 16px 16px;
    padding: 13px 14px;
    border-radius: var(--pd-radius-sm);
    background: #fbfdff;
    border: 1px solid var(--pd-line);
}

.pd-modern .pd-summary h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--pd-ink);
}

.pd-modern .pd-summary h3 svg { width: 14px; height: 14px; color: var(--primary); }

.pd-modern .pd-summary p {
    margin: 0;
    font-size: 12.5px;
    line-height: 2;
    color: #4a5b73;
}

/* --------------------------------------------------------------- similars */
.pd-modern .pd-similar { margin-bottom: var(--pd-gap); }

.pd-modern .pd-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: var(--pd-ink);
}

.pd-modern .pd-section-title::before {
    content: "";
    flex: 0 0 auto;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary), var(--primary-strong));
}

.pd-modern .pd-section-title span { flex: 1; }

/* ------------------------------------------------------------- desktop up */
@media (min-width: 901px) {
    .pd-modern { padding-top: 26px; }

    .pd-modern .pd-crumbs { font-size: 13px; margin-bottom: 18px; }

    .pd-modern .pd-top {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
        gap: 22px;
    }

    .pd-modern .pd-gallery { padding: 16px; position: sticky; top: 20px; }

    .pd-modern .pd-thumbs img { width: 70px; height: 70px; }

    .pd-modern .pd-head { padding: 22px 22px 0; }

    .pd-modern .pd-head h1 { font-size: 25px; margin-bottom: 13px; }

    .pd-modern .pd-price { margin: 16px 22px; padding: 14px 18px 15px; }

    .pd-modern .pd-actions { padding: 0 22px 16px; }

    .pd-modern .pd-report { margin: 0 22px 16px; }

    .pd-modern .pd-trust,
    .pd-modern .pd-summary { margin: 0 22px 20px; }

    .pd-modern .pd-panel { padding: 20px; }

    /* on a wide screen the vendor card becomes a single scannable row */
    .pd-modern .pd-vendor {
        grid-template-columns: auto minmax(0, 1.6fr) minmax(0, 1fr) auto;
        grid-template-areas: "logo ident price cta";
        align-items: center;
        gap: 16px;
        padding: 14px 16px;
    }

    .pd-modern .pd-vendor-price {
        justify-content: flex-start;
        padding-top: 0;
        border-top: 0;
    }

    .pd-modern .pd-vendor-price .pd-now { font-size: 19px; }

    .pd-modern .pd-vendor-cta { min-width: 160px; }

    .pd-modern .pd-section-title { font-size: 18px; }
}

/* ------------------------------------------------------------ small phones */
@media (max-width: 380px) {
    .pd-modern .pd-trust-item { padding: 9px 4px; }
    .pd-modern .pd-trust-item b { font-size: 10.5px; }
    .pd-modern .pd-trust-item span { font-size: 9.5px; }
    .pd-modern .pd-thumbs img { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
    .pd-modern * { transition: none !important; }
    .pd-modern .pd-stage:hover img { transform: none; }
}
