/* ClawClay shop — editorial product grid + product detail.
   Fixed design per eshop20261115 mockups. Brand vars mirror home.css. */

:root {
  --cc-pink: #ffc8ff;
  --cc-red: #ff0000;
  --cc-pink-light: #ffe4ff;
}

/* Custom cc-* markup isn't WP blocks, so pin border-box (padding must not add
   to column width, or the grid overflows the viewport). */
.clawclay-shop, .clawclay-shop * { box-sizing: border-box; }

/* ---------- Gallery welcome banner (EN pink on top, CZ red below) ---------- */
.cc-gallery-banner { margin: 0; }
.cc-gallery-banner__en,
.cc-gallery-banner__cz { padding: clamp(1.8rem, 4vw, 3rem) clamp(1.4rem, 4vw, 3rem); }
.cc-gallery-banner__en { background: var(--cc-pink); }
.cc-gallery-banner__cz { background: var(--cc-red); }
.cc-gallery-banner__en p,
.cc-gallery-banner__cz p {
  margin: 0;
  max-width: 60ch;
  font-family: var(--wp--preset--font-family--display, inherit);
  font-weight: 700;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.25;
}
.cc-gallery-banner__en p { color: var(--cc-red); }
.cc-gallery-banner__cz p { color: #fff; margin-left: auto; }
.cc-gallery-banner__en p a,
.cc-gallery-banner__cz p a { color: inherit; text-decoration: underline; }

/* ---------- Shop archive ---------- */
.clawclay-shop { background: #fff; }
.cc-shop { margin: 0; }

/* Category filter — simple checkboxes along the top */
.cc-shop__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  align-items: center;
  min-height: 3.4rem;                    /* a touch of height so the row reads centred */
  background: var(--cc-pink);            /* no white strip under the pink header */
  padding: clamp(0.8rem, 2.5vw, 1.4rem) clamp(1rem, 4vw, 2.5rem);
}
/* Modern text filter: uppercase labels, underlined when selected (no checkboxes). */
.cc-shop__filter label {
  display: inline-block;
  font-family: var(--wp--preset--font-family--display, inherit);
  font-weight: 700;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cc-red);
  cursor: pointer;
  user-select: none;
  line-height: 1;
  text-underline-offset: 5px;
}
.cc-shop__filter input {           /* visually hidden — the label carries the state */
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cc-shop__filter label.is-active { text-decoration: underline; text-decoration-thickness: 2px; }
.cc-shop__filter label:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* Grid — flush square tiles (the Instagram / editorial look) */
.cc-shop__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--cc-pink);
}
.cc-cell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--cc-pink-light);
}
.cc-shop__tile { display: block; text-decoration: none; color: inherit; }
.cc-cell img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Hover info overlay */
.cc-shop__info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;        /* name top, meta bottom */
  gap: 0.6rem;
  padding: clamp(1.6rem, 2.8vw, 2.6rem);  /* keep the copy off the edges */
  text-align: left;
  color: #fff;
  background: rgba(238, 43, 43, 0.9);     /* brand red veil */
  opacity: 0;
  transition: opacity 240ms ease;
}
.cc-shop__name {
  font-family: var(--wp--preset--font-family--script, var(--wp--preset--font-family--display, inherit));
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  line-height: 1.05;
}
/* Description + price grouped at the bottom, with the description lifted off the
   price. (No decorative motif for now — it read the same on every product.) */
.cc-shop__meta { display: flex; flex-direction: column; gap: 0.7rem; }
.cc-shop__desc {
  font-family: var(--wp--preset--font-family--body, inherit);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.9vw, 1.55rem);   /* same as Our Story body copy */
  line-height: 1.3;
  max-width: 24ch;
}
/* Never split the price ("1 200 CZK"); shrink it to fit narrow tiles instead. */
.cc-shop__price {
  font-family: var(--wp--preset--font-family--display, inherit);
  font-size: clamp(0.95rem, 4vw, 1.55rem);
  white-space: nowrap;
}

