/*
 * PDF storefront - Phase 3 visual/responsive refinement
 * Scope ONLY: Phase 3 homepage sections (New Arrivals, Explore By Products,
 * category showcase rails and the final product spotlight row).
 * Header, Phase 1/2, cart, checkout, admin and business logic are untouched.
 */

/* ---------- section rhythm / cards ---------- */
.pdf3-section {
    padding: 18px 0 16px;
    background: transparent;
}

.pdf3-section + .pdf3-section {
    padding-top: 16px;
}

.pdf3-section-card,
.pdf3-category-rail,
.pdf3-spotlight {
    background: #fff;
    border: 1px solid #e4e9ee;
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(22, 43, 62, .06);
}

/* ---------- main section headings ---------- */
.pdf3-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 13px 16px 12px;
    border-bottom: 1px solid #edf1f4;
    background: linear-gradient(90deg, #f7fbfe 0%, #ffffff 72%);
    border-radius: 10px 10px 0 0;
}

.pdf3-section-head h2,
.pdf3-section-head-plain h2 {
    position: relative;
    margin: 0;
    padding-left: 13px;
    color: #18212a;
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .01em;
}

.pdf3-section-head h2::before,
.pdf3-section-head-plain h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 24px;
    border-radius: 4px;
    background: #3185c5;
    transform: translateY(-50%);
}

.pdf3-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 15px;
    border: 1px solid #3185c5;
    border-radius: 6px;
    background: #fff;
    color: #2579b6;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.pdf3-view-all:hover,
.pdf3-view-all:focus-visible {
    border-color: #2579b6;
    background: #3185c5;
    color: #fff;
    transform: translateY(-1px);
}

/* ---------- shared horizontal scroller ---------- */
.pdf3-scroll-shell {
    position: relative;
    min-width: 0;
}

.pdf3-scroll-track {
    display: flex;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pdf3-scroll-track::-webkit-scrollbar {
    display: none;
}

.pdf3-scroll-track:focus-visible {
    outline: 2px solid #2f86c8;
    outline-offset: -2px;
}

.pdf3-scroll-btn {
    position: absolute;
    top: 50%;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 62px;
    padding: 0;
    border: 1px solid #dce3e9;
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    color: #304354;
    box-shadow: 0 4px 14px rgba(18, 39, 58, .16);
    transform: translateY(-50%);
    transition: opacity .18s ease, box-shadow .18s ease, color .18s ease, background-color .18s ease;
}

.pdf3-scroll-btn:hover:not(:disabled),
.pdf3-scroll-btn:focus-visible:not(:disabled) {
    background: #3185c5;
    color: #fff;
    box-shadow: 0 5px 16px rgba(18, 39, 58, .22);
}

.pdf3-scroll-btn.is-hidden,
.pdf3-scroll-btn:disabled {
    opacity: 0;
    pointer-events: none;
}

.pdf3-scroll-prev {
    left: -5px;
}

.pdf3-scroll-next {
    right: -5px;
}

/* ---------- larger product cards ---------- */
.pdf3-product-track {
    gap: 18px;
    padding: 16px 18px 20px;
}

.pdf3-product-card {
    flex: 0 0 220px;
    min-width: 0;
    scroll-snap-align: start;
}

.pdf3-product-link {
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #edf0f3;
    border-radius: 9px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(22, 43, 62, .045);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.pdf3-product-link:hover,
.pdf3-product-link:focus-visible {
    border-color: #cddfeb;
    box-shadow: 0 7px 19px rgba(22, 43, 62, .12);
    transform: translateY(-3px);
}

.pdf3-product-media {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f7f9fb;
}

.pdf3-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .22s ease;
}

.pdf3-product-link:hover .pdf3-product-image,
.pdf3-product-link:focus-visible .pdf3-product-image {
    transform: scale(1.035);
}

.pdf3-discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 47px;
    height: 47px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #f23848;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .16);
}

.pdf3-product-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 12px 10px 11px;
    text-align: center;
}

