/*
 Theme Name:   Storefront Child — DSK
 Template:     storefront
 Version:      1.1.0
*/

:root {
  --shop-kg-primary: #e65100;
  --shop-kg-primary-dark: #bf360c;
  --shop-kg-primary-light: #ff9800;
  --shop-kg-header: #1a2332;
  --shop-kg-header-2: #243447;
  --shop-kg-surface: #f4f6f8;
  --shop-kg-card: #ffffff;
  --shop-kg-text: #37474f;
  --shop-kg-heading: #1a2332;
  --shop-kg-success: #2e7d32;
  --shop-kg-sale: #d84315;
  --shop-kg-shadow: 0 4px 20px rgba(26, 35, 50, 0.08);
}

/* ——— Top promo bar ——— */
.shop-kg-topbar {
  background: linear-gradient(90deg, var(--shop-kg-primary-dark), var(--shop-kg-primary));
  color: #fff;
  font-size: 0.875rem;
  padding: 0.45rem 0;
  text-align: center;
}

.shop-kg-topbar span + span::before {
  content: " · ";
}
.shop-kg-topbar-phone {
  white-space: nowrap;
}
@media (max-width: 767px) {
  .shop-kg-topbar {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
  }
  .shop-kg-topbar-pay {
    display: none;
  }
}
.shop-kg-topbar a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}

/* ——— Header ——— */
.site-header {
  background: var(--shop-kg-header) !important;
  border-bottom: none !important;
  box-shadow: var(--shop-kg-shadow);
}

.site-header .site-branding .site-title a,
.site-header .site-branding .site-description,
.site-header .main-navigation a,
.site-header .site-search,
.shop-kg-header-phone {
  color: #fff !important;
}

.site-header .main-navigation a:hover {
  color: var(--shop-kg-primary-light) !important;
}


.shop-kg-header-phone {
  display: inline-block;
  margin-left: 1rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-weight: 600;
}

/* ——— Body & layout ——— */
body,
.site-content {
  background-color: var(--shop-kg-surface) !important;
}

.col-full {
  max-width: 1280px;
}

/* ——— Homepage hero ——— */
.home .site-content .wp-block-heading {
  color: var(--shop-kg-heading) !important;
  font-size: 2rem;
}

.home .wp-block-button__link {
  background: var(--shop-kg-primary) !important;
  border-color: var(--shop-kg-primary) !important;
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
  padding: 0.75rem 2rem;
}

.home .wp-block-button__link:hover {
  background: var(--shop-kg-primary-dark) !important;
  border-color: var(--shop-kg-primary-dark) !important;
}

/* ——— Product cards ——— */
.woocommerce ul.products li.product {
  background: var(--shop-kg-card);
  border-radius: 8px;
  box-shadow: var(--shop-kg-shadow);
  border: 1px solid #e8ecef;
  padding-bottom: 1rem !important;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(230, 81, 0, 0.15);
  border-color: var(--shop-kg-primary-light);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  color: var(--shop-kg-heading) !important;
  font-weight: 600;
}

.woocommerce ul.products li.product .price {
  color: var(--shop-kg-primary-dark) !important;
  font-weight: 700;
  font-size: 1.1em;
}

.woocommerce ul.products li.product .price del {
  color: #90a4ae;
}

.product-sku {
  display: block;
  font-size: 0.8em;
  color: #78909c;
  margin-bottom: 0.35em;
}

.woocommerce span.onsale {
  background: var(--shop-kg-sale) !important;
  color: #fff !important;
  border-radius: 4px;
  font-weight: 600;
}

/* ——— Buttons (override Storefront gray inline styles) ——— */
.button,
button,
input[type="submit"],
.add_to_cart_button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background-color: var(--shop-kg-primary) !important;
  border-color: var(--shop-kg-primary) !important;
  color: #fff !important;
  border-radius: 6px !important;
  font-weight: 600;
}

.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background-color: var(--shop-kg-primary-dark) !important;
  border-color: var(--shop-kg-primary-dark) !important;
  color: #fff !important;
}

/* ——— Sidebar filters ——— */
.widget {
  background: var(--shop-kg-card);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shop-kg-shadow);
  border-left: 4px solid var(--shop-kg-primary);
}

.widget .widget-title,
.widgettitle {
  color: var(--shop-kg-heading) !important;
  border-bottom: 2px solid var(--shop-kg-primary-light);
  padding-bottom: 0.5rem;
}

