/* ==========================================================
   Product page — Views/Content/Details.cshtml, _Images.cshtml,
   Components/ContentList/Related.cshtml. Tokens: site.css
   ========================================================== */

.pd-page {
    padding: 20px 0 48px;
    background: #fff;
}

.pd-page > .container-fluid,
.pd-related > .container-fluid {
    max-width: 1280px;
}

/* ---------- Breadcrumb ---------- */
.pd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--tt-muted);
}

.pd-breadcrumb a {
    color: var(--tt-muted);
    text-decoration: none;
}

.pd-breadcrumb a:hover { color: var(--tt-accent); }
.pd-breadcrumb i { font-size: 12px; color: #b5bec7; }

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

/* ---------- Main layout ---------- */
.pd-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

/* ---------- Gallery ---------- */
.pd-gallery {
    position: sticky;
    top: 20px;
}

.pd-gallery-main {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--tt-border);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.pd-gallery-slide {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    cursor: zoom-in;
}

.pd-gallery-slide.is-active { display: flex; }

.pd-gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pd-gallery-zoom {
    position: absolute;
    bottom: 14px;
    left: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--tt-shadow);
    color: var(--tt-ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.pd-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.pd-gallery-thumb {
    flex: 0 0 76px;
    height: 76px;
    padding: 6px;
    border: 2px solid var(--tt-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.pd-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pd-gallery-thumb:hover { border-color: #ffc2a8; }
.pd-gallery-thumb.is-active { border-color: var(--tt-accent); }

/* ---------- Info column ---------- */
.pd-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.pd-badges:empty { display: none; }

/* the card badges are positioned for the card; here they sit inline */
.pd-badges .product-badge { position: static; box-shadow: none; }

.pd-brand {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--tt-accent);
    text-decoration: none;
}

.pd-brand:hover { color: var(--tt-accent-dark); text-decoration: underline; }

.pd-title {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--tt-ink);
}

.pd-brief {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--tt-muted);
}

/* price + stock + buttons */
.pd-buy {
    padding: 20px;
    border: 1px solid var(--tt-border);
    border-radius: 16px;
    background: var(--tt-bg-soft);
    margin-bottom: 20px;
}

.pd-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
}

.pd-price-now {
    font-size: 34px;
    font-weight: 800;
    color: var(--tt-ink);
    line-height: 1.1;
}

.pd-price-now small {
    font-size: 16px;
    font-weight: 600;
    color: var(--tt-muted);
}

.pd-price-old {
    font-size: 17px;
    color: #9aa5b1;
    text-decoration: line-through;
}

.pd-price-save {
    padding: 3px 10px;
    border-radius: 999px;
    background: #e3f5ea;
    color: var(--tt-success);
    font-size: 13px;
    font-weight: 700;
}

.pd-stock {
    margin: 12px 0 16px;
    font-size: 14px;
    font-weight: 600;
}

.pd-stock-in { color: var(--tt-success); }
.pd-stock-pre { color: #3a6ea5; }
.pd-stock-out { color: var(--tt-danger); }

.pd-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 10px;
}

.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    padding: 0 18px;
    border-radius: 12px;
    border: 2px solid transparent;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pd-btn i { font-size: 19px; }
.pd-btn:hover { text-decoration: none; }

.pd-btn-cart {
    background: var(--tt-accent);
    color: #fff;
}

.pd-btn-cart:hover { background: var(--tt-accent-dark); color: #fff; }
.pd-btn-cart.added { background: var(--tt-success); }
.pd-btn-cart:disabled { cursor: progress; }

.pd-btn-whatsapp {
    background: #fff;
    border-color: var(--tt-whatsapp);
    color: #138a43;
}

.pd-btn-whatsapp i { color: var(--tt-whatsapp); }
.pd-btn-whatsapp:hover { background: var(--tt-whatsapp); color: #fff; }
.pd-btn-whatsapp:hover i { color: #fff; }

.pd-btn-notify {
    grid-column: 1 / -1;
    background: var(--tt-ink-2);
    color: #fff;
}

.pd-btn-notify:hover { background: var(--tt-ink); color: #fff; }

.pd-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px dashed var(--tt-border);
    list-style: none;
    font-size: 13px;
    color: var(--tt-muted);
}

.pd-perks i { margin-inline-end: 6px; color: var(--tt-accent); }

/* build-your-racket cross-sell (blades & rubbers) */
.pd-builder {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--tt-ink);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.6;
    text-decoration: none;
    transition: background 0.2s ease;
}

.pd-builder:hover { background: #24364a; color: #fff; text-decoration: none; }

.pd-builder strong {
    display: block;
    font-size: 15px;
    color: #fff;
}

.pd-builder-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--tt-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.pd-builder-text { flex: 1; }
.pd-builder > .fa-arrow-left { color: var(--tt-accent); }

/* ---------- Description ---------- */
.pd-section-title {
    position: relative;
    margin: 0;
    padding-right: 14px;
    font-size: 22px;
    font-weight: 800;
    color: var(--tt-ink);
}

.pd-section-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 15%;
    bottom: 15%;
    width: 5px;
    border-radius: 3px;
    background: var(--tt-accent);
}

.pd-description {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--tt-border);
}

.pd-description-body {
    max-width: 860px;
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.9;
    color: #3d4a57;
}

.pd-description-body p { margin-bottom: 12px; }
.pd-description-body ul,
.pd-description-body ol { padding-inline-start: 22px; margin-bottom: 14px; }
.pd-description-body li { margin-bottom: 6px; }
.pd-description-body img { max-width: 100%; height: auto; border-radius: 10px; }

.pd-description-body table {
    width: 100%;
    margin-bottom: 16px;
    border-collapse: collapse;
    font-size: 14px;
}

.pd-description-body th,
.pd-description-body td {
    padding: 8px 12px;
    border: 1px solid var(--tt-border);
}

.pd-description-body th { background: var(--tt-bg-soft); }

/* ---------- Related ---------- */
.pd-related {
    padding: 44px 0 56px;
    background: var(--tt-bg-soft);
}

.pd-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.pd-section-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--tt-accent);
    text-decoration: none;
    white-space: nowrap;
}