.pdf3-product-name {
    display: -webkit-box;
    min-height: 40px;
    overflow: hidden;
    color: #252c33;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pdf3-price-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    min-height: 28px;
    margin-top: 5px;
}

.pdf3-price-row strong {
    color: #1681c2;
    font-size: 16px;
    font-weight: 700;
}

.pdf3-price-row del {
    color: #858d94;
    font-size: 11px;
}

.pdf3-stock-note {
    display: block;
    min-height: 18px;
    margin-top: 2px;
    color: #6d9f55;
    font-size: 10px;
    line-height: 1.35;
}

/* ---------- New Arrivals ---------- */
.pdf3-new-arrivals .pdf3-section-card {
    padding-bottom: 2px;
}

/* ---------- Explore by Products ---------- */
.pdf3-explore-card {
    padding: 0 14px 16px;
}

.pdf3-explore-card .pdf3-section-head {
    margin: 0 -14px 15px;
}

.pdf3-section-head-plain {
    padding-left: 16px;
    padding-right: 16px;
}

.pdf3-explore-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.pdf3-explore-group {
    min-width: 0;
    padding: 13px 12px 11px;
    border: 1px solid #e6ebef;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(25, 43, 58, .055);
    transition: transform .18s ease, box-shadow .18s ease;
}

.pdf3-explore-group:hover {
    box-shadow: 0 6px 16px rgba(25, 43, 58, .09);
    transform: translateY(-2px);
}

.pdf3-explore-group h3 {
    min-height: 23px;
    margin: 0 0 10px;
    overflow: hidden;
    color: #26323d;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf3-explore-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pdf3-explore-item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.pdf3-explore-image-wrap {
    display: flex;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1.08 / 1;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #eef9fb;
}

.pdf3-explore-item:nth-child(2n) .pdf3-explore-image-wrap {
    background: #fff0f2;
}

.pdf3-explore-item:nth-child(3n) .pdf3-explore-image-wrap {
    background: #f2f7ee;
}

.pdf3-explore-item:nth-child(4n) .pdf3-explore-image-wrap {
    background: #fff7e9;
}

.pdf3-explore-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .2s ease;
}

.pdf3-explore-item:hover .pdf3-explore-image,
.pdf3-explore-item:focus-visible .pdf3-explore-image {
    transform: scale(1.05);
}

.pdf3-explore-item-title {
    display: block;
    min-height: 32px;
    margin-top: 6px;
    overflow: hidden;
    color: #3f4952;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf3-see-more {
    display: inline-flex;
    margin-top: 10px;
    color: #2387c3;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.pdf3-see-more:hover,
.pdf3-see-more:focus-visible {
    text-decoration: underline;
}

.pdf3-image-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #9ba9b3;
    font-size: 28px;
}

/* ---------- Benefit Pack / School Item / Toys style rails ---------- */
.pdf3-showcase-section {
    padding-top: 16px;
}

.pdf3-showcase-stack {
    display: grid;
    gap: 22px;
}

.pdf3-category-rail {
    position: relative;
    padding: 0 14px 15px;
}

.pdf3-rail-title-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 53px;
    margin: 0 -14px 5px;
    padding: 10px 15px;
    border-bottom: 1px solid #edf1f4;
    background: linear-gradient(90deg, #f7fbfe 0%, #ffffff 72%);
    border-radius: 10px 10px 0 0;
}

.pdf3-rail-title {
    display: inline-flex;
    min-width: 145px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border: 1px solid #3185c5;
    border-radius: 7px;
    background: #3185c5;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(49, 133, 197, .18);
}

.pdf3-rail-title:hover,
.pdf3-rail-title:focus-visible {
    background: #2579b6;
    border-color: #2579b6;
    color: #fff;
}

.pdf3-rail-shell {
    margin-top: 0;
}

.pdf3-rail-track {
    gap: 18px;
    padding: 10px 24px 4px;
}