/* ——— Breadcrumb & archive title ——— */
.woocommerce-breadcrumb a {
  color: var(--shop-kg-primary) !important;
}

.woocommerce-products-header__title,
.page-title {
  color: var(--shop-kg-heading) !important;
}

/* ——— Footer ——— */
.site-footer {
  background: var(--shop-kg-header) !important;
  color: #b0bec5 !important;
  padding-top: 2rem;
}

.site-footer a,
.site-footer .widget a {
  color: var(--shop-kg-primary-light) !important;
}

.site-footer .site-info {
  color: #90a4ae !important;
}

.storefront-handheld-footer-bar {
  background: var(--shop-kg-header-2) !important;
}

.storefront-handheld-footer-bar ul li > a {
  color: #fff !important;
}

/* ——— Category menu accents ——— */
.main-navigation ul.menu > li.menu-item-type-taxonomy > a {
  font-weight: 600;
}

/* ——— Stock badge (loop) ——— */
.woocommerce ul.products li.product .in-stock {
  color: var(--shop-kg-success);
  font-weight: 600;
  font-size: 0.85em;
}

@media (min-width: 768px) {
  .woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .woocommerce ul.products::before,
  .woocommerce ul.products::after {
    display: none;
  }

  .woocommerce ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
  }
}

@media (min-width: 1200px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ——— Fixes 2026-11-09 ——— */
/* Product gallery: image fills its column so the zoom icon sits on the image. */
.woocommerce-product-gallery .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
}
.woocommerce-product-gallery {
  border-radius: 8px;
  overflow: hidden;
}

/* Price filter: label on its own line instead of wrapping beside the button. */
.widget_price_filter .price_slider_amount {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.widget_price_filter .price_slider_amount .price_label {
  order: -1;
  width: 100%;
  text-align: left;
}

/* Sorting dropdown matches the rest of the UI. */
.woocommerce-ordering select.orderby {
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  background-color: #fff;
  color: var(--shop-kg-text);
}

/* Checkout: city <select> looks like the other inputs. */
.woocommerce-checkout select#billing_city,
.woocommerce-checkout select#shipping_city,
.woocommerce-account select#billing_city,
.woocommerce-account select#shipping_city {
  width: 100%;
  padding: 0.6180469716em;
  background-color: #f2f2f2;
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.125);
  color: var(--shop-kg-text);
  font-size: 1rem;
}

/* Photo credits page */
.shop-kg-credits {
  list-style: none;
  margin: 0;
}
.shop-kg-credits li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e8ecef;
}
.shop-kg-credits img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 80px;
}
.shop-kg-photo-credits-link a {
  color: #b0bec5 !important;
  font-size: 0.85rem;
}

/* Delivery rates table */
.shop-kg-rates {
  max-width: 480px;
  background: var(--shop-kg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shop-kg-shadow);
}
.shop-kg-rates thead th {
  background: var(--shop-kg-header) !important;
  color: #fff !important;
}
.shop-kg-rates td:last-child,
.shop-kg-rates th:last-child {
  text-align: right;
  white-space: nowrap;
}

/* 404: Storefront prints its own "Категории товаров" heading above the widget, which repeats it. */
.error404 .widget_product_categories .widget-title {
  display: none;
}

/* ===================== Design polish 2026-11-09 ===================== */

/* Product cards: equal height, "В корзину" pinned to the bottom so buttons line up per row. */
ul.products li.product {
  display: flex !important;
  flex-direction: column;
}
ul.products li.product > a.woocommerce-LoopProduct-link {
  flex: 1 1 auto;
}
ul.products li.product > .button,
ul.products li.product > .added_to_cart {
  align-self: center;
  margin-top: auto;
}
ul.products li.product .added_to_cart {
  margin-top: 0.5rem;
}

