/*
Theme Name: Smart Enginiering
Theme URI: https://example.com/
Author: Valery Balashov
Author URI: https://example.com/
Description: WooCommerce theme for B2B store with invoice-based ordering
Version: 33.0
Text Domain: b2b-invoice-theme
*/

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-alt: #eef0f3;
  --surface-dark: #20232a;
  --text: #1f2937;
  --text-soft: #5f6b7a;
  --line: #dde2e8;
  --red: #c61f2a;
  --red-dark: #a31721;
  --red-soft: #fff1f2;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 20px 48px rgba(15, 23, 42, 0.12);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --container: 1240px;
  --font-main: Inter, Arial, Helvetica, sans-serif;
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { margin: 0; padding: 0; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(198,31,42,0.06), transparent 22%),
    linear-gradient(180deg, #fafbfc 0%, #f3f5f7 100%);
  line-height: 1.6;
  font-size: var(--fs-16);
}

body.admin-bar .site-header { top: 32px; }

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }

a {
  color: var(--red);
  text-decoration: none;
  transition: color .2s ease, opacity .2s ease;
}
a:hover { color: var(--red-dark); }

p, li, td, th, label, input, textarea, select, button {
  font-family: var(--font-main);
  font-size: var(--fs-16);
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  font-family: var(--font-main);
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.site-container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.site-main {
  padding: 36px 0 72px;
}

.section { padding: 72px 0; }
.section:first-child { padding-top: 40px; }

.section-title {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.section-subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--text-soft);
  font-size: var(--fs-18);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: var(--fs-12);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.btn,
.button,
.wp-element-button,
input[type="submit"],
button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, #d92835 0%, #b91520 100%);
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(198,31,42,0.22);
  cursor: pointer;
  font-weight: 800;
  font-size: var(--fs-15);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.btn:hover,
.button:hover,
.wp-element-button:hover,
input[type="submit"]:hover,
button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #c61f2a 0%, #9f151e 100%);
  box-shadow: 0 14px 28px rgba(198,31,42,0.25);
}

.btn--secondary,
.header-cart,
.woocommerce a.button.added_to_cart {
  background: rgba(255,255,255,.84) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

.btn--secondary:hover,
.header-cart:hover,
.woocommerce a.button.added_to_cart:hover {
  background: #fff !important;
  border-color: #cfd6de !important;
  color: var(--text) !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px 0 0;
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 80px;
  padding: 14px 20px;
  border: 1px solid rgba(221,226,232,0.92);
  border-radius: 22px;
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.site-logo img { width: auto; max-height: 54px; }

.site-title {
  margin: 0;
  font-size: var(--fs-24);
  font-weight: 900;
}

.site-title a { color: var(--text); }

.site-description {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: var(--fs-12);
}

.main-navigation { justify-self: center; }

.main-navigation ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--text);
  font-size: var(--fs-15);
  font-weight: 700;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
  background: var(--surface-alt);
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-phone {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.hero { padding: 36px 0 28px; }

.hero__shell {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(198,31,42,0.14), transparent 24%),
    linear-gradient(135deg, #ffffff 0%, #f6f7f9 58%, #eef1f5 100%);
  box-shadow: var(--shadow-md);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 34px;
  align-items: stretch;
}

.hero__title {
  margin: 0 0 16px;
  font-size: clamp(38px, 6vw, 66px);
  line-height: .98;
  letter-spacing: -0.05em;
  max-width: 760px;
}

.hero__text {
  margin: 0 0 26px;
  max-width: 700px;
  color: var(--text-soft);
  font-size: clamp(17px, 2.4vw, 20px);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  max-width: 760px;
}

.metric {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.76);
}

.metric strong {
  display: block;
  margin-bottom: 6px;
  font-size: 28px;
  line-height: 1;
}

.metric span {
  color: var(--text-soft);
  font-size: var(--fs-14);
  font-weight: 600;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(221,226,232,.95);
  border-radius: 28px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-sm);
}

.hero-panel__title {
  margin: 0;
  font-size: var(--fs-24);
}

.hero-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-list li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--text);
  font-weight: 600;
}

