/* StrojeKapielowe.net - "pool side": deep water ink, pool-tile teal, foam white,
   one sun-yellow accent reserved for the cheapest offer. */

:root {
    --ink: #0e2a3b;
    --ink-soft: #45606e;
    --pool: #137c93;
    --pool-deep: #0b4f63;
    --foam: #f3f8f9;
    --white: #ffffff;
    --line: #d3e4e8;
    --sun: #ffc24b;
    --coral: #c8363d;

    --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --text: "Figtree", "Segoe UI", system-ui, sans-serif;

    --wrap: 1240px;
    --gutter: clamp(16px, 3vw, 32px);
    --radius-photo: 18px;
    --radius-control: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--foam);
    color: var(--ink);
    font: 400 1rem/1.55 var(--text);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--pool-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--pool); }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.01em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.65rem); font-weight: 700; }

.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;
}

.skip-link { position: absolute; left: 8px; top: 0; transform: translateY(-120%); background: var(--sun); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip-link:focus { transform: translateY(8px); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.button {
    display: inline-block; padding: 0.7em 1.3em; border-radius: var(--radius-control);
    background: var(--pool-deep); color: var(--white); font-weight: 600; text-decoration: none; text-align: center;
}
.button:hover { background: var(--pool); color: var(--white); }
.button-quiet { background: var(--white); color: var(--pool-deep); border: 1px solid var(--line); margin: 0 0.4em 0.5em 0; }
.button-quiet:hover { background: var(--foam); color: var(--pool-deep); }

/* Header ---------------------------------------------------------------- */

.site-header { background: var(--pool-deep); color: var(--white); }

.header-row { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 10px; flex-wrap: wrap; }

.wordmark {
    font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: -0.03em;
    color: var(--white); text-decoration: none; white-space: nowrap; margin: 0;
}
.wordmark span { color: var(--sun); }
.wordmark small { font-size: 0.6em; font-weight: 500; opacity: 0.75; margin-left: 1px; }
.wordmark:hover { color: var(--white); }

.search { display: flex; flex: 1 1 320px; max-width: 560px; margin-left: auto; }
.search input {
    flex: 1; min-width: 0; border: 0; border-radius: var(--radius-control) 0 0 var(--radius-control);
    padding: 0.65em 1.1em; font: inherit; color: var(--ink); background: var(--white);
}
.search button {
    border: 0; border-radius: 0 var(--radius-control) var(--radius-control) 0; padding: 0 1.2em;
    font: 600 0.95rem var(--text); background: var(--sun); color: var(--ink); cursor: pointer;
}

.main-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    color: var(--white); text-decoration: none; white-space: nowrap; padding: 0.35em 0.9em;
    border-radius: var(--radius-control); font-weight: 500;
}
.main-nav a:hover { background: rgba(255, 255, 255, 0.12); color: var(--white); }
.main-nav a.is-active { background: var(--white); color: var(--pool-deep); }

/* Home: the waterline --------------------------------------------------- */

.hero { background: var(--pool-deep); color: var(--white); position: relative; padding-bottom: 150px; }
.hero-text { padding-top: clamp(28px, 6vw, 72px); }
.hero h1 { font-size: clamp(2.2rem, 6.2vw, 4.6rem); max-width: 14ch; line-height: 1.02; letter-spacing: -0.03em; }
.hero p { max-width: 56ch; font-size: 1.1rem; color: #cfe6ec; margin: 0; }

.waterline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 80px; fill: var(--foam); }

/* The tiles sit half above, half below the waterline. */
.tiles { margin-top: -140px; position: relative; }
.tiles ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tiles a { display: block; text-decoration: none; color: var(--ink); }
.tiles img {
    aspect-ratio: 4 / 5; object-fit: cover; width: 100%; border-radius: var(--radius-photo);
    background: var(--white); box-shadow: 0 18px 40px -24px rgba(14, 42, 59, 0.55);
}
.tile-name { display: block; font: 700 1.3rem/1.15 var(--display); margin-top: 12px; }
.tile-lead { display: block; color: var(--ink-soft); font-size: 0.93rem; margin-top: 4px; }
.tiles a:hover .tile-name { color: var(--pool); }

/* Blocks ---------------------------------------------------------------- */

.block { margin-top: clamp(40px, 6vw, 64px); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.block-head h2 { margin: 0; }
.block-head a { font-weight: 600; }

.prose { max-width: 70ch; }
.prose p { margin: 0 0 1em; }
.prose img { border-radius: var(--radius-photo); margin: 1em 0; }
.prose h2, .prose h3 { margin-top: 1.4em; }

/* Product grid ---------------------------------------------------------- */

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 28px 18px; }

.card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); }
.card-photo { display: block; border-radius: var(--radius-photo); overflow: hidden; background: var(--white); }
.card-photo img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.card-name {
    margin-top: 10px; font-size: 0.92rem; color: var(--ink-soft);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-price { margin-top: auto; padding-top: 4px; font-weight: 700; font-size: 1.05rem; }
.card-from { font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); }
.card a:hover .card-name { color: var(--pool-deep); text-decoration: underline; }

