/*
 * PDF storefront - Phase 2
 * Scope: homepage category discovery + Quick Deal only.
 * The existing header/navigation is intentionally untouched.
 */

.pdf2-category-section,
.pdf2-quick-deal-section {
    background: #fff;
}

.pdf2-category-section {
    /* Give each homepage block more breathing room without changing its inner layout. */
    padding: 16px 0 10px;
}

.pdf2-quick-deal-section {
    /* Creates a clear visual gap after Shop By Category. */
    padding: 10px 0 28px;
}

.pdf2-section-container {
    position: relative;
}

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

.pdf2-scroll-track {
    display: flex;
    width: 100%;
    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;
    touch-action: manipulation;
}

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

.pdf2-scroll-track:focus-visible {
    outline: 2px solid #2f86c8;
    outline-offset: 3px;
    border-radius: 4px;
}

.pdf2-scroll-btn {
    position: absolute;
    top: 50%;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 54px;
    padding: 0;
    border: 1px solid #e1e5e8;
    border-radius: 4px;
    background: rgba(255, 255, 255, .97);
    color: #263746;
    box-shadow: 0 2px 8px rgba(24, 43, 58, .12);
    transform: translateY(-50%);
    transition: opacity .18s ease, box-shadow .18s ease, color .18s ease;
}

.pdf2-scroll-btn:hover:not(:disabled),
.pdf2-scroll-btn:focus-visible:not(:disabled) {
    color: #1678b8;
    box-shadow: 0 4px 12px rgba(24, 43, 58, .18);
}

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

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

.pdf2-scroll-prev {
    left: -6px;
}

.pdf2-scroll-next {
    right: -6px;
}

/* ---------- Shop By Category ---------- */
.pdf2-category-panel {
    overflow: hidden;
    border: 1px solid #e4e8ec;
    border-radius: 3px;
    background: #fbfcfd;
}

.pdf2-section-heading {
    padding: 11px 18px 7px;
}

.pdf2-section-heading h2 {
    margin: 0;
    color: #171d24;
    font-family: inherit;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    text-transform: none;
}

.pdf2-category-shell {
    padding: 5px 15px 13px;
}

.pdf2-category-track {
    justify-content: center;
    gap: 12px;
    padding: 3px 1px 4px;
}

/*
 * Category items stay centered before the carousel starts.
 * JavaScript switches to a seamless repeated track for automatic movement.
 */
.pdf2-category-track.is-auto-carousel {
    justify-content: flex-start;
    scroll-behavior: auto;
    scroll-snap-type: none;
}

.pdf2-category-track.is-auto-carousel .pdf2-category-item {
    will-change: transform;
}

.pdf2-category-item {
    flex: 0 0 105px;
    min-width: 0;
    color: #1d2730;
    text-align: center;
    text-decoration: none;
    scroll-snap-align: start;
}

.pdf2-category-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / .78;
    overflow: hidden;
    border: 1px solid #edf0f2;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(20, 38, 52, .05);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.pdf2-category-item:hover .pdf2-category-image-wrap,
.pdf2-category-item:focus-visible .pdf2-category-image-wrap {
    border-color: #bfd7e8;
    box-shadow: 0 5px 14px rgba(31, 73, 102, .11);
    transform: translateY(-1px);
}

.pdf2-category-item:focus-visible {
    outline: none;
}

.pdf2-category-image {
    display: block;
    width: 100%;
    height: 100%;
    padding: 7px;
    object-fit: contain;
    object-position: center;
}

.pdf2-category-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #87939c;
    font-size: 28px;
}

.pdf2-category-name {
    display: -webkit-box;
    min-height: 30px;
    margin-top: 7px;
    overflow: hidden;
    color: #28343e;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ---------- Quick Deal ---------- */
.pdf2-quick-deal-panel {
    overflow: hidden;
    border: 1px solid #2e83c4;
    border-radius: 2px;
    background: #fff;
}

.pdf2-quick-deal-titlebar {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 7px 14px;
    background: #3185c5;
}

.pdf2-quick-deal-titlebar h2 {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
}

.pdf2-quick-deal-titlebar h2 span {
    display: inline-block;
    margin-left: 2px;
    font-size: 16px;
}

.pdf2-deal-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    border-bottom: 1px solid #e3e7ea;
    background: #fff;
    scrollbar-width: none;
}

.pdf2-deal-tabs::-webkit-scrollbar {
    display: none;
}

