/*
 * Explore by Products — isolated visual refinement for Theme 2 homepage.
 * Loaded after the existing homepage CSS so these rules affect this section only.
 */

.phase1-home .pdf3-explore-section {
    --explore-navy: #16304d;
    --explore-ink: #172b3a;
    --explore-muted: #536272;
    --explore-border: #e4eaf0;
    --explore-image-bg: #f5f7f9;
}

.phase1-home .pdf3-explore-section .pdf3-explore-card {
    overflow: hidden;
    padding: 0 16px 18px !important;
    border: 1px solid #e4e9ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(22, 43, 62, .065);
}

/* Preserve the existing navy heading identity and centered underline. */
.phase1-home .pdf3-explore-section .pdf3-section-head {
    min-height: 72px;
    margin: 0 -16px 18px !important;
    padding: 17px 18px 14px !important;
    border: 0;
    border-radius: 12px 12px 0 0;
    background: var(--explore-navy) !important;
}

.phase1-home .pdf3-explore-section .pdf3-section-head h2 {
    width: 100%;
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(19px, 1.55vw, 22px) !important;
    font-weight: 750 !important;
    letter-spacing: .025em !important;
    line-height: 1.25;
    text-align: center !important;
}

.phase1-home .pdf3-explore-section .pdf3-section-head h2::after {
    display: block !important;
    width: 54px !important;
    height: 3px !important;
    margin: 9px auto 0 !important;
    border-radius: 3px;
    background: rgba(255, 255, 255, .9) !important;
    content: "" !important;
}

.phase1-home .pdf3-explore-section .pdf3-section-head h2::before {
    display: none !important;
    content: none !important;
}

.phase1-home .pdf3-explore-mobile-hint {
    display: none;
}

/* Four balanced cards on desktop; no horizontal overflow at desktop widths. */
.phase1-home .pdf3-explore-section .pdf3-explore-grid {
    display: grid !important;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 16px !important;
    overflow: visible !important;
    padding: 0 2px 2px !important;
    scroll-snap-type: none !important;
}

