/* UI refresh (mobile-first, CSS only). Loaded AFTER styles-*.css and retail-overrides-v6.css; touches no markup, no data, no scripts.
   Goal: the first phone screen shows the product and one clear action; faster path to order; a first step towards VD Fish (deep sea + sand/gold) while keeping Taranka_ks recognisable.
   Remove this one file (and its <link>) to roll back completely. */
:root { --vd-gold: #e6b865; --vd-gold-deep: #c98f3f; --vd-sea: #0f1d22; --vd-radius: 16px; }

/* ---- every screen: comfortable tap targets, visible focus, smoother scroll ---- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
.button, button.button, .filter-chip, .category-link { min-height: 46px; }
:focus-visible { outline: 3px solid var(--vd-gold); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

/* ---- phones ---- */
@media (max-width: 720px) {
  /* the order button stays reachable: a slim sticky top bar */
  .topbar { position: sticky; top: 0; z-index: 45; display: flex !important; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 10px;
    margin: 0; padding: 8px 12px; border-radius: 0 0 14px 14px; background: rgba(12, 18, 17, 0.94); border-bottom: 1px solid rgba(230, 184, 101, 0.18); }
  .topbar .brand { min-width: 0; }
  .topbar .brand .eyebrow { display: none; }
  .topbar .brand-mark { width: 40px; height: 40px; flex: none; }
  .topbar-actions { display: flex !important; flex-wrap: nowrap; align-items: center; gap: 8px; width: auto !important; }
  .topbar-actions .text-link { display: none; }                                  /* «Весь асортимент» / «Про нас» are one tap away in the hero and the footer */
  .topbar-actions .button { min-height: 42px; padding: 0 18px; white-space: nowrap; background: linear-gradient(180deg, var(--vd-gold), var(--vd-gold-deep)) !important; color: #1b1408 !important; border: 0 !important; font-weight: 800; }

  /* hero: a headline that fits, one primary action, the picture sooner */
  .hero h1 { font-size: clamp(1.9rem, 8.4vw, 2.5rem) !important; line-height: 1.07 !important; letter-spacing: -0.01em; margin: 6px 0 10px !important; }
  .hero-text { font-size: 0.98rem !important; line-height: 1.5 !important; margin: 0 0 14px !important; max-width: 34ch; }
  .hero-actions { display: grid !important; grid-template-columns: 1fr; gap: 10px; }
  .hero-actions .button:first-child { width: 100%; justify-content: center; min-height: 52px; font-size: 1.02rem; background: linear-gradient(180deg, var(--vd-gold), var(--vd-gold-deep)) !important; color: #1b1408 !important; border: 0 !important; box-shadow: 0 10px 24px rgba(201, 143, 63, 0.28); }
  .hero-actions .button-ghost[href="/catalog/"] { display: none; }                  /* duplicates the catalog link */
  .hero-actions .button-ghost { width: 100%; justify-content: center; }
  .hero-points { display: flex !important; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 4px 0 6px; margin: 12px 0 0; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .hero-points::-webkit-scrollbar { display: none; }
  .hero-points li { flex: none; white-space: nowrap; font-size: 0.8rem; }
  .hero-grid { gap: 18px !important; }
  .hero-grid > *, .hero-copy { min-width: 0; max-width: 100%; }               /* a scrolling chip row must never widen the page */

  /* cards: calmer, rounder, easier to tap */
  .product-card, .card, article.card { border-radius: var(--vd-radius) !important; }
  .catalog-category.is-open > .products-grid, .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  .product-card { padding: 10px !important; display: flex; flex-direction: column; gap: 8px; }
  .product-card-media { border-radius: 12px; overflow: hidden; aspect-ratio: 1 / 1; }
  .product-card-media img { width: 100%; height: 100%; object-fit: cover; }
  .product-card-title { font-size: 0.95rem !important; line-height: 1.25 !important; }
  .product-card-price { font-size: 1.02rem !important; font-weight: 800; color: var(--vd-gold); }
  .product-card-availability { font-size: 0.78rem !important; }
  .product-card-action { width: 100%; min-height: 44px; margin-top: auto; justify-content: center; }

  /* catalog: header stays with you, chips scroll, categories are bigger targets */
  .site-header { position: sticky; top: 0; z-index: 45; background: rgba(12, 18, 17, 0.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .catalog-category-title, .category-list summary { min-height: 56px; }
  .filter-chip { white-space: nowrap; }
}

/* ---- narrow phones ---- */
@media (max-width: 360px) {
  .products-grid { grid-template-columns: 1fr !important; }
}

/* ---- desktop: only polish ---- */
@media (min-width: 721px) {
  .button { transition: transform 0.15s ease, box-shadow 0.15s ease; }
  .button:hover { transform: translateY(-1px); }
  .product-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
  .product-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28); }
  .product-card-price { color: var(--vd-gold); font-weight: 800; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .button, .product-card { transition: none !important; } }

/* ---- home-page shelves (shown only when Core data exists; see docs/shelves-contract.md) ---- */
.home-shelves { padding-block: 28px; }
.shelf { margin-bottom: 26px; }
.shelf-title { font-size: clamp(1.35rem, 5vw, 1.9rem); margin: 0 0 12px; }
.shelf-row { list-style: none; margin: 0; padding: 0 0 6px; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row .product-card { flex: 0 0 min(64vw, 240px); scroll-snap-align: start; }
.shelf-note { color: var(--muted, #9aa3a0); font-size: 0.82rem; margin: 4px 0 0; }
@media (min-width: 721px) { .shelf-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); overflow: visible; } .shelf-row .product-card { flex: none; } }
/* shelf cards on the home page (catalog.css is not loaded there, so the card look is defined here) */
.shelf .product-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid rgba(230, 184, 101, 0.22); background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); }
.shelf .product-card-media:not(:has(img)) { display: none; }                 /* no photo yet: no empty box (the card text carries it) */
.shelf .product-card-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; }
.shelf .product-card-title { color: #f6f1e7; text-decoration: none; font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.shelf .product-card-price { color: var(--vd-gold); font-weight: 800; font-size: 1.08rem; margin: 2px 0; }
.shelf .product-card-availability { color: #a9b1ae; font-size: 0.8rem; margin: 0 0 6px; }
.shelf .product-card-action { width: 100%; justify-content: center; text-align: center; }
.shelf .product-card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shelf .tk-add-cart-btn { width: 100%; justify-content: center; }

/* ---- VD FISH brand (approved logo; only resized/cropped, never recoloured; the near-black artwork background is made transparent so it sits on the dark site) ---- */
.brand-vd { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 36px; width: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-size: 1.05rem; letter-spacing: 0.06em; font-weight: 800; }
.brand-text small { font-size: 0.66rem; letter-spacing: 0.05em; opacity: 0.72; white-space: nowrap; }
.hero-logo { display: block; width: min(200px, 56vw); height: auto; margin: 4px 0 2px; }
.brand-transition { margin: 0 0 10px; font-size: 0.82rem; letter-spacing: 0.06em; opacity: 0.8; }
@media (min-width: 721px) { .brand-logo { height: 44px; } .hero-logo { width: 320px; } .brand-text strong { font-size: 1.15rem; } }
@media (max-width: 380px) { .brand-text small { display: none; } }

.filter-chip[hidden], [hidden] > .filter-chip { display: none !important; }
