/* Public site — Public/search-gallery.php. Shared styles: assets/css/site.css */

.gallery-hero { text-align: center; max-width: 760px; margin: 8px auto 26px; }
.gallery-hero .page-title { margin-inline: auto; max-width: 22ch; }
.gallery-hero .page-subtitle { margin-inline: auto; }

.search-box { position: relative; margin-top: 22px; }
.search-box i.fa-magnifying-glass { position: absolute; top: 50%; inset-inline-start: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input {
    width: 100%; font: inherit; font-size: 1.02rem; color: var(--ink);
    padding: 16px 52px; border: 1px solid var(--line); border-radius: 999px;
    background: #fff; box-shadow: 0 10px 30px rgba(23, 23, 23, 0.06);
    transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear {
    position: absolute; top: 50%; inset-inline-end: 12px; transform: translateY(-50%);
    border: 0; background: var(--sand); color: var(--ink); border-radius: 999px;
    padding: 6px 12px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.search-clear[hidden] { display: none; }

.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.result-count { color: var(--muted); font-size: .9rem; font-weight: 600; white-space: nowrap; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

.product-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 8px 24px rgba(23, 23, 23, 0.05);
    transition: transform .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(23, 23, 23, 0.1); }

.product-media { aspect-ratio: 4 / 3; position: relative; display: grid; place-items: center; overflow: hidden; }
/* the one picture shape of the factory (Admin → Settings → General; the pictures are cropped to it) */
.gallery-grid[data-ratio="1/1"] .product-media { aspect-ratio: 1 / 1; }
.gallery-grid[data-ratio="3/4"] .product-media { aspect-ratio: 3 / 4; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
/* a picture that opens the gallery */
button.product-media { border: 0; padding: 0; margin: 0; width: 100%; background: var(--sand); cursor: zoom-in; font: inherit; }
button.product-media:hover img { transform: scale(1.04); }
button.product-media:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.product-photos { position: absolute; inset-block-end: 10px; inset-inline-end: 10px; display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px; background: rgba(23, 23, 23, .72); color: #fff; font-size: .75rem; font-weight: 700; }
.product-media .product-photos i { font-size: .8rem; color: #fff; }   /* not the 2.6rem of the placeholder icon */
.product-photos { line-height: 1.2; }
.product-media i { font-size: 2.6rem; color: rgba(255, 255, 255, 0.92); }
.tone-blue   { background: linear-gradient(145deg, #0f3d78, var(--color-primary) 70%, #78a9ff); }
.tone-sand   { background: linear-gradient(145deg, #8a6a45, #c8a57c 70%, #e6d3b8); }
.tone-slate  { background: linear-gradient(145deg, #1d2430, #475569 70%, #94a3b8); }
.tone-copper { background: linear-gradient(145deg, #6c3418, var(--copper) 70%, #ddb08a); }

.product-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.product-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; margin: 0; color: var(--ink); }
.product-copy {
    color: var(--muted); font-size: .9rem; line-height: 1.55; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.product-tags span { background: var(--sand); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 600; }
.product-footer { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.product-price small { display: block; color: var(--muted); font-size: .72rem; font-weight: 600; }
.product-price strong { font-size: 1.1rem; color: var(--ink); unicode-bidi: isolate; direction: ltr; display: inline-block; }

.btn-solid, .btn-ghost { padding: 10px 16px; font-size: .9rem; } /* base: site.css */
.btn-solid:hover { background: var(--color-primary-hover); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.gallery-empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.gallery-empty[hidden] { display: none; }
.gallery-empty i { font-size: 2rem; color: var(--muted); margin-bottom: 12px; }
.gallery-empty h2 { font-size: 1.15rem; margin: 0 0 6px; }
.gallery-empty p { color: var(--muted); margin: 0 0 16px; }

.section-title { font-size: 1.3rem; margin: 44px 0 16px; }
.service-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.service-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.service-tile i { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.service-tile strong { display: block; margin-bottom: 6px; font-size: 1.02rem; }
.service-tile p { color: var(--muted); margin: 0; font-size: .92rem; }

.cta-strip {
    margin-top: 36px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover)); color: #fff; border-radius: var(--radius-xl); padding: 28px;
}
.cta-strip h2 { margin: 0 0 6px; font-size: 1.3rem; }
.cta-strip p { margin: 0; color: rgba(255, 255, 255, 0.85); }
.cta-strip .btn-solid { background: #fff; color: var(--color-primary-hover); }
.cta-strip .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 900px) { .service-strip { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
    /* two cards side by side on phones: the pictures have one shape, so the rows stay even */
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .product-body { padding: 12px; gap: 6px; }
    .product-title { font-size: .95rem; }
    .product-copy, .product-tags { display: none; }
    .product-footer { flex-direction: column; align-items: stretch; gap: 8px; }
    .product-footer .btn-solid { justify-content: center; min-height: 44px; padding: 10px; font-size: .85rem; }
    .search-box input { padding: 14px 46px; }
    .cta-strip { padding: 22px; }
}

/* ── The gallery window (assets/js/product-gallery.js) ─────────────────────────────── */
html.pg-open { overflow: hidden; }
.pg { border: 0; padding: 0; margin: auto; width: min(1120px, 96vw); max-height: 94vh; background: transparent; color: var(--ink); overflow: visible; }
.pg::backdrop { background: rgba(10, 12, 16, .82); }
.pg-box { background: #fff; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 94vh; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pg-title { margin: 0; font-size: 1.1rem; line-height: 1.35; }
.pg-close { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: var(--sand); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.pg-close:hover { background: var(--accent-soft); color: var(--accent); }
.pg-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); min-height: 0; overflow: auto; }
.pg-media { background: #f4f4f2; display: flex; flex-direction: column; min-width: 0; }
.pg-stage { position: relative; flex: 1; min-height: 320px; max-height: 70vh; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; user-select: none; cursor: zoom-in; }
.pg-img { max-width: 100%; max-height: 70vh; object-fit: contain; display: block; transition: transform .25s; }
.pg-stage.is-zoomed { cursor: zoom-out; touch-action: none; }
.pg-stage.is-zoomed .pg-img { transform: scale(2.2); }
.pg-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); cursor: pointer; font-size: 1rem; }
.pg-nav:hover { background: #fff; color: var(--accent); }
.pg-prev { inset-inline-start: 12px; }
.pg-next { inset-inline-end: 12px; }
.pg-nav[hidden], .pg-count[hidden], .pg-thumbs[hidden], .pg-price[hidden], .pg-text[hidden] { display: none; }
.pg-stage.is-zoomed .pg-nav { opacity: 0; pointer-events: none; }
.pg-count { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(23, 23, 23, .7); color: #fff; font-size: .8rem; font-weight: 700; unicode-bidi: isolate; }
.pg-thumbs { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; border-top: 1px solid var(--line); background: #fff; }
.pg-thumb { flex: none; width: 76px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--sand); cursor: pointer; opacity: .7; }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-thumb.is-active, .pg-thumb:hover { border-color: var(--accent); opacity: 1; }
.pg-thumb:focus-visible, .pg-nav:focus-visible, .pg-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pg-side { padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.pg-price { margin: 0; font-size: 1.3rem; font-weight: 800; }
.pg-text { margin: 0; color: var(--muted); line-height: 1.7; white-space: pre-line; }
.pg-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pg-tags span { background: var(--sand); border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 600; }
.pg-quote { margin-top: auto; justify-content: center; min-height: 48px; }
@media (max-width: 820px) {
    .pg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; }
    .pg-box { border-radius: 0; height: 100dvh; max-height: 100dvh; }
    .pg-main { grid-template-columns: 1fr; }
    .pg-stage { min-height: 0; max-height: none; aspect-ratio: 4 / 3; flex: none; }
    .pg-img { max-height: 100%; }
    .pg-side { padding: 16px; }
    .pg-quote { position: sticky; bottom: 0; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .pg-img, .product-media img { transition: none; } }