.hero-list li::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d92835 0%, #b91520 100%);
  box-shadow: 0 0 0 6px rgba(198,31,42,0.12);
}

.hero-panel__note {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-alt);
  color: var(--text-soft);
  font-size: var(--fs-14);
}

.grid-4,
.grid-3 {
  display: grid;
  gap: 20px;
}

.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }

.card {
  height: 100%;
  padding: 24px;
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-sm);
}

.card--accent {
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,241,242,0.9) 100%);
  border-color: rgba(198,31,42,0.18);
}

.card__title {
  margin: 0 0 12px;
  font-size: var(--fs-20);
}

.card__text {
  margin: 0;
  color: var(--text-soft);
}

.card__meta {
  display: inline-flex;
  margin-top: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: var(--fs-12);
  font-weight: 800;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 20px;
  counter-reset: steps;
}

.step {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-sm);
}

.step::before {
  counter-increment: steps;
  content: "0" counter(steps);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 54px;
  margin-bottom: 18px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: var(--fs-18);
  font-weight: 900;
}

.site-footer { padding: 0 0 26px; }

.site-footer__inner {
  padding: 34px 28px 22px;
  border-radius: 30px;
  background: linear-gradient(180deg, #23262c 0%, #181b20 100%);
  box-shadow: var(--shadow-md);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr .9fr .9fr;
  gap: 26px;
}

.footer-title {
  margin: 0 0 12px;
  color: #fff;
  font-size: var(--fs-18);
}

.footer-text,
.footer-list {
  margin: 0;
  color: rgba(255,255,255,0.72);
  font-size: var(--fs-15);
}

.footer-list { list-style: none; padding: 0; }
.footer-list li + li { margin-top: 10px; }
.site-footer a { color: #fff; }

.footer-bottom {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.58);
  font-size: var(--fs-14);
}

.archive-header,
.page-shell {
  padding: 28px;
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 28px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-sm);
}

.archive-title {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

.products.columns-4,
ul.products,
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 20px;
  padding: 0;
  margin: 0;
  list-style: none;
}

ul.products li.product,
.woocommerce ul.products li.product {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 18px;
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
}

.woocommerce ul.products li.product a img {
  margin: 0 0 16px !important;
  border-radius: 18px;
  background: #fff;
}

ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  margin: 0 0 10px;
  padding: 0;
  color: var(--text);
  font-size: var(--fs-20);
  line-height: 1.2;
}

.price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--red);
  font-weight: 900;
}

.single-product .product,
.woocommerce.single-product div.product {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(360px,.9fr);
  gap: 26px;
  padding: 26px;
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 30px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
}

.woocommerce div.product div.images img {
  border-radius: 24px;
  border: 1px solid rgba(221,226,232,0.95);
  background: #fff;
}

.woocommerce-product-gallery,
.woocommerce div.product div.images,
.single-product .summary {
  width: 100% !important;
  float: none !important;
}

.single-product .summary { padding: 4px 0; }

.woocommerce div.product .product_title {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.04;
}

.woocommerce-product-details__short-description,
.product_meta,
.woocommerce-tabs {
  margin-top: 20px;
}

.woocommerce-tabs ul.tabs {
  padding: 0 !important;
}

.woocommerce-tabs ul.tabs::before,
.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::after {
  display: none !important;
}

.woocommerce-tabs ul.tabs li {
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--surface-alt) !important;
  margin: 0 10px 10px 0 !important;
}

.woocommerce-tabs ul.tabs li a {
  color: var(--text) !important;
  font-weight: 800 !important;
}

.woocommerce-tabs .panel {
  padding: 22px;
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 24px;
  background: rgba(255,255,255,.74);
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  background: rgba(255,255,255,.9);
}

.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-additional-fields,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review,
.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce-cart-form {
  padding: 24px;
  border: 1px solid rgba(221,226,232,0.95);
  border-radius: 24px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
}

.woocommerce-checkout #customer_details {
  display: grid;
  gap: 20px;
}

