/*
 * PrintOnNow homepage discovery section: search box, category chips,
 * collection links and result states. The product cards reuse the theme's
 * .design-post-grid / .design-post-item styles from printonnow/style.css.
 */

.pon-discovery {
    --pon-ink: #111;
    --pon-muted: #555;
    --pon-line: #ddd;
    --pon-accent: #ff6c1a;
    --pon-surface: #fff;
    --pon-soft: #f6f6f6;

    max-width: 1400px;
    margin: 0 auto;
    /* No side padding: the theme container already has a gutter, and extra
       padding would drop the product grid to one column on phones. */
    padding: 28px 0 8px;
    box-sizing: border-box;
}

.pon-discovery [hidden] {
    display: none !important;
}

.pon-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- intro ---------- */

.pon-discovery__intro {
    max-width: 860px;
    margin: 0 auto 20px;
    text-align: center;
}

.pon-discovery__intro h1 {
    margin: 0 0 10px;
    color: var(--pon-ink);
    font-size: clamp(1.45rem, 3.2vw, 2.35rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.pon-discovery__intro p {
    margin: 0;
    color: var(--pon-muted);
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    line-height: 1.55;
    text-wrap: pretty;
}

/* ---------- search ---------- */

.pon-search {
    display: flex;
    max-width: 720px;
    margin: 0 auto 16px;
    overflow: hidden;
    background: var(--pon-surface);
    border: 2px solid var(--pon-ink);
    border-radius: 999px;
}

.pon-search:focus-within {
    border-color: var(--pon-accent);
    box-shadow: 0 0 0 3px rgba(255, 108, 26, 0.2);
}

.pon-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 14px 22px;
    color: var(--pon-ink);
    font-size: 16px;
    background: transparent;
    border: 0;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.pon-search button {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 26px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    background: var(--pon-ink);
    border: 0;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pon-search button:hover,
.pon-search button:focus-visible {
    background: var(--pon-accent);
}

/* ---------- chips ---------- */

.pon-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 1100px;
    margin: 0 auto 14px;
}

.pon-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: #222;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    background: var(--pon-surface);
    border: 1.5px solid var(--pon-line);
    border-radius: 999px;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pon-chip:hover {
    color: var(--pon-accent);
    border-color: var(--pon-accent);
}

.pon-chip:focus-visible,
.pon-collection:focus-visible,
.pon-more__button:focus-visible {
    outline: 2px solid var(--pon-accent);
    outline-offset: 2px;
}

.pon-chip.is-active,
.pon-chip.is-active:hover {
    color: #fff;
    background: var(--pon-ink);
    border-color: var(--pon-ink);
}

.pon-chip__count {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    opacity: 0.65;
}

/* ---------- status, collections, empty ---------- */

.pon-status {
    margin: 0 0 14px;
    color: var(--pon-muted);
    font-size: 14px;
    text-align: center;
}

/* Kept in the DOM (empty) so screen readers announce later updates. */
.pon-status:empty {
    margin: 0;
}

.pon-collections {
    max-width: 1100px;
    margin: 0 auto 18px;
}

.pon-collections__label {
    margin: 0 0 8px;
    color: var(--pon-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
}

.pon-collections__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pon-collection {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    padding: 10px 14px;
    color: var(--pon-ink);
    text-decoration: none;
    background: var(--pon-soft);
    border: 1.5px solid transparent;
    border-radius: 10px;
    box-sizing: border-box;
}

.pon-collection:hover {
    border-color: var(--pon-accent);
}

.pon-collection__kind {
    color: var(--pon-accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pon-collection__title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.pon-grid.design-post-grid {
    padding-top: 0;
}

/* Niche tag on featured cards, mirrors the cart button in the opposite corner. */
.pon-tag {
    position: absolute;
    top: 5%;
    left: 4%;
    z-index: 10;
    max-width: 70%;
    padding: 4px 10px;
    overflow: hidden;
    color: var(--pon-ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--pon-line);
    border-radius: 999px;
    pointer-events: none;
}

.pon-empty {
    max-width: 720px;
    margin: 8px auto 24px;
    padding: 24px 20px;
    text-align: center;
    background: var(--pon-soft);
    border-radius: 12px;
}

.pon-empty__title {
    margin: 0 0 6px;
    color: var(--pon-ink);
    font-size: 18px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.pon-empty__hint {
    margin: 0 0 14px;
    color: var(--pon-muted);
}

.pon-empty__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pon-empty__links a {
    display: inline-block;
    padding: 6px 12px;
    color: var(--pon-ink);
    font-size: 14px;
    text-decoration: none;
    background: var(--pon-surface);
    border: 1.5px solid var(--pon-line);
    border-radius: 999px;
}

.pon-empty__links a:hover {
    color: var(--pon-accent);
    border-color: var(--pon-accent);
}

/* ---------- more ---------- */

.pon-more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 24px;
    margin: 22px 0 8px;
}

.pon-more__button {
    padding: 12px 28px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    background: var(--pon-ink);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.pon-more__button:hover {
    background: var(--pon-accent);
}

.pon-more__link {
    color: var(--pon-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pon-more__link:hover {
    color: var(--pon-accent);
}

.pon-browse-categories {
    margin-top: 8px;
}

.pon-more__button[hidden] {
    display: none !important;
}

/* ---------- in-page search on category and collection pages ---------- */

.pon-archive-search-wrap {
    --pon-ink: #111;
    --pon-muted: #555;
    --pon-line: #ddd;
    --pon-accent: #ff6c1a;
    --pon-surface: #fff;

    max-width: 720px;
    margin: 12px auto 20px;
}

.pon-archive-search-wrap .pon-search {
    margin-bottom: 8px;
}

.pon-archive-status {
    min-height: 1.4em;
    margin: 0;
}

.pon-archive-status__link {
    color: var(--pon-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.pon-archive-status__link:hover {
    color: var(--pon-accent);
}

/* ---------- product cards on every page: square, filled thumbnails ---------- */

.design-post-item {
    height: auto;
}

.design-post-item .design-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f4f4f4;
    border-radius: 6px;
}

.design-post-item .design-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.design-post-item .design-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* ---------- homepage: collections grouped by their main collection ---------- */

.pon-collections-home {
    max-width: 1400px;
    margin: 32px auto 8px;
}

.pon-collection-group {
    margin: 0 0 28px;
}

.pon-collection-group__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

.pon-collection-group__head h3 {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
}

.pon-collection-group__head a {
    color: #111;
    text-decoration: none;
}

.pon-collection-group__all {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* One swipeable row per collection group (Pinterest-style browsing on phones). */
.pon-collection-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 210px);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.pon-collection-card {
    display: block;
    color: #111;
    text-decoration: none;
    scroll-snap-align: start;
}

.pon-collection-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f4f4f4;
    border-radius: 8px;
}

.pon-collection-card span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.3;
}

.pon-collection-card:hover span {
    color: #ff6c1a;
}

/* ---------- homepage colour tones: say what they are, label each colour ---------- */

.pon-colors-intro {
    max-width: 760px;
    margin: 8px auto 12px;
    color: #555;
    text-align: center;
}

.pon-colors-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 8px;
}

.colorslovers-home-page .tone-color-box {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
}

.colorslovers-home-page .tone-color-box::after {
    content: attr(title);
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 4px 6px;
    overflow: hidden;
    color: #222;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.85);
}

.colorslovers-home-page .tone-color-grid {
    gap: 8px;
}

/* ---------- product pages: matching set and similar designs ---------- */

.pon-related {
    clear: both;
    margin: 36px 0 8px;
}

.pon-related__title {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 2.6vw, 1.6rem);
    text-align: center;
}

.pon-related__intro {
    margin: 0 0 16px;
    color: #555;
    text-align: center;
}

.pon-related__grid.design-post-grid {
    padding-top: 0;
}

.pon-product-copy h2 {
    margin-top: 18px;
}

/* ---------- homepage collections ---------- */

/* The theme hides the collection group names on the homepage, which leaves
   sixteen unlabelled thumbnails; show them as section headings. */
.home .theme-grid-home-page .theme-parent h2 {
    display: block;
    margin: 36px 0 14px;
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    text-align: center;
}

.home .theme-grid-home-page .theme-parent h2 a {
    color: #111;
    text-decoration: none;
}

.home .theme-grid-home-page .theme-parent h2 a:hover {
    color: #ff6c1a;
}

.home .theme-grid-home-page .theme-parent:first-child h2 {
    margin-top: 12px;
}

/* A collection thumbnail that fails to load becomes a labelled tile. */
.theme-child.is-missing {
    background: #f6f3ee url("/static/uploads/2025/02/printonnow-logo.webp") center 38% / 46% auto no-repeat;
    border-radius: 8px;
}

.theme-child.is-missing .theme-thumbnail {
    visibility: hidden;
}

/* ---------- small screens ---------- */

@media (max-width: 768px) {
    .pon-discovery {
        padding-top: 18px;
    }

    .pon-search input[type="search"] {
        padding: 12px 16px;
    }

    .pon-search button {
        padding: 0 18px;
    }

    /* One scrollable row instead of a tall block of chips. */
    .pon-chips {
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin-right: -16px;
        margin-left: -16px;
        padding: 0 16px 6px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .pon-chips::-webkit-scrollbar {
        display: none;
    }

    .pon-collections__list {
        grid-template-columns: 1fr;
    }
}

/* Collection "Select Category" menu: the category being shown. */
.m-head-link.is-active {
    font-weight: 700;
    color: #111827;
}

/* Page heading added where a page had none (static_polish.py). */
.pon-page-head {
    width: min(1120px, calc(100% - 40px));
    margin: 18px auto 18px;
    padding: 0 10px;
}

.pon-page-head h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3.6vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* "Save & share" panel above the footer on pages without their own. */
.pon-page-share-wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto 24px;
}

.pon-page-share {
    justify-content: space-between;
}

.pon-page-share__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

/* Spam trap field of the forms: off screen, not focusable, ignored by people. */
.pon-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* Customer review images: one swipeable row instead of a tall stack on phones. */
.review-images-section .review-images-grid {
    display: flex !important;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 8px;
}

.review-images-section .review-images-card {
    flex: 0 0 auto;
    width: clamp(140px, 38vw, 200px);
    scroll-snap-align: start;
}

/* Colour swatches of a card: the same design in other colours. */
.color-filters.pon-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-left: 0;
    padding-top: 8px;
    max-height: none;
}

.color-filters .pon-swatch {
    width: 22px;
    height: 22px;
    min-width: 22px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.25);
    cursor: pointer;
}

.color-filters .pon-swatch.is-active {
    box-shadow: 0 0 0 2px #111827;
}

.color-filters .pon-swatch:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Product page: the same design in other colours. */
.pon-variants {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 14px 0 4px;
}

.pon-variants__label {
    font-weight: 600;
    color: #111827;
}

.pon-variants__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pon-variant {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.25);
}

.pon-variant.is-current {
    box-shadow: 0 0 0 2px #111827;
}

.pon-related__collection {
    width: min(1120px, calc(100% - 32px));
    margin: 24px auto 0;
    font-size: 1rem;
}

.pon-related__collection a {
    font-weight: 600;
}

/* Homepage "Shop by Collection": group tabs, then a swipeable row of collection mosaics. */
.pon-collections-home__intro {
    max-width: 640px;
    margin: -6px auto 16px;
    padding: 0 16px;
    text-align: center;
    color: #4b5563;
}

.pon-coll-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 16px 12px;
    scrollbar-width: none;
}

.pon-coll-tabs::-webkit-scrollbar {
    display: none;
}

.pon-coll-tab {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.pon-coll-tab[aria-selected="true"] {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.pon-coll-panel[hidden] {
    display: none;
}

.pon-coll-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding: 4px 16px 12px;
}

.pon-coll-card {
    flex: 0 0 auto;
    width: clamp(160px, 44vw, 220px);
    color: #111827;
    text-decoration: none;
    scroll-snap-align: start;
}

.pon-coll-card__mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 14px;
    background: #f3f4f6;
}

.pon-coll-card__mosaic img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.pon-coll-card__name {
    display: block;
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.pon-coll-card:hover .pon-coll-card__name {
    text-decoration: underline;
}

.pon-coll-all {
    display: inline-block;
    margin: 2px 16px 0;
    font-weight: 600;
}

@media (min-width: 900px) {
    .pon-coll-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Every card keeps the swatch row's height, so titles line up across a grid row. */
.design-post-item .color-filters {
    min-height: 30px;
}

/* Room between the collection rows and the section after them. */
.pon-collections-home {
    padding-bottom: 36px;
}

.pon-coll-all {
    margin-top: 10px;
}

/* Swipeable rows: no scrollbars; dots under the row show where you are
   (printonnow-site.js adds them). */
.pon-coll-row,
.review-images-section .review-images-grid,
.pon-chips {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pon-coll-row::-webkit-scrollbar,
.review-images-section .review-images-grid::-webkit-scrollbar,
.pon-chips::-webkit-scrollbar {
    display: none;
}

.pon-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 6px 0 4px;
}

.pon-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #d1d5db;
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.pon-dot.is-active {
    width: 20px;
    background: #111827;
}

/* Category sheet: opened from the "Categories" button of the bottom bar. */
.pon-cat-sheet {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(17, 24, 39, 0.45);
}

.pon-cat-sheet[hidden] {
    display: none;
}

.pon-cat-sheet__panel {
    width: 100%;
    max-width: 760px;
    max-height: 82vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 16px 104px;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.18);
}

.pon-cat-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.pon-cat-sheet__close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #111827;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.pon-cat-sheet .section-main-slider {
    margin: 0;
}

html.pon-sheet-open,
html.pon-sheet-open body {
    overflow: hidden;
}

/* The "Categories" icon of the bottom bar: four small tiles. */
.pon-cat-icon {
    display: grid;
    grid-template-columns: repeat(2, 9px);
    gap: 3px;
    width: 21px;
    height: 21px;
    margin: 0 auto 2px;
}

.pon-cat-icon i {
    display: block;
    border-radius: 3px;
    background: #111827;
}

/* Product page: the design series the product belongs to. */
.pon-product-collection {
    margin: 12px 0 0;
    font-size: 0.98rem;
}

.pon-product-collection a {
    font-weight: 600;
}