.pdf2-deal-tab {
    flex: 0 0 auto;
    min-height: 35px;
    padding: 7px 13px;
    border: 0;
    border-right: 1px solid #edf0f2;
    background: #fff;
    color: #24313c;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.pdf2-deal-tab:hover,
.pdf2-deal-tab:focus-visible {
    background: #e7f3fb;
    color: #176fa9;
}

/* The selected Quick Deal tab keeps a strong active color until another tab is chosen. */
.pdf2-deal-tab.is-active,
.pdf2-deal-tab.is-active:hover,
.pdf2-deal-tab.is-active:focus-visible {
    background: #176fa9;
    color: #fff;
    box-shadow: inset 0 3px 0 #0f5f93;
}

.pdf2-deal-tab:focus-visible {
    outline: 2px solid #2f86c8;
    outline-offset: -2px;
}

.pdf2-deal-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 205px;
    padding: 28px 18px;
    color: #6f7c86;
    font-size: 13px;
    text-align: center;
    background: #fff;
}

.pdf2-deal-empty-icon {
    color: #3185c5;
    font-size: 18px;
}

.pdf2-deal-panel[hidden] {
    display: none !important;
}

.pdf2-product-shell {
    padding: 12px 22px 14px;
}

.pdf2-product-track {
    gap: 14px;
    padding: 1px 1px 3px;
}

/* ---------- PDF-style product card ---------- */
.pdf2-product-card {
    flex: 0 0 164px;
    min-width: 0;
    margin: 0;
    scroll-snap-align: start;
}

.pdf2-product-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.pdf2-product-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 3px;
    background: #fff;
}

.pdf2-product-image {
    display: block;
    width: 100%;
    height: 100%;
    padding: 5px;
    object-fit: contain;
    object-position: center;
    transition: transform .2s ease;
}

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

.pdf2-product-link:focus-visible {
    outline: 2px solid #2f86c8;
    outline-offset: 2px;
    border-radius: 4px;
}

.pdf2-deal-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 5px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ef3747;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    box-shadow: 0 1px 5px rgba(57, 15, 20, .18);
}

.pdf2-deal-badge-wide {
    min-width: auto;
    min-height: 25px;
    padding: 5px 7px;
    border-radius: 14px;
    font-size: 8px;
    letter-spacing: .1px;
}

.pdf2-product-info {
    display: block;
    padding: 6px 3px 0;
    text-align: center;
}

.pdf2-product-name {
    display: -webkit-box;
    min-height: 31px;
    overflow: hidden;
    color: #303840;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pdf2-price-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-top: 3px;
    white-space: nowrap;
}

.pdf2-price-row strong {
    color: #1682bf;
    font-size: 13px;
    font-weight: 700;
}

.pdf2-price-row del {
    color: #747e86;
    font-size: 9px;
    font-weight: 500;
}

.pdf2-stock-text {
    display: block;
    min-height: 15px;
    margin-top: 2px;
    color: #8a9197;
    font-size: 8.5px;
    font-weight: 500;
    line-height: 1.25;
}

@media (min-width: 1200px) {
    .pdf2-category-item {
        flex-basis: 108px;
    }

    .pdf2-product-card {
        flex-basis: 172px;
    }
}

@media (max-width: 767.98px) {
    .pdf2-category-section {
        padding-top: 12px;
        padding-bottom: 8px;
    }

    .pdf2-quick-deal-section {
        padding-top: 8px;
        padding-bottom: 20px;
    }

    .pdf2-category-panel,
    .pdf2-quick-deal-panel {
        border-radius: 3px;
    }

    .pdf2-section-heading {
        padding: 10px 12px 6px;
    }

    .pdf2-section-heading h2,
    .pdf2-quick-deal-titlebar h2 {
        font-size: 15px;
    }

    .pdf2-category-shell {
        padding: 4px 9px 11px;
    }

    .pdf2-category-track {
        gap: 8px;
    }

    .pdf2-category-item {
        flex-basis: 88px;
    }

    .pdf2-category-name {
        font-size: 10px;
    }

    .pdf2-scroll-btn {
        width: 29px;
        height: 46px;
    }

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

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

    .pdf2-quick-deal-titlebar {
        min-height: 37px;
        padding: 7px 11px;
    }

    .pdf2-deal-tab {
        min-height: 34px;
        padding: 7px 11px;
        font-size: 10px;
    }

    .pdf2-product-shell {
        padding: 10px 12px 12px;
    }

    .pdf2-product-track {
        gap: 9px;
    }

    .pdf2-product-card {
        flex-basis: 136px;
    }

    .pdf2-product-name {
        min-height: 29px;
        font-size: 10px;
    }

    .pdf2-price-row strong {
        font-size: 12px;
    }

    .pdf2-deal-badge {
        min-width: 34px;
        min-height: 34px;
        font-size: 9px;
    }

    .pdf2-deal-badge-wide {
        min-width: auto;
        min-height: 23px;
        font-size: 7px;
    }
}

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

    .pdf2-category-image-wrap,
    .pdf2-product-image {
        transition: none;
    }
}