/* Header search: plain rounded field, not a sidebar card. */
.site-header .site-search .widget,
.site-header .widget_product_search {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.site-header .site-search input.search-field {
  background: #fff !important;
  border-radius: 6px !important;
  border: 0 !important;
  padding-top: 0.7em !important;
  padding-bottom: 0.7em !important;
}

/* Front page */
.shop-kg-hero {
  padding: 2rem 1rem 1rem;
}
.shop-kg-hero h1 {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--shop-kg-heading);
}
.shop-kg-benefits {
  list-style: none;
  margin: 1.5rem 0 2.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.shop-kg-benefits li {
  background: var(--shop-kg-card);
  border-radius: 8px;
  border-left: 4px solid var(--shop-kg-primary);
  box-shadow: var(--shop-kg-shadow);
  padding: 1rem 1.25rem;
}
.shop-kg-benefits strong {
  display: block;
  color: var(--shop-kg-heading);
}
.shop-kg-benefits span {
  font-size: 0.875rem;
  color: #78909c;
}
.shop-kg-section-title {
  margin: 2rem 0 1rem;
  font-weight: 600;
  color: var(--shop-kg-heading);
}
ul.products li.product-category img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
ul.products li.product-category .woocommerce-loop-category__title {
  padding: 0.75rem 0.5rem 0.25rem;
  font-size: 1rem;
  color: var(--shop-kg-heading);
}
ul.products li.product-category mark.count {
  background: transparent;
  color: #78909c;
  font-weight: 400;
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 0 !important;
}
.shop-kg-footer {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}
.shop-kg-footer ul {
  list-style: none;
  margin: 0;
}
.shop-kg-footer li {
  margin-bottom: 0.4rem;
}
.shop-kg-footer a {
  color: #cfd8dc !important;
  text-decoration: none;
}
.shop-kg-footer a:hover {
  color: var(--shop-kg-primary-light) !important;
}
.shop-kg-footer-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}
.shop-kg-footer-title {
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.shop-kg-footer-phone {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff !important;
}
.shop-kg-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem 0 1.5rem;
  font-size: 0.85rem;
}
.shop-kg-footer-bottom a {
  color: #90a4ae !important;
}