form .form-row input.input-text,
form .form-row textarea,
form .form-row select,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid #d7dde5;
  border-radius: 16px;
  background: #fff;
  font-size: var(--fs-15);
  transition: border-color .16s ease, box-shadow .16s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(198,31,42,.45);
  box-shadow: 0 0 0 4px rgba(198,31,42,.10);
}

.woocommerce form .form-row label {
  margin-bottom: 7px;
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--text);
}

.woocommerce table.shop_table,
.shop_table {
  width: 100%;
  border: 1px solid rgba(221,226,232,0.95) !important;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,.9);
  border-collapse: separate;
  border-spacing: 0;
}

.shop_table th {
  background: var(--surface-alt);
  color: var(--text);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.b2b-note {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(198,31,42,0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,241,242,0.92) 100%);
  color: var(--text);
}

.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }

.widget { margin-bottom: 24px; }

@media (max-width: 1180px) {
  .site-header__inner { grid-template-columns: 1fr; justify-items: start; }
  .main-navigation { justify-self: start; }
  .header-actions { width: 100%; justify-content: space-between; }
  .grid-4,
  .products.columns-4,
  ul.products,
  .woocommerce ul.products,
  .steps,
  .hero-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 960px) {
  .hero__grid,
  .single-product .product,
  .woocommerce.single-product div.product,
  .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}

@media (max-width: 768px) {
  body.admin-bar .site-header { top: 46px; }
  .site-main { padding: 24px 0 54px; }
  .site-container { width: min(100% - 20px, var(--container)); }
  .site-header { padding-top: 10px; }
  .site-header__inner { padding: 14px; border-radius: 20px; gap: 14px; }
  .main-navigation ul { gap: 6px; }
  .main-navigation a { min-height: 38px; padding: 8px 12px; font-size: var(--fs-14); }
  .header-actions { flex-direction: column; align-items: stretch; }
  .header-phone, .header-cart, .btn, .btn--secondary { width: 100%; }
  .hero__shell { padding: 22px; border-radius: 26px; }
  .hero__title { font-size: 38px; }
  .hero__actions { flex-direction: column; }
  .hero-metrics,
  .grid-4,
  .grid-3,
  .steps,
  .footer-grid,
  .products.columns-4,
  ul.products,
  .woocommerce ul.products { grid-template-columns: 1fr; }
  .archive-header,
  .page-shell,
  .single-product .product,
  .woocommerce.single-product div.product,
  .woocommerce-checkout .woocommerce-billing-fields,
  .woocommerce-checkout .woocommerce-additional-fields,
  .woocommerce-checkout #order_review_heading,
  .woocommerce-checkout #order_review,
  .woocommerce-cart .cart-collaterals .cart_totals,
  .woocommerce-cart-form { padding: 18px; border-radius: 22px; }
}

/* SHOP PAGE B2B LAYOUT */
.b2b-shop-page {
    padding: 24px 0 40px;
}

.b2b-shop-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.b2b-shop-sidebar {
    position: sticky;
    top: 150px;
    align-self: start;
}

.b2b-shop-box {
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
    padding: 20px;
}

.b2b-shop-box .section-title {
    margin: 6px 0 0;
    font-size: 22px;
    line-height: 1.2;
    color: #1d3557;
}

.b2b-shop-box .eyebrow,
.b2b-shop-header .eyebrow {
    font-size: 12px;
    padding: 6px 12px;
}

.b2b-shop-searchbar {
    margin-bottom: 18px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
}

.b2b-shop-searchbar form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.b2b-shop-searchbar input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 1px solid #cfcfcf;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    background: #fff;
}

.b2b-shop-searchbar button {
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: #9f1d20;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.b2b-shop-cats {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

.b2b-shop-cat-item + .b2b-shop-cat-item {
    margin-top: 10px;
}


.b2b-shop-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background: #f7f7f7;
    color: #2c2c2c;
    text-decoration: none;
    font-weight: 500;
    transition: .2s ease;
}

.b2b-shop-cat-link:hover {
    background: #fff5f5;
    border-color: #b11f24;
    color: #b11f24;
}

.b2b-shop-cat-link strong,
.b2b-shop-cats strong {
    color: #b11f24;
    font-size: 13px;
    font-weight: 700;
}