.pdf3-rail-item {
    display: flex;
    flex: 0 0 145px;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    scroll-snap-align: start;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.pdf3-rail-image-wrap {
    display: flex;
    overflow: hidden;
    width: 108px;
    height: 108px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, .025);
    border-radius: 50%;
    background: #e8f9fb;
    box-shadow: 0 3px 10px rgba(25, 43, 58, .07);
    transition: transform .2s ease, box-shadow .2s ease;
}

.pdf3-rail-item:nth-child(2n) .pdf3-rail-image-wrap {
    background: #fff4cf;
}

.pdf3-rail-item:nth-child(3n) .pdf3-rail-image-wrap {
    background: #e8f7ef;
}

.pdf3-rail-item:nth-child(4n) .pdf3-rail-image-wrap {
    background: #f6e8dc;
}

.pdf3-rail-item:nth-child(5n) .pdf3-rail-image-wrap {
    background: #e8f4fb;
}

.pdf3-rail-item:hover .pdf3-rail-image-wrap,
.pdf3-rail-item:focus-visible .pdf3-rail-image-wrap {
    box-shadow: 0 6px 15px rgba(25, 43, 58, .13);
    transform: translateY(-2px);
}

.pdf3-rail-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .2s ease;
}

.pdf3-rail-item:hover .pdf3-rail-image,
.pdf3-rail-item:focus-visible .pdf3-rail-image {
    transform: scale(1.055);
}