/* Brands ---------------------------------------------------------------- */

.brand-cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.brand-cloud a {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 0.45em 1em; border-radius: var(--radius-control);
    background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600;
}
.brand-cloud a:hover { border-color: var(--pool); color: var(--pool-deep); }
.brand-cloud span { font-weight: 400; font-size: 0.8rem; color: var(--ink-soft); }

.brand-index { columns: 4 220px; column-gap: 32px; }
.brand-index section { break-inside: avoid; margin-bottom: 24px; }
.brand-index h2 { font-size: 1.6rem; color: var(--pool); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.brand-index ul { list-style: none; margin: 0; padding: 0; }
.brand-index li { padding: 2px 0; }
.brand-index li span { color: var(--ink-soft); font-size: 0.85rem; }

/* Articles -------------------------------------------------------------- */

.articles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px 20px; }
.articles a { display: block; text-decoration: none; color: var(--ink); }
.articles img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-photo); background: var(--line); }
.article-title { display: block; font: 700 1.12rem/1.25 var(--display); margin-top: 10px; }
.articles time { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-top: 4px; }
.articles a:hover .article-title { color: var(--pool); }

.article { max-width: 820px; }
.article-meta { color: var(--ink-soft); margin-top: -0.3em; }
.article-cover { width: 100%; border-radius: var(--radius-photo); margin: 8px 0 28px; }

/* Listing --------------------------------------------------------------- */

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 20px; font-size: 0.9rem; }
.crumbs a { color: var(--ink-soft); }
.crumbs a + a::before { content: "/"; color: var(--line); margin-right: 6px; display: inline-block; text-decoration: none; }

.listing-head { padding-bottom: 8px; }
.listing-head h1 { margin: 12px 0 4px; }
.listing-count { color: var(--ink-soft); margin: 0; }

.listing { display: grid; grid-template-columns: 250px 1fr; gap: 36px; margin-top: 24px; align-items: start; }

.filters { position: sticky; top: 16px; }
.filters summary { display: none; }
.filters fieldset { border: 0; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.filters legend { font: 700 1rem var(--display); margin-bottom: 6px; padding: 0; }
.filters fieldset a { color: var(--ink); text-decoration: none; padding: 3px 10px; margin-left: -10px; border-radius: var(--radius-control); }
.filters fieldset a:hover { background: var(--white); color: var(--pool-deep); }
.filters fieldset a.is-on { background: var(--pool-deep); color: var(--white); font-weight: 600; }
.filter-brands { max-height: 420px; overflow-y: auto; flex-wrap: nowrap; }

.filter-search { margin-bottom: 24px; }
.filter-search label { display: block; font: 700 1rem var(--display); margin-bottom: 6px; }
.filter-search-row { display: flex; gap: 6px; }
.filter-search input { flex: 1; min-width: 0; font: inherit; padding: 0.45em 0.8em; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }
.filter-search button { font: 600 0.9rem var(--text); border: 0; border-radius: 10px; padding: 0 0.9em; background: var(--pool-deep); color: var(--white); cursor: pointer; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.active-filters a { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 0.3em 0.9em; color: var(--ink); text-decoration: none; font-weight: 500; }
.active-filters a span { color: var(--coral); margin-left: 4px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 40px; flex-wrap: wrap; }
.pager a { padding: 0.6em 1.2em; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--white); text-decoration: none; font-weight: 600; }
.pager a.pager-next { background: var(--pool-deep); border-color: var(--pool-deep); color: var(--white); }
.pager span { color: var(--ink-soft); }

.empty { padding: 32px 0; }
.empty h1, .empty h2 { margin-bottom: 0.4em; }

.listing-about { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-soft); }