.b2b-shop-cat-toggle {
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background: #f7f7f7;
    color: #b11f24;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.b2b-shop-cat-toggle:hover {
    background: #fff5f5;
    border-color: #b11f24;
}

.b2b-shop-cat-toggle span {
    display: inline-block;
    line-height: 1;
    transform: translateY(-1px);
}

.b2b-shop-cat-item.is-open .b2b-shop-cat-toggle span {
    transform: rotate(45deg);
}

.b2b-shop-subcats {
    display: none;
    list-style: none;
    margin: 8px 0 0;
    padding: 0 0 0 14px;
    border-left: 2px solid #e4e4e4;
}

.b2b-shop-cat-item.is-open .b2b-shop-subcats {
    display: block;
}

.b2b-shop-subcats li + li {
    margin-top: 8px;
}

.b2b-shop-subcats a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fbfbfb;
    color: #4a4a4a;
    text-decoration: none;
    border: 1px solid #ececec;
    font-size: 14px;
    transition: .2s ease;
}

.b2b-shop-subcats a:hover {
    background: #fff5f5;
    border-color: #d9b1b3;
    color: #b11f24;
}

.b2b-shop-subcats strong {
    color: #b11f24;
    font-size: 12px;
}

.b2b-shop-header {
    margin-bottom: 18px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
}

.b2b-shop-header .archive-title,
.b2b-shop-header h1 {
    margin: 6px 0 0;
    font-size: 30px;
    line-height: 1.15;
    color: #1d3557;
}

.b2b-shop-content .woocommerce-result-count {
    margin: 0 0 14px;
    color: #374151;
}

.b2b-shop-content .woocommerce-ordering {
    margin: 0 0 22px;
}

.b2b-shop-content .woocommerce-ordering select {
    min-height: 46px;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    padding: 0 14px;
    background: #fff;
}

.b2b-shop-content ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0 !important;
}

.b2b-shop-content ul.products::before,
.b2b-shop-content ul.products::after {
    display: none !important;
}

.b2b-shop-content ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

@media (max-width: 1100px) {
    .b2b-shop-layout {
        grid-template-columns: 1fr;
    }

    .b2b-shop-sidebar {
        position: static;
    }

    .b2b-shop-content ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .b2b-shop-header .archive-title,
    .b2b-shop-header h1 {
        font-size: 24px;
    }

    .b2b-shop-box .section-title {
        font-size: 18px;
    }

    .b2b-shop-searchbar form {
        flex-direction: column;
    }

    .b2b-shop-content ul.products {
        grid-template-columns: 1fr;
    }
}
/* SHOP LAYOUT */
.b2b-shop-page {
    padding: 24px 0 40px;
}

.b2b-shop-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.b2b-shop-sidebar {
    position: sticky;
    top: 150px;
    align-self: start;
}

.b2b-shop-searchbar {
    margin-bottom: 18px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
}

.b2b-shop-searchbar form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.b2b-shop-searchbar input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 1px solid #cfcfcf;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    background: #fff;
}

.b2b-shop-searchbar button {
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: #9f1d20;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.b2b-shop-box {
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
    padding: 20px;
}

.b2b-shop-cats {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

.b2b-shop-header {
    margin-bottom: 18px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
}

.b2b-shop-header .archive-title,
.b2b-shop-header h1 {
    margin: 6px 0 0;
    font-size: 30px;
    line-height: 1.15;
    color: #1d3557;
}

.b2b-shop-box .section-title {
    margin: 6px 0 0;
    font-size: 22px;
    line-height: 1.2;
    color: #1d3557;
}

.b2b-shop-box .eyebrow,
.b2b-shop-header .eyebrow {
    font-size: 12px;
    padding: 6px 12px;
}

.b2b-shop-content .woocommerce-result-count {
    margin: 0 0 14px;
    color: #374151;
}

.b2b-shop-content .woocommerce-ordering {
    margin: 0 0 22px;
}

.b2b-shop-content .woocommerce-ordering select {
    min-height: 46px;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    padding: 0 14px;
    background: #fff;
}

.b2b-shop-content ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0 !important;
}

