/* Zīle v5 "Dāvanas": shop (veikals/) and product (produkts/) pages.
   Loaded after ../style.css, reuses its tokens and components. */

[hidden] { display: none !important; }

/* breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink-2); padding: 18px 0 0; margin: 0; list-style: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs li[aria-current] { color: var(--ink); }

/* ---------- shop page ---------- */
.shop { padding: 0 0 72px; }
.shop__head { text-align: center; padding: 28px 0 24px; }
.shop__head h1 { font-size: clamp(30px, 4vw, 48px); }
.shop__count { color: var(--ink-2); font-size: 15px; margin-top: 8px; }
.shop__lead { color: var(--ink-2); font-size: 15.5px; max-width: 56ch; margin: 10px auto 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toolbar__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--ink); border-radius: var(--r); font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; background: var(--white); }
.toolbar__btn:hover { background: var(--ink); color: var(--white); }
.toolbar__btn .n { font-weight: 500; color: var(--ink-2); }
.toolbar__btn:hover .n { color: var(--white); }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.sort label { color: var(--ink-2); }
.sort select {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); background: var(--white);
  border: 1px solid var(--ink); border-radius: var(--r); min-height: 40px; padding: 0 36px 0 12px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23141414' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; cursor: pointer;
}
.sort select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* occasion chips row (gift filter, same chips as the home page) */
.occrow { padding: 18px 0 4px; }
.occrow__label { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.occrow .chips { padding-bottom: 6px; }

/* layout: filters + grid */
.shop__layout { display: grid; grid-template-columns: 1fr; gap: 0 40px; margin-top: 16px; }
.shop__main { min-width: 0; }
.active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; min-height: 0; }
.active:empty { display: none; }
.achip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--beige-2); font-size: 13px; font-weight: 500; }
.achip svg { opacity: .6; }
.achip:hover svg { opacity: 1; }
.active__clear { font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }

.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
@media (min-width: 768px) { .pgrid { grid-template-columns: repeat(3, 1fr); gap: 32px 20px; } }
@media (min-width: 1024px) { .pgrid { gap: 40px 24px; } .shop__layout.no-filters .pgrid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .pgrid { grid-template-columns: repeat(3, 1fr); } .shop__layout.no-filters .pgrid { grid-template-columns: repeat(4, 1fr); } }

/* product card extras on top of .card */
.pcard { position: relative; }
.pcard .card__media { position: relative; }
.pcard__badges { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 3px; background: var(--white); color: var(--ink); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.badge--sale { background: var(--sale); color: var(--white); }
.badge--oos { background: var(--ink); color: var(--white); }
.pcard__sizes { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: rgba(251, 248, 243, .94); font-size: 11.5px; font-weight: 500; opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.pcard__sizes span { padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); }
@media (hover: hover) { .pcard:hover .pcard__sizes { opacity: 1; transform: none; } }
.pcard__fav { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; background: var(--white); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 20, 20, .08); }
.pcard__fav:hover { color: var(--sale); }
.pcard__fav.is-on svg { fill: var(--sale); stroke: var(--sale); }
.pcard__rating { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.stars { display: inline-flex; gap: 1px; color: var(--ink); }
.price--old { color: var(--ink-2); font-weight: 400; font-size: 13.5px; margin-left: 4px; }
.price--oos { color: var(--ink-2); font-weight: 500; }
.pcard.is-oos .card__media img { opacity: .55; filter: grayscale(.3); }
.pcard.is-oos .card__name { color: var(--ink-2); }
.pcard .card__add { white-space: nowrap; }
@media (max-width: 767px) {
  .pcard .card__row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pcard .card__add { width: 100%; text-align: center; }
  .pcard .card__meta { display: none; }
}

.pgrid__empty { grid-column: 1 / -1; text-align: center; padding: 56px 16px; color: var(--ink-2); }
.pgrid__empty h2 { font-size: 22px; margin-bottom: 8px; color: var(--ink); }
.pgrid__empty a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.shop__more { text-align: center; margin-top: 40px; }
.shop__seen { font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; }
.shop__bar { width: 160px; height: 2px; background: var(--line); margin: 0 auto 16px; position: relative; overflow: hidden; }
.shop__bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }

