/*
 * Print.az — shared "framed image" card design tokens.
 *
 * Every product/category card on the site (.card, .product-card,
 * .category-card) shares these same values for its outer card and its
 * image-media wrapper, so the three families render pixel-identical and
 * can't drift apart again. To change the look site-wide, edit the values
 * here -- category-page.css and category-cards.css reference these
 * variables instead of repeating literals.
 *
 * This file also defines the canonical .card / .card-media / .card-link
 * implementation (promo-mehsullar/*), consolidated out of four previously
 * hand-duplicated (and drifted) inline <style> copies.
 */
:root {
  --card-bg: #ffffff;
  --card-border: 0.8px solid #e6e8ec;
  --card-radius: 30px;
  --card-padding: 28px;
  --card-shadow: 0 18px 60px rgba(17, 24, 39, 0.06);
  /* Pure white, not off-white -- a photo whose own background is
     near-white (most product mockups) blends into the frame instead of
     showing as a hard-edged rectangle against a visibly different grey. */
  --card-media-bg: #ffffff;
  --card-media-border: 0.8px solid #e6e8ec;
  --card-media-radius: 22px;
}

.card {
  display: grid;
  gap: 16px;
  min-height: 220px;
  padding: var(--card-padding);
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.card h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #17191d;
}

.card p {
  margin: 0;
  color: #4f5865;
  font-size: 0.95rem;
  line-height: 1.62;
}

/* Fixed (not min-) height: the image fills this box edge-to-edge via
   width/height:100% below, so the box needs a definite height for that to
   resolve -- an auto/min-height box has no definite size for a 100%-height
   child to fill. overflow:hidden + the media box's own border-radius clips
   the image to the frame's rounded corners (no separate radius needed on
   the <img> itself). */
.card-media {
  height: 160px;
  background: var(--card-media-bg);
  border: var(--card-media-border);
  border-radius: var(--card-media-radius);
  overflow: hidden;
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: #d71920;
  font-weight: 800;
  font-size: 0.95rem;
  min-height: 22px;
  transition: transform 0.24s ease;
}

.card-link::after {
  content: "\2192";
  transition: transform 0.24s ease;
}

@media (hover: hover) {
  a.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 50px rgba(17, 24, 39, 0.12);
    border-color: rgba(215, 25, 32, 0.28);
  }
  a.card:hover .card-link::after {
    transform: translateX(3px);
  }
}

a.card:focus-visible {
  outline: 3px solid rgba(215, 25, 32, 0.55);
  outline-offset: 3px;
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(17, 24, 39, 0.12);
  border-color: rgba(215, 25, 32, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card-link::after {
    transition: border-color 0.24s ease, box-shadow 0.24s ease;
  }
  a.card:hover,
  a.card:focus-visible {
    transform: none;
  }
  a.card:hover .card-link::after,
  a.card:focus-visible .card-link::after {
    transform: none;
  }
}

@media (max-width: 560px) {
  .card {
    padding: 20px;
  }
}

/* The empty state for a sub-category grid. It is a real rendered state, not
   a fallback nobody sees: two pages shipped advertising a ceramic mug
   because the hardcoded card left in place was never checked against what
   the grid does when it has nothing to show. */
.subcat-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 0;
  color: var(--muted, #4f5865);
  text-align: center;
}
/* The empty state now ships hidden and category-listing-dynamic.js reveals it
   only once the catalogue confirms the section has no products. This rule is
   not redundant with the `hidden` attribute: [hidden] is a USER-AGENT style and
   loses to any explicit display -- and .subcat-empty sets grid-column, so it is
   one stylesheet edit away from being laid out as a grid item and painting
   anyway. Stated so nobody removes it as noise. */
.subcat-empty[hidden] { display: none !important; }