@media (hover: hover) {
  .cc-shop__tile:hover .cc-shop__info,
  .cc-shop__tile:focus-visible .cc-shop__info { opacity: 1; }
}
/* Touch devices: no hover — show a compact name/price bar at the bottom */
@media (hover: none) {
  .cc-shop__info {
    opacity: 1;
    inset: auto 0 0 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    background: rgba(238, 43, 43, 0.9);
  }
  .cc-shop__name { font-size: 1.1rem; }
  .cc-shop__motif, .cc-shop__desc { display: none; }
  /* Quieter than the name — the price was shouting on phones. */
  .cc-shop__price { font-size: 0.8rem; font-weight: 400; opacity: 0.9; }
}

/* Sold-out badge (products stay visible) */
.cc-shop__badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;                 /* top-right, clear of the hover name (top-left) */
  z-index: 3;
  background: var(--cc-pink);    /* pink so it reads on both the photo and the red hover veil */
  color: var(--cc-red);
  font-family: var(--wp--preset--font-family--display, inherit);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.55rem;
}
.cc-shop__tile.is-soldout img { filter: grayscale(0.25); }

/* Decorative tiles baked into the grid — always red on pink, regardless of the
   graphic's own colours: the shape is used as a mask and filled with --cc-red. */
.cc-shop__deco { display: flex; align-items: center; justify-content: center; background: var(--cc-pink); }
.cc-shop__deco-img {
  width: 56%;
  height: 56%;
  background-color: var(--cc-red);
  -webkit-mask-image: var(--deco-img);
  mask-image: var(--deco-img);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
/* Hidden while a category filter is active */
.cc-shop.is-filtering .cc-shop__deco { display: none; }
.cc-cell.is-hidden { display: none; }

@media (max-width: 900px) { .cc-shop__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cc-shop__grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Product detail ---------- */
.clawclay-product-single { background: var(--cc-pink); }

/* Three equal sections, full width: photos | English | Czech (red block);
   the "Buy me" button sits centred below, spanning all three. */
.cc-product--3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas: "media en cz";
  gap: 0;
  align-items: stretch;                 /* all three columns share the grid's height */
  min-height: clamp(380px, 44vw, 640px);
  max-width: none;
  margin: 0;
  padding: 0;
}
/* Photo stretches to the shared column height (its own aspect no longer constrains). */
.cc-product--3col .cc-pcar { grid-area: media; aspect-ratio: auto; }
.cc-product--3col > * { min-width: 0; }   /* let columns shrink; no horizontal overflow */
.cc-product__en {
  grid-area: en;
  padding: clamp(1.4rem, 3vw, 3rem);
  display: flex;
  flex-direction: column;
}
.cc-product__cz { grid-area: cz; }
/* Price (left) + "Buy me" (right) pinned to the bottom of the English column. */
.cc-product__cart {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.8rem 1rem;
  padding-top: clamp(1.2rem, 3vw, 2rem);
}
.cc-product__cart .cc-product__price { margin: 0; color: var(--cc-red); white-space: nowrap; }
/* Sold-out status where the "Buy me" button would be (a label, not a button) */
.cc-product__soldout {
  display: inline-block;
  color: var(--cc-red);
  border: 2px solid var(--cc-red);
  border-radius: 18px 14px 20px 12px / 14px 20px 12px 18px;
  padding: 0.5em 1.4em;
  /* same "fun" script font as the Buy me button */
  font-family: var(--wp--preset--font-family--script, var(--wp--preset--font-family--display, inherit));
  font-size: clamp(1.3rem, 1.9vw, 1.75rem);
  line-height: 1.1;
  white-space: nowrap;
}

/* Carousel */
.cc-pcar { position: relative; overflow: hidden; aspect-ratio: 3 / 4; background: var(--cc-pink-light); }
.cc-pcar__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 600ms ease; }
.cc-pcar__slide.is-active { opacity: 1; }
.cc-pcar__slide img { width: 100%; height: 100%; object-fit: cover; }
.cc-pcar__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2.6rem;
  height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--cc-red);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cc-pcar__nav--prev { left: 0.6rem; }
.cc-pcar__nav--next { right: 0.6rem; }