/* filters: sheet on mobile, sidebar on desktop */
.filters { position: fixed; inset: 0; z-index: 91; background: var(--ivory); display: none; flex-direction: column; }
.filters.is-open { display: flex; }
.filters__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.filters__title { font-size: 18px; font-weight: 600; }
.filters__body { flex: 1; overflow-y: auto; padding: 4px 20px 24px; }
.filters__foot { padding: 12px 20px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; background: var(--ivory); }
.filters__foot .btn { flex: 1; }
.fgroup { border-bottom: 1px solid var(--line); }
.fgroup__btn { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 16px 0; font-size: 15px; font-weight: 600; text-align: left; }
.fgroup__btn .n { font-weight: 500; color: var(--ink-2); font-size: 13px; margin-left: 8px; }
.fgroup__btn::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); transition: transform .15s; margin: 0 4px 4px 0; flex: 0 0 auto; }
.fgroup__btn[aria-expanded="true"]::after { transform: rotate(225deg); margin-bottom: 0; }
.fgroup__body { padding: 0 0 16px; }
.fgroup__body[hidden] { display: none; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14.5px; cursor: pointer; }
.fopt input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex: 0 0 auto; }
.fopt .n { color: var(--ink-2); font-size: 13px; margin-left: auto; }
.fopt.is-off { color: var(--ink-2); opacity: .55; }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchips .chip { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.fchips--sizes .chip { min-width: 48px; padding: 0 10px; border-radius: var(--r); }
.frange { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.frange input { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); font: inherit; font-size: 14px; background: var(--white); color: var(--ink); }
.frange input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.frange span { color: var(--ink-2); font-size: 13px; }
.frange__apply { margin-top: 10px; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 1024px) {
  .shop__layout { grid-template-columns: 240px 1fr; }
  .shop__layout.no-filters { grid-template-columns: 1fr; }
  .shop__layout.no-filters .filters { display: none; }
  .filters { position: sticky; top: 88px; inset: auto; z-index: 1; display: block; background: transparent; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; padding-right: 8px; }
  .filters__head, .filters__foot { display: none; }
  .filters__body { padding: 0; overflow: visible; }
  .fgroup:first-child { border-top: 1px solid var(--line); }
  .toolbar__btn--mobile { display: none; }
}
@media (max-width: 1023px) { .toolbar__btn--desktop { display: none; } }

/* ---------- product page ---------- */
.pdp { padding: 0 0 56px; }
.pdp__wrap { display: grid; grid-template-columns: 1fr; gap: 28px; margin-top: 20px; }
.gallery { position: relative; }
.gallery__main { position: relative; display: block; width: 100%; overflow: hidden; border-radius: var(--r); background: var(--beige-2); cursor: zoom-in; }
.gallery__main img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.gallery__zoom { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--white); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(20, 20, 20, .12); pointer-events: none; }
.gallery__badges { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gallery__thumbs button { width: 64px; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); background: var(--beige-2); }
.gallery__thumbs button[aria-current="true"] { border-color: var(--ink); }
.gallery__thumbs img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.gallery__note { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }

.buy { min-width: 0; }
.buy__group { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; display: inline-block; }
.buy__group:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.buy h1 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; }
.buy__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: 14px; font-size: 24px; font-weight: 600; }
.buy__price .price--old { font-size: 16px; }
.buy__price .pct { font-size: 13px; font-weight: 600; color: var(--sale); letter-spacing: 0.04em; }
.buy__avail { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.buy__avail::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3f7d4e; }
.buy__avail.is-pre::before { background: #b98a2a; }
.buy__avail.is-oos::before { background: var(--ink-2); }
.buy__rating { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.buy__rating:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.buy__rating .stars { color: var(--ink); }

.sizes { margin-top: 26px; }
.sizes__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 14px; }
.sizes__head strong { font-weight: 600; }
.sizes__head a, .sizes__head button { font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.sizes__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.sizes__grid--long { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.size { min-height: 46px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); font-size: 14px; font-weight: 500; line-height: 1.25; text-align: center; transition: border-color .15s, background .15s, color .15s; }
.size:hover { border-color: var(--ink); }
.size[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.sizes__err { font-size: 13.5px; color: var(--sale); margin-top: 8px; }
.sizes__err[hidden] { display: none; }
.opt { margin-top: 18px; }
.opt label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.opt select { width: 100%; min-height: 46px; padding: 0 36px 0 12px; font: inherit; font-size: 14px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--r); appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23141414' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

.buy__actions { display: flex; gap: 10px; margin-top: 24px; align-items: stretch; }
.buy__actions .btn { flex: 1; min-height: 52px; font-size: 14.5px; }
.buy__actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.buy__actions .btn--line[disabled]:hover { background: transparent; color: var(--ink); }
.buy__fav { width: 52px; min-height: 52px; border: 1px solid var(--ink); border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center; background: var(--white); }
.buy__fav:hover { background: var(--beige-2); }
.buy__fav.is-on svg { fill: var(--sale); stroke: var(--sale); }
.buy__qty { display: flex; }
.buy__hint { font-size: 13.5px; color: var(--ink-2); margin-top: 10px; }

.giftline { display: flex; gap: 12px; align-items: flex-start; margin-top: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); font-size: 14px; }
.giftline svg { flex: 0 0 auto; margin-top: 1px; }
.giftline p { color: var(--ink-2); }
.giftline a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.trust { margin-top: 22px; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.trust li { display: flex; gap: 10px; align-items: flex-start; }
.trust svg { flex: 0 0 auto; color: var(--ink); margin-top: 2px; }

.acc { margin-top: 28px; border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 16px 0; font-size: 15px; font-weight: 600; text-align: left; }
.acc__btn::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); transition: transform .15s; margin: 0 4px 4px 0; flex: 0 0 auto; }
.acc__btn[aria-expanded="true"]::after { transform: rotate(225deg); margin-bottom: 0; }
.acc__body { padding: 0 0 20px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.acc__body[hidden] { display: none; }
.acc__body p { margin: 0 0 10px; }
.acc__body ul { padding-left: 18px; list-style: disc; margin: 0 0 10px; }
.acc__body ul ul { margin: 4px 0; }
.acc__body li { margin: 0 0 4px; }
.acc__body li p { margin: 0; }
.acc__body b, .acc__body strong { color: var(--ink); font-weight: 600; }
.acc__body a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.acc__body h3 { font-size: 14.5px; color: var(--ink); margin: 0 0 6px; }
.sizelist { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sizelist li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); font-size: 13.5px; color: var(--ink); }
.review { padding: 14px 0; border-top: 1px solid var(--line); }
.review:first-child { border-top: 0; padding-top: 0; }
.review__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; font-size: 13.5px; }
.review__head strong { color: var(--ink); }
.review__head time { color: var(--ink-2); }
.review p { white-space: pre-line; }
.rsum { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--ink); font-weight: 600; }
.rsum span { color: var(--ink-2); font-weight: 400; }