.b2b-shop-content ul.products::before,
.b2b-shop-content ul.products::after {
    display: none !important;
}

.b2b-shop-content ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

.b2b-shop-cat-item + .b2b-shop-cat-item {
    margin-top: 10px;
}



.b2b-shop-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background: #f7f7f7;
    color: #2c2c2c;
    text-decoration: none;
    font-weight: 500;
    transition: .2s ease;
}

.b2b-shop-cat-link:hover {
    background: #fff5f5;
    border-color: #b11f24;
    color: #b11f24;
}

.b2b-shop-cat-toggle {
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background: #f7f7f7;
    color: #b11f24;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.b2b-shop-cat-toggle:hover {
    background: #fff5f5;
    border-color: #b11f24;
}

.b2b-shop-cat-toggle span {
    display: inline-block;
    line-height: 1;
    transform: translateY(-1px);
}

.b2b-shop-cat-item.is-open .b2b-shop-cat-toggle span {
    transform: rotate(45deg);
}

.b2b-shop-subcats {
    display: none;
    list-style: none;
    margin: 8px 0 0;
    padding: 0 0 0 14px;
    border-left: 2px solid #e4e4e4;
}

.b2b-shop-cat-item.is-open .b2b-shop-subcats {
    display: block;
}

.b2b-shop-subcats li + li {
    margin-top: 8px;
}

.b2b-shop-subcats a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fbfbfb;
    color: #4a4a4a;
    text-decoration: none;
    border: 1px solid #ececec;
    font-size: 14px;
    transition: .2s ease;
}

.b2b-shop-subcats a:hover {
    background: #fff5f5;
    border-color: #d9b1b3;
    color: #b11f24;
}

.b2b-shop-subcats strong,
.b2b-shop-cat-link strong {
    color: #b11f24;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .b2b-shop-layout {
        grid-template-columns: 1fr;
    }

    .b2b-shop-sidebar {
        position: static;
    }

    .b2b-shop-content ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .b2b-shop-searchbar form {
        flex-direction: column;
    }

    .b2b-shop-header .archive-title,
    .b2b-shop-header h1 {
        font-size: 24px;
    }

    .b2b-shop-box .section-title {
        font-size: 18px;
    }

    .b2b-shop-content ul.products {
        grid-template-columns: 1fr;
    }
}
.b2b-shop-cat-item + .b2b-shop-cat-item {
    margin-top: 10px;
}

.b2b-shop-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background: #f7f7f7;
    color: #2c2c2c;
    text-decoration: none;
    font-weight: 500;
    transition: .2s ease;
}

a.b2b-shop-cat-link:hover,
button.b2b-shop-cat-link:hover {
    background: #fff5f5;
    border-color: #b11f24;
    color: #b11f24;
}

button.b2b-shop-cat-link {
    appearance: none;
    cursor: pointer;
    text-align: left;
}

.b2b-shop-cat-item.is-open > .b2b-shop-cat-link {
    background: #fff5f5;
    border-color: #b11f24;
    color: #b11f24;
}


.b2b-shop-subcats {
    display: none;
    list-style: none;
    margin: 8px 0 0;
    padding: 0 0 0 14px;
    border-left: 2px solid #e4e4e4;
}

.b2b-shop-cat-item.is-open .b2b-shop-subcats {
    display: block;
}

.b2b-shop-subcats li + li {
    margin-top: 8px;
}

.b2b-shop-subcats a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fbfbfb;
    color: #4a4a4a;
    text-decoration: none;
    border: 1px solid #ececec;
    font-size: 14px;
    transition: .2s ease;
}

.b2b-shop-subcats a:hover {
    background: #fff5f5;
    border-color: #d9b1b3;
    color: #b11f24;
}

.b2b-shop-subcats strong,
.b2b-shop-cat-link strong {
    color: #b11f24;
    font-size: 12px;
}

.b2b-shop-subcats-all a {
    background: #f3f3f3;
    font-weight: 600;
}
/* fix button color for category items with children */
button.b2b-shop-cat-link {
    color: #2c2c2c !important;
    background: #f7f7f7 !important;
    border: 1px solid #e1e1e1 !important;
    box-shadow: none !important;
    justify-content: space-between;
}