.pdf3-rail-item-title {
    display: -webkit-box;
    width: 100%;
    min-height: 34px;
    margin-top: 8px;
    overflow: hidden;
    color: #414b54;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ---------- final spotlight product row ---------- */
.pdf3-spotlight {
    padding: 0 0 2px;
}

.pdf3-spotlight-head {
    min-height: 56px;
    padding: 11px 15px;
}

.pdf3-spotlight-title {
    display: inline-flex;
    min-width: 145px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border: 1px solid #3185c5;
    border-radius: 7px;
    background: #3185c5;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(49, 133, 197, .18);
}

.pdf3-spotlight-title:hover,
.pdf3-spotlight-title:focus-visible {
    background: #2579b6;
    border-color: #2579b6;
    color: #fff;
}

/* ---------- desktop / tablet ---------- */
@media (min-width: 1200px) {
    .pdf3-product-card {
        flex-basis: 220px;
    }
}

@media (max-width: 1199.98px) {
    .pdf3-product-card {
        flex-basis: 205px;
    }

    .pdf3-explore-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pdf3-explore-image-wrap {
        aspect-ratio: 1.35 / 1;
    }
}

@media (max-width: 991.98px) {
    .pdf3-section {
        padding: 16px 0 14px;
    }

    .pdf3-product-card {
        flex-basis: 190px;
    }

    .pdf3-product-track {
        gap: 14px;
    }

    .pdf3-rail-track {
        gap: 14px;
    }

    .pdf3-rail-item {
        flex-basis: 132px;
    }

    .pdf3-rail-image-wrap {
        width: 98px;
        height: 98px;
    }
}

/* ---------- mobile ---------- */
@media (max-width: 767.98px) {
    .pdf3-section,
    .pdf3-showcase-section {
        padding: 12px 0;
    }

    .pdf3-section + .pdf3-section {
        padding-top: 10px;
    }

    .pdf3-section-card,
    .pdf3-category-rail,
    .pdf3-spotlight {
        border-radius: 8px;
    }

    .pdf3-section-head {
        min-height: 51px;
        padding: 10px 11px;
        border-radius: 8px 8px 0 0;
    }

    .pdf3-section-head h2,
    .pdf3-section-head-plain h2 {
        padding-left: 11px;
        font-size: 17px;
    }

    .pdf3-section-head h2::before,
    .pdf3-section-head-plain h2::before {
        width: 3px;
        height: 20px;
    }

    .pdf3-view-all {
        min-height: 31px;
        padding: 6px 11px;
        font-size: 11px;
    }

    .pdf3-product-track {
        gap: 11px;
        padding: 12px 11px 15px;
    }

    .pdf3-product-card {
        flex-basis: 44vw;
        max-width: 190px;
        min-width: 150px;
    }

    .pdf3-product-info {
        padding: 9px 7px 9px;
    }

    .pdf3-product-name {
        min-height: 38px;
        font-size: 12px;
    }

    .pdf3-price-row strong {
        font-size: 14px;
    }

    .pdf3-price-row del {
        font-size: 10px;
    }

    .pdf3-stock-note {
        font-size: 9px;
    }

    .pdf3-discount-badge {
        min-width: 40px;
        height: 40px;
        font-size: 10.5px;
    }

    .pdf3-scroll-btn {
        width: 31px;
        height: 50px;
        border-radius: 6px;
    }

    .pdf3-scroll-prev {
        left: -2px;
    }

    .pdf3-scroll-next {
        right: -2px;
    }

    .pdf3-explore-card {
        padding-left: 8px;
        padding-right: 8px;
        padding-bottom: 11px;
    }

    .pdf3-explore-card .pdf3-section-head {
        margin-left: -8px;
        margin-right: -8px;
        margin-bottom: 10px;
    }

    .pdf3-explore-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .pdf3-explore-group {
        padding: 10px 8px 9px;
    }

    .pdf3-explore-group h3 {
        margin-bottom: 7px;
        font-size: 12px;
    }

    .pdf3-explore-items {
        gap: 7px;
    }

    .pdf3-explore-image-wrap {
        aspect-ratio: 1 / 1;
    }

    .pdf3-explore-item-title,
    .pdf3-see-more {
        font-size: 10px;
    }

    .pdf3-category-rail {
        padding-left: 8px;
        padding-right: 8px;
        padding-bottom: 11px;
    }

    .pdf3-rail-title-wrap {
        min-height: 48px;
        margin-left: -8px;
        margin-right: -8px;
        padding: 8px 10px;
        border-radius: 8px 8px 0 0;
    }

    .pdf3-rail-title,
    .pdf3-spotlight-title {
        min-width: 120px;
        min-height: 32px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .pdf3-rail-track {
        gap: 10px;
        padding: 9px 14px 2px;
    }

    .pdf3-rail-item {
        flex-basis: 112px;
    }

    .pdf3-rail-image-wrap {
        width: 84px;
        height: 84px;
    }

    .pdf3-rail-item-title {
        min-height: 31px;
        margin-top: 6px;
        font-size: 10px;
    }

    .pdf3-spotlight-head {
        min-height: 51px;
        padding: 9px 10px;
    }
}

@media (max-width: 575.98px) {
    .pdf3-explore-grid {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pdf3-explore-grid::-webkit-scrollbar {
        display: none;
    }

    .pdf3-explore-group {
        flex: 0 0 88%;
        max-width: 360px;
        scroll-snap-align: start;
        padding: 12px 10px 10px;
    }

    .pdf3-explore-group h3 {
        font-size: 13px;
    }

    .pdf3-explore-image-wrap {
        aspect-ratio: 1.18 / 1;
    }

    .pdf3-explore-item-title {
        font-size: 10.5px;
    }

    .pdf3-product-card {
        flex-basis: 46vw;
        max-width: 188px;
        min-width: 146px;
    }
}

@media (max-width: 390px) {
    .pdf3-section-head h2,
    .pdf3-section-head-plain h2 {
        font-size: 15.5px;
    }

    .pdf3-view-all {
        padding-left: 9px;
        padding-right: 9px;
    }

    .pdf3-product-card {
        flex-basis: 47vw;
        min-width: 140px;
    }

    .pdf3-rail-item {
        flex-basis: 105px;
    }

    .pdf3-rail-image-wrap {
        width: 80px;
        height: 80px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pdf3-scroll-track {
        scroll-behavior: auto;
    }

    .pdf3-product-link,
    .pdf3-product-image,
    .pdf3-explore-group,
    .pdf3-explore-image,
    .pdf3-rail-image-wrap,
    .pdf3-rail-image,
    .pdf3-view-all {
        transition: none;
    }
}