/* Mobile */
@media (max-width: 767px) {
  .shop-kg-hero h1 {
    font-size: 1.6rem;
  }
  .shop-kg-benefits {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .shop-kg-benefits li {
    padding: 0.75rem;
  }
  /* two products per row instead of one huge card */
  .site-main ul.products.columns-3 li.product,
  .site-main ul.products.columns-4 li.product,
  .site-main ul.products.columns-5 li.product {
    width: 48% !important;
    float: left !important;
    margin-right: 4% !important;
    clear: none !important;
  }
  .site-main ul.products li.product:nth-child(2n) {
    margin-right: 0 !important;
  }
  .site-main ul.products li.product:nth-child(2n + 1) {
    clear: both !important;
  }
  ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.85rem !important;
  }
  ul.products li.product .button {
    font-size: 0.8rem;
    padding: 0.5em 0.9em;
  }
  .shop-kg-footer {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .shop-kg-footer-bottom {
    flex-direction: column;
    padding-bottom: 5rem; /* room for the handheld footer bar */
  }
}

/* Square product/category images everywhere in loops, whatever size the source photo has. */
ul.products li.product img.attachment-woocommerce_thumbnail,
ul.products li.product img.woocommerce-placeholder,
ul.products li.product-category img {
  width: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Front page categories: one even row of 5 (2 per row on phones), no float gaps. */
.shop-kg-cat-grid ul.products,
.home .columns-5 ul.products {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}
.home .columns-5 ul.products::before,
.home .columns-5 ul.products::after {
  display: none !important;
}
.home .columns-5 ul.products li.product-category {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
}
@media (max-width: 767px) {
  .home .columns-5 ul.products {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

/* Sticky footer: short pages (e.g. /sale/) no longer leave a grey band under the footer. */
#page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#page > .site-content {
  flex: 1 0 auto;
}

.woocommerce form .form-row.shop-kg-hidden-field {
  display: none !important;
}

/* ===== Header layout (docs/2.png) =====
   Top bar: info left, service menu right.
   Row 1:   logo | search | ♡ wishlist | cart (icon + count + total).
   Row 2:   «Каталог» + quick links. Colours stay the store palette. */

/* Top bar */
.shop-kg-topbar .col-full {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.shop-kg-topbar-info {
  text-align: left;
}
.shop-kg-topbar-menu {
  display: flex;
  gap: 1.25rem;
  white-space: nowrap;
}
.shop-kg-topbar .shop-kg-topbar-menu a {
  font-weight: 400;
  text-decoration: none;
}
.shop-kg-topbar .shop-kg-topbar-menu a:hover {
  text-decoration: underline;
}
@media (max-width: 1099px) {
  .shop-kg-topbar-pay {
    display: none;
  }
}
@media (max-width: 767px) {
  .shop-kg-topbar .col-full {
    justify-content: center;
  }
  .shop-kg-topbar-info {
    text-align: center;
  }
  .shop-kg-topbar-menu {
    display: none; /* the same links are in the mobile menu */
  }
}

/* Icons with a count badge (wishlist, cart) */
.shop-kg-hicon {
  position: relative;
  display: inline-flex;
  line-height: 0;
}
.shop-kg-badge {
  position: absolute;
  top: -6px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--shop-kg-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  text-indent: 0;
}

@media (min-width: 768px) {
  #masthead {
    padding-top: 1.25rem !important;
    padding-bottom: 0 !important;
  }

  /* Row 1 */
  #masthead > .col-full {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-bottom: 1rem;
  }
  #masthead > .col-full::before,
  #masthead > .col-full::after {
    display: none !important;
  }
  #masthead > .col-full > .site-branding {
    float: none !important;
    width: auto !important;
    flex: 0 0 auto;
    margin: 0 !important;
  }
  #masthead > .col-full > .site-branding .site-title {
    margin: 0 !important;
  }
  #masthead > .col-full > .site-search {
    float: none !important;
    width: auto !important;
    flex: 0 1 460px;
    min-width: 0;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
  }
  #masthead > .col-full > .site-search form {
    display: flex;
    align-items: stretch;
    margin: 0 !important;
  }
  .site-header .site-search input.search-field {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 6px 0 0 6px !important;
  }
  .site-header .site-search form button[type="submit"] {
    position: static !important;
    clip: auto !important;
    clip-path: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 1.25rem !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 6px 6px 0 !important; /* overrides the global 6px button radius */
    background: var(--shop-kg-primary) !important;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
  }
  .site-header .site-search form button[type="submit"]:hover {
    background: var(--shop-kg-primary-dark);
  }

  .shop-kg-header-actions {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    flex: 0 0 auto;
  }
  .shop-kg-wishlist {
    color: #fff !important;
    display: inline-flex;
  }
  .shop-kg-wishlist:hover,
  .site-header .site-header-cart .cart-contents:hover {
    color: var(--shop-kg-primary-light) !important;
  }

  /* Cart: icon + "Итого / total"; Storefront's mini-cart still drops down on hover */
  .site-header .site-header-cart {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    position: relative;
  }
  .site-header .site-header-cart .cart-contents {
    display: flex !important;
    align-items: center;
    gap: 0.9rem;
    padding: 0.25rem 0 !important;
    background: transparent !important;
    color: #fff !important;
    white-space: nowrap;
  }
  .site-header .site-header-cart .cart-contents::after {
    display: none !important;
  }
  .shop-kg-cart-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }
  .shop-kg-cart-label {
    font-size: 0.75rem;
    opacity: 0.75;
  }
  .shop-kg-cart-total {
    font-weight: 700;
  }
  .site-header .site-header-cart .widget_shopping_cart {
    width: 320px !important;
  }
  .site-header .site-header-cart:hover .widget_shopping_cart,
  .site-header .site-header-cart.focus .widget_shopping_cart {
    left: auto !important;
    right: 0;
  }

  /* Row 2 */
  #masthead .storefront-primary-navigation {
    padding-bottom: 1rem;
  }
  #masthead .storefront-primary-navigation > .col-full {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
  #masthead .storefront-primary-navigation > .col-full::before,
  #masthead .storefront-primary-navigation > .col-full::after {
    display: none !important;
  }
  #masthead .storefront-primary-navigation .main-navigation {
    float: none !important;
    width: auto !important;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
  }
}

/* Search icon: centred in the field */
.site-header .widget_product_search form::before {
  top: 50% !important;
  transform: translateY(-50%);
}

@media (min-width: 768px) and (max-width: 1099px) {
  #masthead > .col-full,
  #masthead .storefront-primary-navigation > .col-full {
    gap: 1.25rem;
  }
  .shop-kg-header-actions {
    gap: 1.25rem;
  }
  .shop-kg-cart-label {
    display: none;
  }
}
@media (min-width: 768px) and (max-width: 860px) {
  .shop-kg-cart-text {
    display: none; /* icon + count only */
  }
}