@media (min-width: 768px) {
  .pdp__wrap { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  /* one photo per product, so the gallery stays in view while the long buy panel scrolls */
  .gallery { position: sticky; top: 96px; }
}
@media (min-width: 1024px) {
  .pdp__wrap { grid-template-columns: 7fr 5fr; gap: 64px; }
  .buy { padding-top: 8px; }
}
@media (min-width: 1280px) { .pdp__wrap { gap: 96px; } .buy { padding-right: 24px; } }

/* rails */
.rail { padding: 48px 0 0; }
.rail .section__head { margin-bottom: 18px; }
.rail .grid--scroll .card { flex-basis: 60vw; }
.rail--recent { padding-bottom: 24px; }
.rail[hidden] { display: none; }

/* mobile sticky buy bar */
.pdp__bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px var(--gut); background: var(--ivory); border-top: 1px solid var(--line); transform: translateY(100%); transition: transform .2s; }
.pdp__bar.is-on { transform: none; }
.pdp__bar strong { font-size: 18px; font-weight: 600; white-space: nowrap; }
.pdp__bar small { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.pdp__bar .btn { min-height: 46px; padding: 0 20px; }
@media (min-width: 768px) { .pdp__bar { display: none; } }
body.has-bar { padding-bottom: 72px; }
@media (min-width: 768px) { body.has-bar { padding-bottom: 0; } }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 93; background: rgba(20, 20, 20, .92); display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb img { max-width: min(96vw, 1100px); max-height: 92vh; width: auto; height: auto; object-fit: contain; }
.lb__close { position: absolute; right: 12px; top: 12px; color: var(--white); width: 44px; height: 44px; }
.lb__close:hover { background: rgba(255, 255, 255, .12); }
.lb__nav { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; color: var(--white); border-radius: 50%; }
.lb__nav:hover { background: rgba(255, 255, 255, .12); }
.lb__nav--prev { left: 8px; } .lb__nav--next { right: 8px; }
.lb__nav[hidden] { display: none; }

/* not found + loading */
.pdp__state { text-align: center; padding: 64px 0 24px; color: var(--ink-2); }
.pdp__state-h { font-size: clamp(26px, 3vw, 36px); font-weight: 500; line-height: 1.15; color: var(--ink); margin-bottom: 12px; }
.pdp__state .btn { margin-top: 20px; }
.pdp__state[hidden] { display: none; }
.pdp__wrap[hidden], .shop__layout[hidden] { display: none; }
noscript p { padding: 24px var(--gut); color: var(--ink-2); }
noscript a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }

@media (prefers-reduced-motion: reduce) { .pcard__sizes, .pdp__bar { transition: none; } }