button.b2b-shop-cat-link:hover {
    color: #b11f24 !important;
    background: #fff5f5 !important;
    border-color: #b11f24 !important;
}

.b2b-shop-cat-item.is-open > button.b2b-shop-cat-link,
.b2b-shop-cat-item.is-active-branch > button.b2b-shop-cat-link {
    color: #b11f24 !important;
    background: #fff5f5 !important;
    border-color: #b11f24 !important;
}

.b2b-shop-cat-link.is-current,
.b2b-shop-subcats li.is-current > a,
.b2b-shop-subcats-all.is-current > a {
    background: #fff5f5;
    border-color: #b11f24;
    color: #b11f24;
    font-weight: 700;
}
/* product cards: keep price and button at the bottom */
.b2b-shop-content ul.products li.product {
    display: flex !important;
    flex-direction: column;
}



.b2b-shop-content ul.products li.product .price {
    margin-top: auto !important;
}

.b2b-shop-content ul.products li.product .button,
.b2b-shop-content ul.products li.product a.button,
.b2b-shop-content ul.products li.product button.button,
.b2b-shop-content ul.products li.product .added_to_cart {
    margin-top: 12px !important;
    
}
/* arrow before category name */
.b2b-shop-cat-item.has-children > .b2b-shop-cat-link {
    position: relative;
    padding-left: 34px;
    padding-right: 14px;
}

.b2b-shop-cat-item.has-children > .b2b-shop-cat-link::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -5px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #b11f24;
    transition: transform .2s ease;
}

.b2b-shop-cat-item.is-open.has-children > .b2b-shop-cat-link::after,
.b2b-shop-cat-item.is-active-branch.has-children > .b2b-shop-cat-link::after {
    transform: rotate(90deg);
}

.b2b-shop-cat-link span {
    flex: 1 1 auto;
    min-width: 0;
}

.b2b-shop-cat-link strong {
    flex: 0 0 auto;
}

.b2b-shop-content ul.products li.product .price {
    margin-top: auto !important;
    flex: 0 0 auto !important;
}
.b2b-shop-content ul.products li.product .button,
.b2b-shop-content ul.products li.product a.button {
    min-height: 0 !important;
    height: 54px !important;
    line-height: 54px !important;
    padding: 0 18px !important;
}
/* карточка: цена и кнопка всегда снизу, кнопка не растягивается */
.b2b-shop-content ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
}

.b2b-shop-content ul.products li.product .woocommerce-loop-product__link,
.b2b-shop-content ul.products li.product > a:first-child {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
}

.b2b-shop-content ul.products li.product .price {
    margin-top: auto !important;
    margin-bottom: 12px !important;
    flex: 0 0 auto !important;
}

.b2b-shop-content ul.products li.product .button,
.b2b-shop-content ul.products li.product a.button,
.b2b-shop-content ul.products li.product button.button,
.b2b-shop-content ul.products li.product .added_to_cart {
    flex: 0 0 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    height: 54px !important;
    line-height: 54px !important;
    min-height: 54px !important;
    padding: 0 18px !important;
    margin-top: 0 !important;
}
/* single product: required order and one-line purchase row */

.single-product .b2b-product-short {
    margin-bottom: 18px;
}

.single-product .b2b-product-config-title {
    margin: 0 0 14px;
    color: #1d3557;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.single-product .b2b-product-price-wrap {
    margin-bottom: 16px;
}

.single-product .b2b-product-order-total {
    display: none !important;
}

/* variations area */
.single-product .b2b-product-purchase .variations {
    margin-bottom: 14px;
}

.single-product .b2b-product-purchase .variations td,
.single-product .b2b-product-purchase .variations th {
    padding-bottom: 10px;
}