/* Mobile: wishlist and cart live in the bottom bar */
@media (max-width: 767px) {
  .shop-kg-header-actions {
    display: none;
  }
}
.storefront-handheld-footer-bar ul li.wishlist > a {
  color: inherit;
}
.storefront-handheld-footer-bar ul li.wishlist > a .shop-kg-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
}
.storefront-handheld-footer-bar ul li.wishlist > a .shop-kg-badge {
  top: 0.7em;
  right: auto;
  left: 50%;
  margin-left: 4px;
}

/* Header cart: Storefront dims .count and keeps spans inline */
.site-header .site-header-cart .cart-contents .shop-kg-badge.count {
  opacity: 1 !important;
  font-size: 11px !important;
  background: var(--shop-kg-primary) !important;
  color: #fff !important;
}
@media (min-width: 768px) {
  .site-header .site-header-cart .cart-contents .shop-kg-cart-text {
    display: flex !important;
    flex-direction: column;
  }
  .site-header .site-header-cart .cart-contents .shop-kg-cart-text > span {
    display: block !important;
  }
}
@media (min-width: 768px) and (max-width: 860px) {
  .site-header .site-header-cart .cart-contents .shop-kg-cart-text {
    display: none !important;
  }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .shop-kg-topbar-info > span:first-child {
    display: none; /* keep the top bar on one line */
  }
  .shop-kg-topbar-info > span:nth-child(2)::before {
    content: none;
  }
}

/* Wishlist heart on product cards: small white circle over the image */
ul.products li.product {
  position: relative;
}
ul.products li.product .yith-wcwl-add-to-wishlist-button-over-image {
  position: absolute !important;
  top: 0.6rem !important;
  right: 0.6rem !important;
  left: auto !important;
  z-index: 2;
  width: 36px !important;
  height: 36px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--shop-kg-primary) !important;
  box-shadow: 0 1px 4px rgba(26, 35, 50, 0.2);
}
ul.products li.product .yith-wcwl-add-to-wishlist-button-over-image:hover {
  background: #fff !important;
}
ul.products li.product .yith-wcwl-add-to-wishlist-button-over-image svg {
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  color: var(--shop-kg-primary) !important;
}

/* Wishlist on the product page: quiet text link with a heart, not a second orange button */
.single-product div.product .summary .yith-wcwl-add-to-wishlist-button {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 1rem !important;
  padding: 0.3rem 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--shop-kg-primary) !important;
  font-weight: 600;
}
.single-product div.product .summary .yith-wcwl-add-to-wishlist-button svg {
  width: 20px !important;
  height: 20px !important;
  color: var(--shop-kg-primary) !important;
}
.single-product div.product .summary .yith-wcwl-add-to-wishlist-button:hover {
  color: var(--shop-kg-primary-dark) !important;
  text-decoration: underline;
}

/* Wishlist page: the page already has the "Избранное" title */
.wishlist-title-container {
  display: none !important;
}

/* Wishlist table: YITH's add-to-cart link has no .button class, so it gets colours but no padding */
.wishlist_table .product-add-to-cart a.add_to_cart_button,
.wishlist_table .product-add-to-cart a.added_to_cart {
  display: inline-block;
  padding: 0.6em 1.4em !important;
  border-radius: 6px !important;
  line-height: 1.2;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
}
.wishlist_table .product-add-to-cart a.add_to_cart_button:hover {
  background-color: var(--shop-kg-primary-dark) !important;
}
.wishlist_table .product-remove a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--shop-kg-text) !important;
  font-size: 22px !important;
  line-height: 1 !important;
  text-indent: 0 !important; /* Storefront hides the × and draws an icon-font glyph instead */
  text-decoration: none;
}
.wishlist_table .product-remove a.remove::before {
  content: none !important;
}
.wishlist_table .product-remove a.remove:hover {
  background: var(--shop-kg-sale) !important;
  color: #fff !important;
}
.wishlist_table td {
  vertical-align: middle !important;
}

