/*
Theme Name: Vetaptek
Theme URI: https://vetaptek.ru
Author: Vetaptek
Description: Мобильно-ориентированная тема для интернет-магазина ветеринарных товаров на WooCommerce. Синхронизация остатков и цен — через плагин vetaptek-moysklad-sync.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 8.0
Tested up to: 6.6
WC requires at least: 8.0
WC tested up to: 9.0
Text Domain: vetaptek
Domain Path: /languages
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   0. Design tokens
   ========================================================================== */

:root{
  --font-base: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Brand: fb0101 (red cross), 1c1d4d (navy dog), 38bebf (teal cat), 34343f (text).
     Navy carries interactive elements (best contrast for white-on-color buttons);
     red is the identity color (header rule, logo, cart badge, danger) darkened to
     #d30101 wherever it sits under small text so it still clears WCAG AA; teal is
     a decorative accent used only on light tints with dark text, never as text
     color on white (its own contrast against white is ~2.3:1). */
  --color-bg: #ffffff;
  --color-bg-muted: #F1F6F7;
  --color-surface: #ffffff;
  --color-border: #E1E6EC;
  --color-text: #34343F;
  --color-text-muted: #6B6B78;
  --color-primary: #1C1D4D;
  --color-primary-hover: #12132F;
  --color-primary-contrast: #ffffff;
  --color-brand-red: #FB0101;
  --color-accent: #38BEBF;
  --color-accent-tint: #E6F7F7;
  --color-danger: #D30101;
  --color-success: #1E7F5C;
  --color-warning: #8A5B06;
  --color-badge-sale-bg: #FDE7E7;
  --color-badge-sale-text: #B80101;
  --color-badge-instock-bg: #E7F4EE;
  --color-badge-instock-text: #176B4C;
  --color-badge-outofstock-bg: #F2F2F2;
  --color-badge-outofstock-text: #595959;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(22,32,30,.06), 0 1px 1px rgba(22,32,30,.04);
  --shadow-elevated: 0 8px 24px rgba(22,32,30,.12);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --container-max: 1280px;
  --header-height: 64px;
  --bottom-nav-height: 60px;
  --mobile-buybar-height: 73px;

  --z-header: 100;
  --z-bottom-nav: 90;
  --z-drawer: 200;
  --z-toast: 300;
}

@media (prefers-color-scheme: dark){
  :root{ --color-scheme: light; }
}

/* ==========================================================================
   1. Reset
   ========================================================================== */

*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
}
body.single-product{
  /* The mobile-buybar floats above the bottom-nav on product pages — without
     this, its ~73px covered the last bit of scrollable content (tabs,
     related products) instead of just sitting on top of empty space. */
  padding-bottom: calc(var(--bottom-nav-height) + var(--mobile-buybar-height) + var(--space-4) + env(safe-area-inset-bottom));
}
img, svg, video{ max-width: 100%; display: block; height: auto; }
ul[class], ol[class]{ list-style: none; margin: 0; padding: 0; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }
input, textarea, select, button{ font: inherit; color: inherit; }
h1,h2,h3,h4,h5,h6{ margin: 0 0 var(--space-3); font-weight: 700; line-height: 1.25; }
p{ margin: 0 0 var(--space-3); }
:focus-visible{ outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }

::selection{ background: var(--color-primary); color: #fff; }
input, textarea{ caret-color: var(--color-primary); }

/* Themed scrollbars for horizontal strips (thumbs, tabs) so the browser
   default doesn't visually clash with the rest of the surface. */
.product-gallery__thumbs, .woocommerce-tabs ul.tabs{
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.product-gallery__thumbs::-webkit-scrollbar, .woocommerce-tabs ul.tabs::-webkit-scrollbar{ height: 6px; }
.product-gallery__thumbs::-webkit-scrollbar-thumb, .woocommerce-tabs ul.tabs::-webkit-scrollbar-thumb{
  background: var(--color-border); border-radius: var(--radius-pill);
}

/* ==========================================================================
   2. Layout
   ========================================================================== */

.container{
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px){ .container{ padding-inline: var(--space-6); } }

.skip-link{
  position: absolute; left: -9999px; top: 0; background: var(--color-primary);
  color: #fff; padding: var(--space-2) var(--space-4); z-index: 999; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus{ left: 0; }

/* ==========================================================================
   2.1 Homepage hero
   ========================================================================== */

.hero__inner{
  background: var(--color-bg-muted);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  display: grid;
  gap: var(--space-5);
  align-items: center;
}
.hero__title{ font-size: 26px; max-width: 20ch; }
.hero__media{ display: none; }
.hero__media img{ width: 100%; height: auto; border-radius: var(--radius-md); }

@media (min-width: 768px){
  .hero__inner{ grid-template-columns: 1.1fr 0.9fr; padding: var(--space-7); }
  .hero__title{ font-size: 34px; }
  .hero__media{ display: block; }
}

/* ==========================================================================
   3. Header
   ========================================================================== */

.site-header{
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--color-bg); border-bottom: 1px solid var(--color-border);
  border-top: 3px solid var(--color-brand-red);
}
.site-header__row{
  min-height: var(--header-height);
  display: flex; align-items: center; gap: var(--space-4); padding-block: var(--space-2);
}

/* Brand: logo + invented site name (bloginfo('name') — edit in Настройки → Общие) */
.site-header__brand{ display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.site-header__brand img{ height: 32px; width: auto; display: block; }
.site-header__brand-name{ display: none; font-size: 17px; font-weight: 800; color: var(--color-primary); white-space: nowrap; }

.icon-btn{
  position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-surface); flex-shrink: 0;
}
.icon-btn__badge{
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--radius-pill); background: var(--color-danger); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.search-form{ display: flex; align-items: center; background: var(--color-bg-muted); border-radius: var(--radius-pill); padding: 0 var(--space-3); height: 40px; }
.search-form input[type="search"]{ flex: 1; border: 0; background: transparent; height: 100%; padding: 0 var(--space-2); min-width: 0; }
.search-form button{ border: 0; background: transparent; display: flex; align-items: center; }

.site-header__search{ position: relative; flex: 1; min-width: 0; }
.live-search__results{
  position: absolute; top: calc(100% + var(--space-2)); left: 0; right: 0; z-index: var(--z-header);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated); max-height: 70vh; overflow-y: auto; padding: var(--space-2);
}
.live-search__item{
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); border-radius: var(--radius-sm);
}
.live-search__item:hover, .live-search__item:focus{ background: var(--color-bg-muted); }
.live-search__item img{ width: 40px; height: 40px; object-fit: contain; background: var(--color-bg-muted); border-radius: var(--radius-sm); flex-shrink: 0; }
.live-search__item-name{ font-size: 13px; font-weight: 600; flex: 1; min-width: 0; }
.live-search__item-price{ font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.live-search__empty{ padding: var(--space-3); font-size: 13px; color: var(--color-text-muted); }
.live-search__more{ display: block; text-align: center; padding: var(--space-2); font-size: 13px; font-weight: 600; color: var(--color-primary); border-top: 1px solid var(--color-border); margin-top: var(--space-1); }

.site-header__actions{ display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.site-header__phone{ display: none; flex-direction: column; line-height: 1.2; }
.site-header__phone-number{ font-size: 14px; font-weight: 700; color: var(--color-text); white-space: nowrap; }

.main-nav{ display: none; }

@media (min-width: 1024px){
  .site-header__brand-name{ display: block; }
  .site-header__phone{ display: flex; }

  .main-nav{ display: block; flex-shrink: 0; }
  .main-nav ul{ display: flex; flex-wrap: wrap; gap: var(--space-4); list-style: none; margin: 0; padding: 0; }
  .main-nav a{ font-weight: 600; font-size: 14px; color: var(--color-text-muted); }
  .main-nav a:hover{ color: var(--color-primary); }

  .main-nav .menu-item-has-children{ position: relative; }
  .main-nav .sub-menu{
    /* top:100% with zero margin — a gap here would be a dead zone the
       cursor has to cross, dropping :hover before it reaches the menu
       (that was the "can't move the mouse into the dropdown" bug). The
       box's own top padding gives the same visual breathing room instead. */
    display: none; position: absolute; top: 100%; left: 0; z-index: var(--z-header);
    flex-direction: column; gap: 0; min-width: 200px; margin-top: 0;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated); padding: var(--space-2);
  }
  .main-nav .menu-item-has-children:hover .sub-menu,
  .main-nav .menu-item-has-children:focus-within .sub-menu{ display: flex; }
  .main-nav .sub-menu a{ display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--color-text); font-weight: 500; }
  .main-nav .sub-menu a:hover{ background: var(--color-bg-muted); color: var(--color-primary); }
}