.single-product .b2b-product-purchase .single_variation_wrap {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

/* hide duplicate variation price above qty if WooCommerce shows it */
.single-product .b2b-product-purchase .single_variation .price {
    display: none !important;
}

.single-product .b2b-product-purchase .woocommerce-variation-price {
    display: none !important;
}

/* qty + cart + total in one row */
.single-product .b2b-product-purchase .woocommerce-variation-add-to-cart,
.single-product .b2b-product-purchase .variations_button,
.single-product .b2b-product-purchase form.cart,
.single-product .b2b-product-purchase .cart {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.single-product .b2b-product-purchase .quantity {
    flex: 0 0 auto;
}

.single-product .b2b-product-purchase .quantity .qty {
    height: 52px;
    min-width: 92px;
    border: 1px solid #cfcfcf;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    text-align: center;
}

.single-product .b2b-product-purchase .single_add_to_cart_button,
.single-product .b2b-product-purchase button.single_add_to_cart_button,
.single-product .b2b-product-purchase a.single_add_to_cart_button {
    flex: 0 0 auto;
    height: 52px;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 12px;
}

/* inline total */
.single-product .b2b-product-purchase .b2b-product-order-total,
.single-product .b2b-product-purchase .b2b-product-order-total-inline {
    display: inline-flex !important;
    align-items: center;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #f7f7f7;
}

.single-product .b2b-product-purchase .b2b-product-order-total__label {
    margin-right: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.single-product .b2b-product-purchase .b2b-product-order-total__value {
    color: #b11f24;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

@media (max-width: 680px) {
    .single-product .b2b-product-purchase .single_variation_wrap,
    .single-product .b2b-product-purchase .woocommerce-variation-add-to-cart,
    .single-product .b2b-product-purchase .variations_button,
    .single-product .b2b-product-purchase form.cart,
    .single-product .b2b-product-purchase .cart {
        flex-direction: column;
        align-items: stretch;
    }

    .single-product .b2b-product-purchase .single_add_to_cart_button,
    .single-product .b2b-product-purchase button.single_add_to_cart_button,
    .single-product .b2b-product-purchase a.single_add_to_cart_button,
    .single-product .b2b-product-purchase .b2b-product-order-total,
    .single-product .b2b-product-purchase .b2b-product-order-total-inline {
        width: 100%;
    }
}
.single-product .b2b-product-order-total {
    display: none !important;
}

.single-product .b2b-product-purchase {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.single-product .b2b-product-purchase .variations {
    margin-bottom: 12px;
}

.single-product .b2b-product-purchase .single_variation .price,
.single-product .b2b-product-purchase .woocommerce-variation-price {
    display: none !important;
}

.single-product .b2b-product-purchase .woocommerce-variation-add-to-cart,
.single-product .b2b-product-purchase .variations_button,
.single-product .b2b-product-purchase form.cart,
.single-product .b2b-product-purchase .cart {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.single-product .b2b-product-purchase .quantity {
    flex: 0 0 auto;
}

.single-product .b2b-product-purchase .quantity .qty {
    height: 52px;
    min-width: 92px;
    border: 1px solid #cfcfcf;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    text-align: center;
}

.single-product .b2b-product-purchase .single_add_to_cart_button,
.single-product .b2b-product-purchase button.single_add_to_cart_button,
.single-product .b2b-product-purchase a.single_add_to_cart_button {
    flex: 0 0 auto;
    height: 52px;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 12px;
}

.single-product .b2b-product-order-total-inline {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #f7f7f7;
    white-space: nowrap;
}

.single-product .b2b-product-order-total__label {
    margin-right: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.single-product .b2b-product-order-total__value {
    color: #b11f24;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

@media (max-width: 680px) {
    .single-product .b2b-product-purchase .woocommerce-variation-add-to-cart,
    .single-product .b2b-product-purchase .variations_button,
    .single-product .b2b-product-purchase form.cart,
    .single-product .b2b-product-purchase .cart {
        flex-direction: column;
        align-items: stretch;
    }

    .single-product .b2b-product-purchase .single_add_to_cart_button,
    .single-product .b2b-product-purchase button.single_add_to_cart_button,
    .single-product .b2b-product-purchase a.single_add_to_cart_button,
    .single-product .b2b-product-order-total-inline {
        width: 100%;
    }
}


.single-product .b2b-product-purchase .variations tr {
    vertical-align: middle;
}

.single-product .b2b-product-purchase .variations td,
.single-product .b2b-product-purchase .variations th {
    vertical-align: middle;
}

.single-product .b2b-product-purchase .variations th.label {
    padding-right: 18px;
}

.single-product .b2b-product-purchase .variations th.label label,
.single-product .b2b-product-purchase .variations td.label label,
.single-product .b2b-product-purchase .variations .label label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 46px;
    margin: 0;
    width: 100%;
    line-height: 1.25;
}

/* My account: invoice button spacing and centering */
.woocommerce-account .woocommerce-orders-table__cell-order-actions,
.woocommerce-account table.my_account_orders td.woocommerce-orders-table__cell-order-actions,
.woocommerce-account table.shop_table_responsive.my_account_orders td.order-actions {
    text-align: center;
    vertical-align: middle;
}

.woocommerce-account .woocommerce-orders-table__cell-order-actions .button,
.woocommerce-account .woocommerce-orders-table__cell-order-actions .woocommerce-button,
.woocommerce-account table.my_account_orders td.woocommerce-orders-table__cell-order-actions a,
.woocommerce-account table.shop_table_responsive.my_account_orders td.order-actions .button,
.woocommerce-account table.shop_table_responsive.my_account_orders td.order-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 6px 8px;
}

/* single product add-to-cart notice: same width as content panels, centered, no overflow */
.single-product .woocommerce-notices-wrapper {
  width: min(100%, 1120px);
  margin: 0 auto 24px;
}

.single-product .woocommerce-notices-wrapper .woocommerce-message,
.single-product .woocommerce-notices-wrapper .woocommerce-info,
.single-product .woocommerce-notices-wrapper .woocommerce-error {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 24px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

.single-product .woocommerce-notices-wrapper .woocommerce-message::before,
.single-product .woocommerce-notices-wrapper .woocommerce-info::before,
.single-product .woocommerce-notices-wrapper .woocommerce-error::before {
  display: none;
}

.single-product .woocommerce-notices-wrapper .woocommerce-message,
.single-product .woocommerce-notices-wrapper .woocommerce-info,
.single-product .woocommerce-notices-wrapper .woocommerce-error {
  padding-left: 20px;
}

.single-product .woocommerce-notices-wrapper .woocommerce-message .button,
.single-product .woocommerce-notices-wrapper .woocommerce-message a.button,
.single-product .woocommerce-notices-wrapper .woocommerce-message .wc-forward,
.single-product .woocommerce-notices-wrapper .woocommerce-info .button,
.single-product .woocommerce-notices-wrapper .woocommerce-info a.button,
.single-product .woocommerce-notices-wrapper .woocommerce-info .wc-forward,
.single-product .woocommerce-notices-wrapper .woocommerce-error .button,
.single-product .woocommerce-notices-wrapper .woocommerce-error a.button,
.single-product .woocommerce-notices-wrapper .woocommerce-error .wc-forward {
  float: none !important;
  order: 2;
  margin: 0 !important;
  flex: 0 0 auto;
}

@media (max-width: 680px) {
  .single-product .woocommerce-notices-wrapper {
    width: 100%;
    margin-bottom: 20px;
  }

  .single-product .woocommerce-notices-wrapper .woocommerce-message,
  .single-product .woocommerce-notices-wrapper .woocommerce-info,
  .single-product .woocommerce-notices-wrapper .woocommerce-error {
    padding: 12px 14px;
    gap: 10px;
  }
}


/* v26: keep reset link below the variation selects and preserve equal select widths */
.b2b-product-purchase table.variations td.value {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.b2b-product-purchase table.variations td.value select {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
}

.b2b-product-purchase table.variations td.value .reset_variations {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: right !important;
  white-space: nowrap !important;
  align-self: stretch !important;
}


.single-product .b2b-product-price-wrap {
    min-height: 108px;
}

.single-product .b2b-product-top-price {
    min-height: 48px;
}

.single-product .b2b-product-top-price .price {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.18em;
    white-space: nowrap;
}