/* Wishlist, mobile template (YITH serves it to phones): cards instead of an oversized list */
ul.wishlist_table.mobile {
  margin: 0;
  list-style: none;
}
ul.wishlist_table.mobile > li {
  margin: 0 0 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shop-kg-shadow);
}
ul.wishlist_table.mobile .product-name h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.35;
}
ul.wishlist_table.mobile table {
  width: 100%;
  margin: 0 0 0.75rem;
  border: 0;
}
ul.wishlist_table.mobile td {
  padding: 0.2rem 0 !important;
  background: transparent !important;
  border: 0 !important;
  font-size: 0.875rem;
}
ul.wishlist_table.mobile td.value {
  text-align: right;
}
ul.wishlist_table.mobile .product-add-to-cart {
  text-align: center;
}
ul.wishlist_table.mobile .product-add-to-cart a.add_to_cart_button {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0.75em 1em !important;
  border-radius: 6px !important;
  text-align: center;
  text-decoration: none !important;
  font-weight: 600;
}
/* The trash icon needs Font Awesome 4, which is not loaded: show a text link instead */
ul.wishlist_table.mobile .product-remove {
  float: none !important;
  margin-top: 0.6rem;
  text-align: center !important;
}
ul.wishlist_table.mobile .product-remove a.remove_from_wishlist {
  font-size: 0.875rem;
  color: var(--shop-kg-text);
}
ul.wishlist_table.mobile .product-remove a.remove_from_wishlist .fa {
  display: none;
}
ul.wishlist_table.mobile .product-remove a.remove_from_wishlist::after {
  content: "Удалить из избранного";
}

/* The wishlist block sits above the image and carries YITH's 7px margin: keep it out of the flow
   so the photo starts at the card's top edge (the heart itself is absolutely positioned). */
ul.products li.product > .yith-add-to-wishlist-button-block {
  position: static !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Product cards: the photo stays edge to edge, the text below gets side padding
   so long names never touch the card's borders. */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product .product-sku,
ul.products li.product .in-stock,
ul.products li.product .price,
ul.products li.product .star-rating {
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
  overflow-wrap: break-word;
  hyphens: auto;
}
ul.products li.product .star-rating {
  margin-left: auto;
  margin-right: auto;
}
ul.products li.product > .button,
ul.products li.product > .added_to_cart {
  max-width: calc(100% - 1.7rem);
}
@media (max-width: 767px) {
  ul.products li.product .woocommerce-loop-product__title,
  ul.products li.product .product-sku,
  ul.products li.product .in-stock,
  ul.products li.product .price {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
  }
}

/* Phones: two-column product grid with even gaps (Storefront's float layout adds ~4em
   bottom margin per card, which left big holes between rows). */
@media (max-width: 767px) {
  .site-main ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .site-main ul.products::before,
  .site-main ul.products::after {
    display: none !important;
  }
  .site-main ul.products.columns-3 li.product,
  .site-main ul.products.columns-4 li.product,
  .site-main ul.products.columns-5 li.product,
  .site-main ul.products li.product {
    width: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
  }
}

/* Filters: YITH widget + price widget look like one card, one reset button at the bottom */
#secondary .widget_yith-woocommerce-ajax-navigation-filters {
  margin-bottom: 0 !important;
  padding-bottom: 0.25rem;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: none;
}
#secondary .widget_yith-woocommerce-ajax-navigation-filters + .widget_price_filter {
  margin-top: 0 !important;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: none;
  position: relative;
}
#secondary .widget_yith-woocommerce-ajax-navigation-filters + .widget_price_filter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  border-top: 1px solid #eceff1;
}
#secondary .widget_yith-woocommerce-ajax-navigation-filters + .widget_price_filter .widget-title {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0.7rem;
  font-size: 19.8px; /* same as YITH's .filter-title */
  color: #434343 !important;
}
#secondary a.button.shop-kg-filters-reset {
  display: block !important;
  width: 100%;
  margin-top: 1rem;
  text-align: center;
  background: transparent !important;
  background-color: transparent !important;
  border: 1px solid var(--shop-kg-primary) !important;
  color: var(--shop-kg-primary) !important;
}
#secondary a.button.shop-kg-filters-reset:hover {
  background: var(--shop-kg-primary) !important;
  background-color: var(--shop-kg-primary) !important;
  color: #fff !important;
}

/* Filters card: «Фильтрация» as wide as «Сбросить фильтры» */
#secondary .widget_price_filter .price_slider_amount .button {
  flex: 1 1 100%;
  width: 100%;
  margin: 0;
  border: 1px solid var(--shop-kg-primary) !important;
  text-align: center;
}
#secondary a.button.shop-kg-filters-reset {
  margin-top: 0.6rem;
}
#secondary .widget_price_filter form,
#secondary .widget_price_filter .price_slider_wrapper,
#secondary .widget_price_filter .price_slider_amount {
  margin-bottom: 0 !important;
}
#secondary .widget_price_filter .price_slider_amount .clear {
  display: none;
}