/* Product --------------------------------------------------------------- */

.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: 18px; align-items: start; }

.gallery-main { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--white); border-radius: var(--radius-photo); }
.gallery-thumbs { list-style: none; margin: 12px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 12px; background: var(--white); cursor: pointer; overflow: hidden; }
.gallery-thumbs button[aria-pressed="true"] { border-color: var(--pool); }
.gallery-thumbs img { width: 72px; height: 72px; object-fit: contain; }

.product-brand { font: 700 1rem var(--display); color: var(--pool); text-decoration: none; }
.product-info h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: 6px; }
.product-price { font: 800 1.9rem var(--display); margin: 0 0 20px; }
.product-price span { font: 400 1rem var(--text); color: var(--ink-soft); }

.facts { margin-bottom: 16px; }
.facts h2, .offers h2, .product-description h2 { font-size: 1.05rem; margin-bottom: 8px; }
.facts p { margin: 0; }
.sizes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sizes li { min-width: 42px; text-align: center; padding: 0.25em 0.6em; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-weight: 600; font-size: 0.9rem; }

.offers { margin-top: 28px; }
.offers ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.offer {
    display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
    background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.offer.is-cheapest { border: 2px solid var(--sun); }
.offer-shop strong { display: block; }
.badge-sun { display: inline-block; margin-top: 2px; background: var(--sun); color: var(--ink); font-size: 0.78rem; font-weight: 700; padding: 0.1em 0.6em; border-radius: var(--radius-control); }
.offer-price { text-align: right; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.offer-price .is-sale { color: var(--coral); }
.offer-price s { display: block; font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); }
.offers-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 10px; }

.product-description { margin-top: 28px; }

/* Footer ---------------------------------------------------------------- */

.site-footer { margin-top: 80px; background: var(--ink); color: #c4d4db; padding: 40px 0 28px; }
.site-footer a { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 48px; }
.footer-grid p { max-width: 60ch; margin: 0 0 0.8em; }
.footer-grid nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; align-content: start; }
.wordmark-small { font-size: 1.3rem; }
.footer-note { grid-column: 1 / -1; font-size: 0.85rem; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 18px; }

/* Smaller screens ------------------------------------------------------- */

@media (max-width: 960px) {
    .tiles ul { grid-template-columns: repeat(2, 1fr); }
    .listing { grid-template-columns: 1fr; gap: 20px; }
    .filters { position: static; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; }
    .filters summary { display: list-item; cursor: pointer; font: 700 1rem var(--display); padding: 10px 0; }
    .filters[open] summary { margin-bottom: 8px; }
    .filters fieldset { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .filters fieldset a { margin-left: 0; border: 1px solid var(--line); }
    .filter-brands { max-height: 180px; }
    .product { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .header-row { gap: 10px; }
    .search { flex-basis: 100%; }
    .hero { padding-bottom: 120px; }
    .tiles { margin-top: -110px; }
    .tiles ul { gap: 12px; }
    .tile-lead { display: none; }
    .tile-name { font-size: 1.05rem; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
    .offer { grid-template-columns: 1fr auto; }
    .offer .button { grid-column: 1 / -1; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