.pd-section-more:hover { color: var(--tt-accent-dark); text-decoration: none; }

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

.pd-related-row .product-card { margin-bottom: 0; height: 100%; }

/* ---------- Mobile buy bar ---------- */
.pd-buybar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .pd-related-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* 3 columns: show two full rows (6 cards) instead of leaving a half-empty third row */
    .pd-related-row > .product-card:nth-child(n+7) { display: none; }
}

@media (max-width: 991.98px) {
    .pd-main {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .pd-gallery { position: static; }

    .pd-gallery-main {
        max-width: 520px;
        margin: 0 auto;
    }

    .pd-gallery-thumbs { justify-content: center; }

    .pd-title { font-size: 24px; }
    .pd-price-now { font-size: 30px; }
}

@media (max-width: 767.98px) {
    .pd-page { padding: 14px 0 32px; }
    .pd-breadcrumb { margin-bottom: 14px; }

    .pd-gallery-slide { padding: 18px; }
    .pd-gallery-thumb { flex-basis: 62px; height: 62px; }

    .pd-title { font-size: 21px; }
    .pd-buy { padding: 16px; }

    .pd-actions { grid-template-columns: 1fr; }
    .pd-btn { height: 50px; }

    .pd-description { margin-top: 32px; padding-top: 24px; }
    .pd-section-title { font-size: 19px; }

    .pd-related { padding: 32px 0 40px; }

    /* sideways-scrolling row of cards */
    .pd-related-row {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin: 0 -15px;
        padding: 0 15px 6px;
        scrollbar-width: none;
    }

    .pd-related-row::-webkit-scrollbar { display: none; }

    .pd-related-row > .product-card,
    .pd-related-row > .product-card:nth-child(n+7) {
        display: block;
        flex: 0 0 46%;
        scroll-snap-align: start;
    }

    .pd-buybar {
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        z-index: 960;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--tt-border);
        box-shadow: 0 -6px 20px rgba(28, 39, 51, 0.1);
        transform: translateY(110%);
        transition: transform 0.25s ease;
    }

    .pd-buybar.is-visible { transform: none; }

    .pd-buybar-price {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        line-height: 1.3;
    }

    .pd-buybar-price strong { font-size: 17px; color: var(--tt-ink); }
    .pd-buybar-price span { font-size: 12px; color: #9aa5b1; text-decoration: line-through; }

    .pd-buybar-wa {
        flex-shrink: 0;
        width: 46px;
        height: 46px;
        border-radius: 12px;
        border: 2px solid var(--tt-whatsapp);
        color: var(--tt-whatsapp);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
    }

    .pd-buybar-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 46px;
        padding: 0 20px;
        border: 0;
        border-radius: 12px;
        background: var(--tt-accent);
        color: #fff;
        font-size: 15px;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
    }

    .pd-buybar-btn:hover { color: #fff; text-decoration: none; }
    .pd-buybar-btn.added { background: var(--tt-success); }
    .pd-buybar-btn.pd-btn-notify { background: var(--tt-ink-2); }

    /* the buy bar already offers WhatsApp; the floating button would cover it */
    body:has(.pd-buybar.is-visible) .whatsapp-float { opacity: 0; pointer-events: none; }

    /* keep the page end reachable above the bar */
    body:has(.pd-buybar) .modern-footer { padding-bottom: 70px; }
}