/* ===== Cart & content pages ===== */
/* Storefront's full-width layout centres page titles and adds ~150px of air around them;
   align them with the content like the shop/category titles. */
.storefront-breadcrumb {
  margin-bottom: 1.5rem !important;
}
.storefront-full-width-content.page .entry-header {
  text-align: left !important;
  padding-bottom: 1.5rem !important;
}
.storefront-full-width-content.page .entry-header .entry-title {
  font-size: 2.2rem;
}

/* Cart table */
.woocommerce-cart table.shop_table td,
.woocommerce-cart table.shop_table th {
  vertical-align: middle;
}
.woocommerce-cart table.cart td.product-thumbnail img {
  width: 72px;
  max-width: 72px;
  border-radius: 6px;
}
.woocommerce-cart table.cart td.product-name a {
  text-decoration: none;
  font-weight: 600;
  color: var(--shop-kg-heading) !important;
}
.woocommerce-cart table.cart td.product-name a:hover {
  color: var(--shop-kg-primary) !important;
}
.woocommerce-cart table.cart td.product-subtotal {
  font-weight: 700;
}
.woocommerce-cart table.cart a.remove {
  color: #90a4ae !important;
}
.woocommerce-cart table.cart a.remove:hover {
  color: var(--shop-kg-sale) !important;
}
.woocommerce-cart table.cart .quantity .qty {
  width: 4.5em;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}
/* "Обновить корзину" alone on the actions row (coupons are off) */
.woocommerce-cart table.cart td.actions {
  text-align: right;
}

/* Totals: one background for labels and values */
.cart_totals table.shop_table th,
.cart_totals table.shop_table td {
  background: #fff !important;
}
.cart_totals .order-total th,
.cart_totals .order-total td {
  border-top: 2px solid #eceff1;
}
.cart_totals .order-total td .amount {
  font-size: 1.15em;
}
.cart_totals .woocommerce-shipping-totals td {
  color: var(--shop-kg-text);
}

/* Phones: keep the remove × inside the card */
@media (max-width: 767px) {
  .woocommerce-cart table.cart tr.cart_item td.product-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0 !important;
    border: 0 !important;
  }
  .woocommerce-cart table.cart tr.cart_item {
    position: relative;
  }
  .woocommerce-cart table.cart td.actions {
    text-align: center;
  }
  .woocommerce-cart table.cart td.actions .button {
    width: 100%;
  }
  .storefront-full-width-content.page .entry-header .entry-title {
    font-size: 1.8rem;
  }
}

/* ===== Checkout ===== */
/* Order summary: one background for labels and values; names wrap at word boundaries */
#order_review table.shop_table th,
#order_review table.shop_table td {
  background: #fff !important;
}
#order_review table.shop_table td.product-name {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: manual;
}
#order_review table.shop_table td.product-total {
  white-space: nowrap;
}
#order_review .order-total th,
#order_review .order-total td {
  border-top: 2px solid #eceff1;
}
#order_review .order-total td .amount {
  font-size: 1.15em;
}

/* Payment methods: Storefront draws the radios with Font Awesome solid glyphs, so the
   unselected one looked filled. Plain CSS rings instead: empty = not chosen, dot = chosen. */
#payment .payment_methods li input[type="radio"]:first-child + label::before {
  content: "" !important;
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 0.6em;
  border: 2px solid #90a4ae;
  border-radius: 50%;
  box-sizing: border-box;
  background: #fff;
  vertical-align: -3px;
  font-family: inherit !important;
}
#payment .payment_methods li input[type="radio"]:first-child:checked + label::before {
  border-color: var(--shop-kg-primary);
  background: var(--shop-kg-primary);
  box-shadow: inset 0 0 0 3px #fff;
}
#payment .payment_methods li > label {
  cursor: pointer;
}
/* No white strip between the methods and the «Подтвердить заказ» block */
#payment .form-row.place-order {
  margin-top: 0 !important;
}