.phase1-home .pdf3-explore-section .pdf3-explore-group {
    display: flex !important;
    min-width: 0;
    min-height: 100%;
    flex-direction: column !important;
    align-self: stretch !important;
    padding: 15px 13px 13px !important;
    border: 1px solid var(--explore-border) !important;
    border-radius: 13px !important;
    background: #fff !important;
    box-shadow: 0 3px 12px rgba(22, 43, 62, .055) !important;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.phase1-home .pdf3-explore-section .pdf3-explore-group:hover {
    border-color: #d2dde7 !important;
    box-shadow: 0 8px 20px rgba(22, 43, 62, .09) !important;
    transform: translateY(-2px);
}

.phase1-home .pdf3-explore-section .pdf3-explore-group h3 {
    display: -webkit-box;
    min-height: 38px;
    margin: 0 0 12px !important;
    overflow: hidden;
    color: var(--explore-ink) !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
    text-overflow: ellipsis;
    white-space: normal !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.phase1-home .pdf3-explore-section .pdf3-explore-items {
    display: grid !important;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-content: start;
    gap: 14px 11px !important;
}

.phase1-home .pdf3-explore-section .pdf3-explore-item {
    display: flex !important;
    min-width: 0;
    flex-direction: column !important;
    align-items: stretch;
    color: inherit !important;
    text-align: left !important;
    text-decoration: none !important;
}

/* Every product gets the same square canvas. The image itself is never cropped. */
.phase1-home .pdf3-explore-section .pdf3-explore-image-wrap {
    position: relative;
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    flex: 0 0 auto;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden;
    border: 1px solid #edf0f3;
    border-radius: 10px !important;
    background: var(--explore-image-bg) !important;
}

.phase1-home .pdf3-explore-section .pdf3-explore-item:nth-child(n) .pdf3-explore-image-wrap {
    background: var(--explore-image-bg) !important;
}

.phase1-home .pdf3-explore-section .pdf3-explore-image-wrap picture {
    display: contents !important;
}

.phase1-home .pdf3-explore-section .pdf3-explore-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    padding: 8px !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
    transition: none !important;
}

.phase1-home .pdf3-explore-section .pdf3-explore-item:hover .pdf3-explore-image,
.phase1-home .pdf3-explore-section .pdf3-explore-item:focus-visible .pdf3-explore-image {
    transform: none !important;
}

.phase1-home .pdf3-explore-section .pdf3-explore-item-title {
    display: -webkit-box !important;
    min-height: 34px;
    margin: 7px 0 0 !important;
    overflow: hidden;
    color: #344454 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-align: left !important;
    text-overflow: ellipsis;
    white-space: normal !important;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Two-product categories use a roomy stacked presentation on larger screens,
   avoiding a short row followed by a large unused blank area. */
@media (min-width: 576px) {
    .phase1-home .pdf3-explore-section .pdf3-explore-group[data-item-count="2"] .pdf3-explore-items {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-group[data-item-count="2"] .pdf3-explore-item {
        display: grid !important;
        grid-template-columns: clamp(108px, 9.5vw, 132px) minmax(0, 1fr);
        align-items: center;
        gap: 12px;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-group[data-item-count="2"] .pdf3-explore-image-wrap {
        width: clamp(108px, 9.5vw, 132px) !important;
        aspect-ratio: 1 / 1 !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-group[data-item-count="2"] .pdf3-explore-item-title {
        min-height: 0;
        margin: 0 !important;
    }
}

.phase1-home .pdf3-explore-section .pdf3-explore-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 15px;
}

.phase1-home .pdf3-explore-section .pdf3-see-more {
    display: inline-flex !important;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 !important;
    padding: 9px 18px !important;
    border: 1px solid var(--explore-navy) !important;
    border-radius: 8px !important;
    background: var(--explore-navy) !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(22, 48, 77, .14);
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.2;
    text-decoration: none !important;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.phase1-home .pdf3-explore-section .pdf3-see-more:hover,
.phase1-home .pdf3-explore-section .pdf3-see-more:focus-visible {
    border-color: #0f2036 !important;
    background: #0f2036 !important;
    color: #fff !important;
    box-shadow: 0 5px 12px rgba(22, 48, 77, .2);
    transform: translateY(-1px);
    outline: none;
}

.phase1-home .pdf3-explore-section .pdf3-explore-grid:focus-visible {
    outline: 3px solid rgba(216, 165, 54, .8);
    outline-offset: 4px;
}

/* Tablet: two comfortable columns instead of squeezing four category cards. */
@media (min-width: 576px) and (max-width: 1199.98px) {
    .phase1-home .pdf3-explore-section .pdf3-explore-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-group {
        padding: 15px !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-image-wrap {
        max-height: none;
    }
}

/* Mobile: swipeable category cards, with the next card intentionally peeking in. */
@media (max-width: 575.98px) {
    .phase1-home .pdf3-explore-section {
        padding-block: 10px 12px;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-card {
        padding: 0 0 12px !important;
        border-radius: 13px;
    }

    .phase1-home .pdf3-explore-section .pdf3-section-head {
        min-height: 54px;
        margin: 0 0 8px !important;
        padding: 14px 12px 11px !important;
        border-radius: 12px 12px 0 0;
    }

    .phase1-home .pdf3-explore-section .pdf3-section-head h2 {
        font-size: 16px !important;
        letter-spacing: .02em !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-section-head h2::after {
        width: 42px !important;
        height: 2px !important;
        margin-top: 7px !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-mobile-hint {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 7px;
        padding: 0 15px 8px;
        color: #718091;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .015em;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-mobile-hint-arrow {
        color: var(--explore-navy);
        font-size: 15px;
        line-height: 1;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-grid {
        display: flex !important;
        width: 100% !important;
        gap: 12px !important;
        padding: 2px 13px 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-padding-inline: 13px;
        scroll-snap-type: x mandatory !important;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        touch-action: pan-x pan-y !important;
    }

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

    .phase1-home .pdf3-explore-section .pdf3-explore-group {
        flex: 0 0 calc(100% - 34px) !important;
        width: calc(100% - 34px) !important;
        max-width: 380px !important;
        min-width: 0 !important;
        min-height: 0;
        padding: 13px !important;
        scroll-snap-align: start;
        border: 1px solid #e2e9ef !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: 0 4px 13px rgba(22, 43, 62, .065) !important;
        transform: none !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-group h3 {
        min-height: 0;
        margin: 0 0 11px !important;
        padding: 0 0 9px;
        border-bottom: 1px solid #edf1f4;
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-items,
    .phase1-home .pdf3-explore-section .pdf3-explore-group[data-item-count="2"] .pdf3-explore-items {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px 10px !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-group[data-item-count="2"] .pdf3-explore-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch;
        gap: 0;
        text-align: left;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-image-wrap,
    .phase1-home .pdf3-explore-section .pdf3-explore-group[data-item-count="2"] .pdf3-explore-image-wrap {
        width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 9px !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-image {
        padding: 7px !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-item-title,
    .phase1-home .pdf3-explore-section .pdf3-explore-group[data-item-count="2"] .pdf3-explore-item-title {
        min-height: 34px;
        margin: 6px 0 0 !important;
        font-size: 11.5px !important;
        line-height: 1.35 !important;
    }

    .phase1-home .pdf3-explore-section .pdf3-explore-footer {
        margin-top: 12px;
        padding-top: 0;
    }

    .phase1-home .pdf3-explore-section .pdf3-see-more {
        min-height: 38px;
        padding: 8px 15px !important;
        font-size: 11.5px !important;
    }
}

@media (max-width: 359.98px) {
    .phase1-home .pdf3-explore-section .pdf3-explore-group {
        flex-basis: calc(100% - 28px) !important;
        width: calc(100% - 28px) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .phase1-home .pdf3-explore-section .pdf3-explore-group,
    .phase1-home .pdf3-explore-section .pdf3-see-more {
        transition: none !important;
    }
}