/* English column (ink red on pink) */
.cc-product__en { color: var(--cc-red); }
/* Czech column — red block, light text, with a white flower accent */
.cc-product__cz {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cc-red);
  color: #fff;
  padding: clamp(1.4rem, 3vw, 3rem);     /* matches the English column so the copy aligns */
}
.cc-product__cz .cc-product__desc p { margin: 0; }
.cc-product__flower {
  display: block;
  width: 4.5rem;
  margin: auto 0 0 auto;   /* bottom-right of the red block */
  filter: brightness(0) invert(1);   /* red graphic → white */
}
.cc-product__title {
  font-family: var(--wp--preset--font-family--display, inherit);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.05;
  margin: 0 0 0.6rem;
  /* A long name (or one long word) must wrap within the column, not push it wider
     than the viewport — "anywhere" also lets flex/grid shrink the column itself. */
  overflow-wrap: anywhere;
}
.cc-product__title--ghost { visibility: hidden; }   /* reserves the title's height in the Czech column */
.cc-product__price {
  font-family: var(--wp--preset--font-family--display, inherit);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  margin-top: auto;   /* pushed to the bottom of the middle column */
}
/* Match the Our Story body copy — stronger weight, slightly larger, unified. */
.cc-product__desc {
  font-family: var(--wp--preset--font-family--body);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.9vw, 1.55rem);
  line-height: 1.45;
  margin-bottom: 1.6rem;
}
.cc-product__desc p { margin: 0 0 1em; }
.cc-product__desc p:last-child { margin-bottom: 0; }

/* "Buy me" button (WooCommerce add-to-cart form, restyled) */
.cc-product__cart form.cart,
.cc-product__cart .cart { display: flex; justify-content: center; align-items: center; margin: 0; }
.cc-product__cart .quantity { display: none; }   /* single "Buy me" button; defaults to 1 */
.cc-product__cart .single_add_to_cart_button,
.cc-product__cart button.single_add_to_cart_button {
  display: inline-block;
  background: var(--cc-red);
  color: #fff;
  border: none;
  /* hand-drawn, lightly irregular corners — same as the Rental "Make an enquiry" button */
  border-radius: 18px 14px 20px 12px / 14px 20px 12px 18px;
  padding: 0.5em 1.4em;
  white-space: nowrap;
  font-family: var(--wp--preset--font-family--script, var(--wp--preset--font-family--display, inherit));
  font-size: clamp(1.3rem, 1.9vw, 1.75rem);
  line-height: 1.1;
  cursor: pointer;
  transition: transform 150ms ease;
}
.cc-product__cart .single_add_to_cart_button:hover { transform: translateY(-2px); }
.cc-product__cart .stock.out-of-stock { font-family: var(--wp--preset--font-family--display, inherit); }

@media (max-width: 782px) {
  .cc-product--3col {
    grid-template-columns: 1fr;
    grid-template-areas: "media" "en" "cz";
    min-height: 0;
  }
  /* Stacked: give the photo its own height. Use the padding-ratio trick (not
     aspect-ratio): on iOS/WebKit aspect-ratio can collapse to 0 when all children
     are absolutely positioned, which hid the detail photo on iPhone. */
  .cc-product--3col .cc-pcar { aspect-ratio: auto; height: 0; padding-bottom: 75%; }
  /* Full-width column: price left, Buy me right (wrap only if truly needed). */
  .cc-product__cart { flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
  /* The desktop clamp's floor (1.8rem) is still too wide for a long name on a
     narrow phone; let it shrink further here. */
  .cc-product__title { font-size: clamp(1.4rem, 7vw, 2rem); }
}

/* ---------- Subtle life on the product-detail photo (slow zoom + float) ---------- */
/* Active slide only, no will-change (which promoted a layer that could blank the photo
   on mobile). The frame clips the zoom. Mobile included. Respects reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .cc-pcar__slide.is-active img {
    animation: ccShopKen 20s ease-in-out infinite;
  }
}
@keyframes ccShopKen {
  0%   { transform: scale(1) translate3d(0, 0, 0); }
  50%  { transform: scale(1.06) translate3d(0, -1%, 0); }
  100% { transform: scale(1) translate3d(0, 0, 0); }
}