/* «Доставка по другому адресу?»: checkbox before the text, normal heading size */
#ship-to-different-address {
  font-size: 1.15rem;
}
#ship-to-different-address label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
#ship-to-different-address input[type="checkbox"] {
  order: -1;
  position: static !important;
  float: none !important;
  margin: 0 !important;
  width: 18px;
  height: 18px;
  accent-color: var(--shop-kg-primary);
}
.woocommerce-checkout h3 {
  font-size: 1.5rem;
}
@media (max-width: 767px) {
  .woocommerce-checkout h3 {
    font-size: 1.3rem;
  }
}

/* ===== Мой аккаунт ===== */
/* Login / lost password: a compact card instead of a full-width form */
.woocommerce-account:not(.logged-in) .woocommerce form.woocommerce-form-login,
.woocommerce-account .woocommerce form.woocommerce-ResetPassword {
  max-width: 440px;
  padding: 1.5rem;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shop-kg-shadow);
}
.woocommerce-account:not(.logged-in) .woocommerce > h2 {
  font-size: 1.5rem;
}

/* Password eye: Storefront's icon button, not an orange block */
.woocommerce .show-password-input,
.woocommerce-page .show-password-input {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #90a4ae !important;
  height: 100%;
  padding: 0 0.75em !important;
}
.woocommerce .show-password-input:hover {
  color: var(--shop-kg-primary) !important;
}
.woocommerce .show-password-input.display-password::after {
  color: var(--shop-kg-primary);
}
.woocommerce .password-input {
  position: relative;
  display: block;
}

/* Account navigation: current section highlighted */
.woocommerce-MyAccount-navigation ul li.is-active a {
  color: var(--shop-kg-heading) !important;
  font-weight: 700;
}
.woocommerce-MyAccount-navigation ul li a {
  text-decoration: none;
}

/* Headings inside the account match the rest of the site (light, not bold) */
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3,
.woocommerce-MyAccount-content legend {
  font-size: 1.5rem;
  font-weight: 300;
}
.woocommerce-MyAccount-content .woocommerce-Address-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.woocommerce-MyAccount-content .woocommerce-Address-title h2 {
  margin: 0;
}
.woocommerce-MyAccount-content .woocommerce-Address-title a.edit {
  float: none !important;
}
.woocommerce-MyAccount-content address {
  font-style: normal;
  line-height: 1.6;
}
.woocommerce-MyAccount-content fieldset {
  border-radius: 8px;
}
@media (max-width: 767px) {
  .woocommerce-MyAccount-content .u-column2 {
    margin-top: 1.5rem;
  }
}
.woocommerce-MyAccount-content .woocommerce-Address-title h2 {
  text-align: left;
  flex: 1 1 auto;
}
@media (max-width: 767px) {
  /* Orders list: WooCommerce renders the order number as <th>, which Storefront hides on phones */
  .woocommerce-orders-table tbody th.woocommerce-orders-table__cell-order-number {
    display: block !important;
    padding: 0.75rem 1.4rem 0.25rem !important;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: left !important;
  }
  .woocommerce-orders-table tbody th.woocommerce-orders-table__cell-order-number::before {
    content: "Заказ ";
    font-weight: 400;
  }
  /* Notices with a button: button below the text, not on top of it */
  .woocommerce-info:has(> .button),
  .woocommerce-message:has(> .button),
  .woocommerce-error:has(> .button) {
    display: flex;
    flex-direction: column;
  }
  .woocommerce-info .button,
  .woocommerce-message .button,
  .woocommerce-error .button {
    order: 2;
    padding: 0.7em 1em !important;
    line-height: 1.3 !important;
    float: none !important;
    position: static !important;
    display: block !important;
    width: 100%;
    margin: 0.75rem 0 0 !important;
    text-align: center;
  }
  /* Address titles: heading, then the edit link */
  .woocommerce-MyAccount-content .woocommerce-Address-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
  }
}

/* Contacts block ([shop_kg_contacts]) and footer contact lines */
.shop-kg-contacts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0 0 1.5rem;
}
.shop-kg-contacts dt {
  font-weight: 600;
  color: var(--shop-kg-heading);
}
.shop-kg-contacts dd {
  margin: 0;
}
@media (max-width: 767px) {
  .shop-kg-contacts {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .shop-kg-contacts dd {
    margin-bottom: 0.6rem;
  }
}
.shop-kg-footer-line {
  margin: 0 0 0.35rem;
}
.shop-kg-footer-address {
  max-width: 22rem;
  font-size: 0.9rem;
}