@media (max-width: 1023px){
  /* Keep the mobile header to what actually fits: brand + search + cart.
     Nav/Telegram/phone move to (or are already covered by) the bottom nav. */
  .site-header .icon-btn[aria-label="Telegram"]{ display: none; }
}

/* ==========================================================================
   4. Bottom nav (mobile)
   ========================================================================== */

.bottom-nav{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bottom-nav);
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  display: flex;
}
@media (min-width: 1024px){ .bottom-nav{ display: none; } body, body.single-product{ padding-bottom: 0; } }
.bottom-nav a{
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: var(--color-text-muted); position: relative;
}
.bottom-nav a.is-active{ color: var(--color-primary); }
.bottom-nav .icon-btn__badge{ top: 2px; right: 22px; }

/* ==========================================================================
   5. Buttons
   ========================================================================== */

.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 48px; padding: 0 var(--space-5); border-radius: var(--radius-md); border: 1px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; transition: background-color .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn:active{ transform: scale(.98); }
.btn--primary{ background: var(--color-primary); color: var(--color-primary-contrast); }
.btn--primary:hover{ background: var(--color-primary-hover); }
.btn--secondary{ background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn--secondary:hover{ border-color: var(--color-primary); }
.btn--ghost{ background: transparent; color: var(--color-primary); height: auto; padding: var(--space-1) 0; }
.btn--block{ width: 100%; }
.btn--sm{ height: 38px; padding: 0 var(--space-4); font-size: 14px; }
.btn:disabled, .btn.disabled{ opacity: .5; cursor: not-allowed; }

/* ==========================================================================
   6. Badges
   ========================================================================== */

.badge{ display: inline-flex; align-items: center; height: 22px; padding: 0 var(--space-2); border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; }
.badge--sale{ background: var(--color-badge-sale-bg); color: var(--color-badge-sale-text); }
.badge--instock{ background: var(--color-badge-instock-bg); color: var(--color-badge-instock-text); }
.badge--lowstock{ background: #FFF3DD; color: var(--color-warning); }
.badge--outofstock{ background: var(--color-badge-outofstock-bg); color: var(--color-badge-outofstock-text); }

/* ==========================================================================
   7. Product grid & card
   ========================================================================== */

.product-grid{
  display: grid; gap: var(--space-3);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px){ .product-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px){ .product-grid{ grid-template-columns: repeat(4, 1fr); gap: var(--space-4); } }

.product-card{
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  overflow: hidden; display: flex; flex-direction: column; height: 100%; position: relative;
}
.product-card__media{ position: relative; aspect-ratio: 1 / 1; background: var(--color-bg-muted); }
.product-card__media img{ width: 100%; height: 100%; object-fit: contain; padding: var(--space-3); }
.product-card__badges{ position: absolute; top: var(--space-2); left: var(--space-2); display: flex; flex-direction: column; gap: 4px; }
.product-card__fav{ position: absolute; top: var(--space-2); right: var(--space-2); width: 32px; height: 32px; border-radius: var(--radius-pill); background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: center; }
.product-card__body{ padding: var(--space-3); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card__brand{ font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .02em; }
.product-card__title{ font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.product-card__meta{ font-size: 12px; color: var(--color-text-muted); }
.product-card__price-row{ margin-top: auto; display: flex; align-items: baseline; gap: 6px; padding-top: var(--space-2); }
.product-card__price{ font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.product-card__price-old{ font-size: 12px; color: var(--color-text-muted); text-decoration: line-through; }
.product-card__add{ margin-top: var(--space-2); }

/* ==========================================================================
   8. Breadcrumbs
   ========================================================================== */

.breadcrumbs{ display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--color-text-muted); padding: var(--space-3) 0; }
.breadcrumbs a{ color: var(--color-text-muted); }
.breadcrumbs a:hover{ color: var(--color-primary); }
.breadcrumbs__sep{ opacity: .5; }

/* ==========================================================================
   9. Single product
   ========================================================================== */

.product-page{ display: grid; gap: var(--space-6); padding-bottom: var(--space-8); }
@media (min-width: 1024px){ .product-page{ grid-template-columns: 1fr 1fr; align-items: start; } }
.product-gallery__main{ aspect-ratio: 1/1; background: var(--color-bg-muted); border-radius: var(--radius-lg); overflow: hidden; }
.product-gallery__main img{ width: 100%; height: 100%; object-fit: contain; padding: var(--space-5); }
.product-gallery__thumbs{ display: flex; gap: var(--space-2); margin-top: var(--space-3); overflow-x: auto; }
.product-gallery__thumbs img{ width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 4px; background: #fff; }

.product-summary__title{ font-size: 22px; }
.product-summary__sub{ color: var(--color-text-muted); font-size: 14px; margin-bottom: var(--space-3); }
.product-summary__price-row{ display: flex; align-items: baseline; gap: var(--space-3); margin: var(--space-4) 0; }
.product-summary__price{ font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.product-summary__price-old{ font-size: 16px; color: var(--color-text-muted); text-decoration: line-through; }
.product-summary__availability{ display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); font-size: 14px; }
.product-summary__delivery{ background: var(--color-accent-tint); border-radius: var(--radius-md); padding: var(--space-3); font-size: 13px; margin-bottom: var(--space-4); }
/* .quantity is WooCommerce's own wrapper, always in the server-rendered
   HTML; .qty-stepper is a class main.js (`initQtyStepper`) adds to that
   same element once it runs, together with the +/- buttons. Styling both
   selectors identically means the box already has its border/height on
   first paint instead of showing a bare native number input until JS
   catches up. */
.quantity, .qty-stepper{ display: inline-flex; align-items: center; border: 1px solid var(--color-border); border-radius: var(--radius-md); height: 48px; }
.quantity button, .qty-stepper button{ width: 44px; height: 100%; border: 0; background: transparent; font-size: 18px; }
.quantity input.qty, .qty-stepper input{ width: 40px; text-align: center; border: 0; -moz-appearance: textfield; }
.product-summary__cta{ display: flex; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap; }

/* Sticky mobile add-to-cart bar */
.mobile-buybar{
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); z-index: var(--z-bottom-nav);
  min-height: var(--mobile-buybar-height);
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4); display: flex; gap: var(--space-3); align-items: center;
}
@media (min-width: 1024px){ .mobile-buybar{ display: none; } }

/* ==========================================================================
   10. Cart
   ========================================================================== */

.cart-page__title{ margin-top: var(--space-4); font-size: 24px; }
.cart-page{ display: grid; gap: var(--space-6); padding-bottom: var(--space-8); align-items: start; }
@media (min-width: 900px){ .cart-page{ grid-template-columns: 1.6fr 1fr; } }

.cart-lines{ border-top: 1px solid var(--color-border); }
.cart-line{
  display: grid; grid-template-columns: 72px 1fr auto; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border);
}
.cart-line__img-link{ display: block; width: 72px; height: 72px; border-radius: var(--radius-sm); background: var(--color-bg-muted); flex-shrink: 0; }
.cart-line__img-link img{ width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cart-line__body{ min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cart-line__title{ font-size: 14px; font-weight: 600; line-height: 1.35; }
.cart-line__meta{ font-size: 12px; color: var(--color-text-muted); }
.cart-line__meta:empty{ display: none; }
.cart-line__row{ display: flex; align-items: center; gap: var(--space-3); margin-top: 4px; }
.cart-line__remove{
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: var(--radius-pill); color: var(--color-text-muted); flex-shrink: 0;
}
.cart-line__remove:hover{ color: var(--color-danger); background: var(--color-bg-muted); }
.cart-line__price{ font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-line .qty-stepper{ height: 40px; }
.cart-line .qty-stepper__input, .cart-line .qty{ width: 36px; }

.cart-page__actions{ display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-4); flex-wrap: wrap; }
.cart-coupon summary{ cursor: pointer; font-size: 13px; color: var(--color-primary); font-weight: 600; list-style: none; }
.cart-coupon summary::-webkit-details-marker{ display: none; }
.cart-coupon[open] summary{ margin-bottom: var(--space-2); }

.cart-summary{ background: var(--color-bg-muted); border-radius: var(--radius-md); padding: var(--space-4); position: sticky; top: calc(var(--header-height) + var(--space-3)); }
.cart_totals h2{ font-size: 16px; margin-bottom: var(--space-3); }
.cart-summary__row{ display: flex; justify-content: space-between; font-size: 14px; margin-bottom: var(--space-2); }
.cart-summary__total{ font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; border-top: 1px solid var(--color-border); padding-top: var(--space-3); margin-top: var(--space-3); }

/* WooCommerce's default AJAX "View cart" link after add-to-cart */
.added_to_cart.wc-forward{
  display: inline-flex; align-items: center; gap: 4px; margin-top: var(--space-2);
  font-size: 13px; font-weight: 600; color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px;
}

/* ==========================================================================
   11. Checkout (guest, ≤3 steps after cart)
   ========================================================================== */

.checkout-page__title{ margin-top: var(--space-4); font-size: 24px; }
.checkout-page{ display: grid; gap: var(--space-6); padding-bottom: var(--space-8); align-items: start; }
@media (min-width: 900px){ .checkout-page{ grid-template-columns: 1.5fr 1fr; } }
.checkout-page__sidebar{ background: var(--color-bg-muted); border-radius: var(--radius-md); padding: var(--space-4); }
@media (min-width: 900px){ .checkout-page__sidebar{ position: sticky; top: calc(var(--header-height) + var(--space-3)); } }
.checkout-page__sidebar #order_review_heading{ font-size: 16px; margin-bottom: var(--space-3); }

#customer_details{ margin-bottom: var(--space-5); }
.woocommerce-billing-fields h3{ font-size: 16px; margin-bottom: var(--space-3); }
.woocommerce-shipping-fields{ display: none; } /* billing doubles as shipping — see woocommerce_ship_to_destination */

.woocommerce-additional-fields h3{ font-size: 16px; margin: var(--space-4) 0 var(--space-3); }

/* Classic WooCommerce form-row markup */
.form-row{ margin-bottom: var(--space-3); }
.form-row label{ display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-row label .required{ color: var(--color-danger); text-decoration: none; }
.form-row .woocommerce-input-wrapper{ display: block; }
.form-row input.input-text, .form-row textarea, .form-row select,
.select2-container .select2-selection--single{
  width: 100%; height: 48px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 0 var(--space-3); background: var(--color-surface); font-family: var(--font-base); font-size: 15px;
}
.form-row textarea{ height: auto; min-height: 88px; padding-top: var(--space-3); }
.form-row input.input-text:focus, .form-row textarea:focus{ outline: 2px solid var(--color-primary); outline-offset: 1px; }
.select2-container .select2-selection--single{ display: flex; align-items: center; }
.select2-container .select2-selection__arrow{ height: 46px !important; }
@media (min-width: 560px){
  .form-row-first{ float: left; width: 48%; }
  .form-row-last{ float: right; width: 48%; }
  .form-row-wide{ clear: both; }
}
.woocommerce-invalid .form-row input.input-text{ border-color: var(--color-danger); }
.woocommerce-form__label-for-checkbox{ display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; }

.checkout-review__lines{ border-top: 1px solid var(--color-border); margin-bottom: var(--space-3); }
.checkout-review__line{ display: grid; grid-template-columns: 44px 1fr auto; gap: var(--space-2); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); font-size: 13px; }
.checkout-review__line-img img{ width: 44px; height: 44px; object-fit: contain; background: var(--color-bg-muted); border-radius: var(--radius-sm); }
.checkout-review__line-name{ font-weight: 600; }
.checkout-review__line-qty{ font-weight: 400; color: var(--color-text-muted); }
.checkout-review__line-total{ font-variant-numeric: tabular-nums; white-space: nowrap; }
.checkout-review__shipping select{ margin-top: 4px; }

/* ==========================================================================
   11b. Contacts page (page-contacts.php)
   ========================================================================== */

.contacts-page{ display: grid; grid-template-columns: 1fr; gap: var(--space-5); margin-top: var(--space-5); }
@media (min-width: 900px){ .contacts-page{ grid-template-columns: minmax(320px, 420px) 1fr; align-items: start; } }

.contacts-page__info{ display: flex; flex-direction: column; gap: var(--space-4); }

.contacts-page__block{
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.contacts-page__row{ display: flex; align-items: flex-start; gap: var(--space-3); }
.contacts-page__row--link{ color: inherit; text-decoration: none; }
.contacts-page__row--link:hover .contacts-page__row-value{ color: var(--color-primary); }
.contacts-page__icon{
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--color-accent-tint); color: var(--color-primary);
}
.contacts-page__row-label{ display: block; font-size: 12px; color: var(--color-text-muted); margin-bottom: 2px; }
.contacts-page__row-value{ display: block; font-size: 15px; font-weight: 700; color: var(--color-text); word-break: break-word; }

.contacts-page__note{ font-size: 13px; color: var(--color-text-muted); margin: 0; }
.contacts-page__note a{ color: var(--color-primary); }

.contacts-page__requisites, .contacts-page__license{
  background: var(--color-bg-muted); border-radius: var(--radius-md); padding: var(--space-4);
}
.contacts-page__requisites h2, .contacts-page__license h2{ font-size: 15px; margin: 0 0 var(--space-2); }
.contacts-page__requisites p, .contacts-page__license p{ font-size: 13px; color: var(--color-text-muted); margin: 0; }
.contacts-page__requisites-link{ display: inline-block; margin-top: var(--space-2); font-size: 13px; font-weight: 700; color: var(--color-primary); }

.contacts-page__map{
  border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card); min-height: 320px; background: var(--color-bg-muted);
}
.contacts-page__map iframe{ width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }
@media (min-width: 900px){
  .contacts-page__map{ height: 100%; }
  .contacts-page__map iframe{ min-height: 480px; }
}

/* ==========================================================================
   12. Notices / empty / loading states
   ========================================================================== */

.woocommerce-message, .woocommerce-error, .woocommerce-info, .notice-box{
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); font-size: 14px; list-style: none;
}
.woocommerce-message{ background: var(--color-badge-instock-bg); color: var(--color-badge-instock-text); }
.woocommerce-error{ background: #FDEBEB; color: var(--color-danger); }
.woocommerce-info{ background: #EAF1FB; color: #24548F; }

.empty-state{ text-align: center; padding: var(--space-8) var(--space-4); color: var(--color-text-muted); }
.empty-state svg{ margin: 0 auto var(--space-4); opacity: .6; }

.skeleton{ background: linear-gradient(90deg, var(--color-bg-muted) 25%, #EDEFEE 37%, var(--color-bg-muted) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-loading{ 0%{ background-position: 100% 50%; } 100%{ background-position: 0 50%; } }

/* ==========================================================================
   13. Footer
   ========================================================================== */

.site-footer{ background: var(--color-bg-muted); margin-top: var(--space-8); padding: var(--space-7) 0 var(--space-8); }
.site-footer__grid{ display: grid; gap: var(--space-5); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px){ .site-footer__grid{ grid-template-columns: repeat(4, 1fr); } }
.site-footer__col h4{ font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.site-footer__col a{ display: block; font-size: 14px; margin-bottom: var(--space-2); color: var(--color-text); }
.site-footer__bottom{ border-top: 1px solid var(--color-border); margin-top: var(--space-6); padding-top: var(--space-5); font-size: 12px; color: var(--color-text-muted); }

/* ==========================================================================
   13b. Cookie consent
   ========================================================================== */

.cookie-consent{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-drawer);
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  padding: var(--space-4) 0; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
}
@media (max-width: 1023px){
  .cookie-consent{ bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); padding-bottom: var(--space-4); }
}
.cookie-consent[hidden]{ display: none; }
.cookie-consent__inner{ display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.cookie-consent__text{ flex: 1 1 320px; margin: 0; font-size: 13px; color: var(--color-text-muted); }
.cookie-consent__text a{ color: var(--color-primary); text-decoration: underline; }
.cookie-consent__actions{ display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cookie-consent__settings{ flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border); margin-top: var(--space-1); }
.cookie-consent__settings[hidden]{ display: none; }
.cookie-consent__toggle{ display: flex; align-items: center; gap: var(--space-2); font-size: 13px; }

/* ==========================================================================
   14. Utility
   ========================================================================== */

.visually-hidden{ position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-muted{ color: var(--color-text-muted); }
.mt-0{ margin-top: 0; }
