:root {
  --site-width: 1440px;
  --site-gutter: clamp(16px, 4vw, 40px);
}

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

body {
  margin: 0;
  min-width: 320px;
  font-family: Montserrat, sans-serif;
}

.container {
  width: min(var(--site-width), calc(100% - 2 * var(--site-gutter)));
  margin-inline: auto;
}

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

/* Top header — блоки в одну строку */
.site-header {
  position: relative;
  z-index: 400;
  background: #fff;
}

.site-header__inner {
  padding-block: clamp(8px, 1vw, 16px);
}

.region-top-header {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  width: 100%;
}

.region-top-header > .block,
.region-top-header > nav {
  flex: 0 1 auto;
  width: auto;
  margin: 0;
}

.region-top-header [id*="logotip"] {
  flex-shrink: 0;
}

@media (min-width: 801px) {
  .region-top-header {
    flex-wrap: nowrap;
  }
}

@media (max-width: 800px) {
  .region-top-header [id*="adrespredpriyatiya"] {
    display: none;
  }
}

/* Drupal service tabs (view/edit/delete/revisions) */
ul:is(
  :has(> li > a[data-drupal-link-system-path*="/edit"]),
  :has(> li > a[data-drupal-link-system-path*="/delete"]),
  :has(> li > a[data-drupal-link-system-path*="/revisions"])
) {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

ul:is(
  :has(> li > a[data-drupal-link-system-path*="/edit"]),
  :has(> li > a[data-drupal-link-system-path*="/delete"]),
  :has(> li > a[data-drupal-link-system-path*="/revisions"])
) > li {
  margin: 0;
}

ul:is(
  :has(> li > a[data-drupal-link-system-path*="/edit"]),
  :has(> li > a[data-drupal-link-system-path*="/delete"]),
  :has(> li > a[data-drupal-link-system-path*="/revisions"])
) > li > a[data-drupal-link-system-path] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #d8e0ff;
  background: #f2f5ff;
  color: #1f2a44;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

ul:is(
  :has(> li > a[data-drupal-link-system-path*="/edit"]),
  :has(> li > a[data-drupal-link-system-path*="/delete"]),
  :has(> li > a[data-drupal-link-system-path*="/revisions"])
) > li > a[data-drupal-link-system-path]:hover {
  color: #fff;
  background: #2b67f6;
  border-color: #2b67f6;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(43, 103, 246, 0.25);
}

ul:is(
  :has(> li > a[data-drupal-link-system-path*="/edit"]),
  :has(> li > a[data-drupal-link-system-path*="/delete"]),
  :has(> li > a[data-drupal-link-system-path*="/revisions"])
) > li > a[data-drupal-link-system-path]:focus-visible {
  outline: 2px solid #2b67f6;
  outline-offset: 2px;
}

ul:is(
  :has(> li > a[data-drupal-link-system-path*="/edit"]),
  :has(> li > a[data-drupal-link-system-path*="/delete"]),
  :has(> li > a[data-drupal-link-system-path*="/revisions"])
) > li > a[data-drupal-link-system-path].is-active,
ul:is(
  :has(> li > a[data-drupal-link-system-path*="/edit"]),
  :has(> li > a[data-drupal-link-system-path*="/delete"]),
  :has(> li > a[data-drupal-link-system-path*="/revisions"])
) > li > a[data-drupal-link-system-path][aria-current="page"] {
  color: #fff;
  background: #1e4fd6;
  border-color: #1e4fd6;
}

ul:has(> li > a[data-drupal-link-system-path*="/edit"]) > li > a[data-drupal-link-system-path*="/edit"] {
  color: #1d7041;
  background: #e9fbf1;
  border-color: #c4efd4;
}

ul:has(> li > a[data-drupal-link-system-path*="/delete"]) > li > a[data-drupal-link-system-path*="/delete"] {
  color: #b42318;
  background: #fff0f0;
  border-color: #ffd1d1;
}

ul:has(> li > a[data-drupal-link-system-path*="/revisions"]) > li > a[data-drupal-link-system-path*="/revisions"] {
  color: #5b21b6;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

/* Drupal status/messages block */
[data-drupal-messages] {
  margin: clamp(12px, 2vw, 24px) 0;
}

[data-drupal-messages] > div[role="contentinfo"] {
  border: 1px solid #b6e7c9;
  border-left: 5px solid #1e9e55;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #f6fff9 0%, #eefcf3 100%);
  color: #0f5132;
  box-shadow: 0 6px 16px rgba(30, 158, 85, 0.12);
  font-weight: 600;
}

[data-drupal-messages] .visually-hidden + * {
  margin-top: 0;
}

@media (max-width: 640px) {
  ul:is(
    :has(> li > a[data-drupal-link-system-path*="/edit"]),
    :has(> li > a[data-drupal-link-system-path*="/delete"]),
    :has(> li > a[data-drupal-link-system-path*="/revisions"])
  ) {
    gap: 8px;
  }

  ul:is(
    :has(> li > a[data-drupal-link-system-path*="/edit"]),
    :has(> li > a[data-drupal-link-system-path*="/delete"]),
    :has(> li > a[data-drupal-link-system-path*="/revisions"])
  ) > li {
    flex: 1 1 100%;
  }

  ul:is(
    :has(> li > a[data-drupal-link-system-path*="/edit"]),
    :has(> li > a[data-drupal-link-system-path*="/delete"]),
    :has(> li > a[data-drupal-link-system-path*="/revisions"])
  ) > li > a[data-drupal-link-system-path] {
    width: 100%;
  }
}

/* Product page layout (image left, content right) */
body.path-product .breadcrumb-wrap {
  margin-top: clamp(10px, 1.8vw, 18px);
  margin-bottom: clamp(12px, 2vw, 20px);
}

body.path-product .breadcrumb {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #e1e7f5;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f6ff 100%);
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(25, 52, 120, 0.08);
}

body.path-product .breadcrumb a {
  color: #2b67f6;
  text-decoration: none;
}

body.path-product .breadcrumb a:hover {
  text-decoration: underline;
}

body.path-product .content-area > .commerce-product--view-mode-full,
body.path-product .content-area > article.commerce-product {
  display: grid;
  grid-template-columns: minmax(300px, 500px) minmax(320px, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: start;
}

body.path-product .content-area .field--name-field-image,
body.path-product .content-area .field--name-variations .field--name-field-image {
  margin: 0;
}

body.path-product .content-area .field--name-field-image img,
body.path-product .content-area .field--name-variations .field--name-field-image img {
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid #eceef5;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 10px 24px rgba(20, 34, 66, 0.08);
}

body.path-product .content-area .field--name-body,
body.path-product .content-area .field--name-price,
body.path-product .content-area .field--name-variations,
body.path-product .content-area form.commerce-order-item-add-to-cart-form {
  max-width: 640px;
}

@media (max-width: 980px) {
  body.path-product .content-area > .commerce-product--view-mode-full,
  body.path-product .content-area > article.commerce-product {
    grid-template-columns: 1fr;
  }
}

/* Product page: shop-like composition for current markup */
body.path-product #block-mega-prut-content > article {
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
}

body.path-product #block-mega-prut-content .img-and-parameters {
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(320px, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
  margin-top: clamp(12px, 2vw, 20px);
  grid-column: 1 / -1;
}

body.path-product #block-mega-prut-content .img-and-parameters .img-parameters-group,
body.path-product #block-mega-prut-content .img-and-parameters .parameters-group {
  float: none !important;
  width: auto !important;
  padding: 0 !important;
}

body.path-product #block-mega-prut-content .img-and-parameters .img-parameters-group img {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  border-radius: 0;
  border: 0;
  background: transparent;
  object-fit: contain;
  box-shadow: none;
}

body.path-product #block-mega-prut-content .product--variation-field--variation_price__45,
body.path-product #block-mega-prut-content [class*="product--variation-field--variation_price__"] {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 8px;
  grid-column: 1 / 2;
  justify-self: start;
}

body.path-product #block-mega-prut-content [class*="product--variation-field--variation_price__"] > div:first-child {
  color: #59627a;
  font-size: 16px;
  white-space: nowrap;
}

body.path-product #block-mega-prut-content [class*="product--variation-field--variation_price__"] > div:last-child {
  color: #0f172a;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
}

body.path-product #block-mega-prut-content [class*="product--variation-field--variation_field_stock_level__"] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 10px 0 8px;
  color: #59627a;
  grid-column: 2 / 3;
  justify-self: end;
  white-space: nowrap;
}

body.path-product #block-mega-prut-content [class*="product--variation-field--variation_field_stock_level__"] > div:last-child span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #ffd1d1;
  background: #fff0f0;
  color: #b42318;
  font-weight: 700;
}

body.path-product #block-mega-prut-content > article > nav[aria-labelledby="system-breadcrumb"] {
  grid-column: 1 / -1;
  margin: 0 0 8px;
  padding: 12px 16px;
  border: 1px solid #e1e7f5;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f6ff 100%);
  box-shadow: 0 6px 16px rgba(25, 52, 120, 0.08);
}

body.path-product #block-mega-prut-content > article > nav[aria-labelledby="system-breadcrumb"] ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

body.path-product #block-mega-prut-content > article > nav[aria-labelledby="system-breadcrumb"] li {
  margin: 0;
  color: #5f6f95;
  font-size: 14px;
}

body.path-product #block-mega-prut-content > article > nav[aria-labelledby="system-breadcrumb"] li + li::before {
  content: "›";
  margin-right: 10px;
  color: #9aa7c6;
}

body.path-product #block-mega-prut-content > article > nav[aria-labelledby="system-breadcrumb"] a {
  color: #2b67f6;
  text-decoration: none;
}

body.path-product #block-mega-prut-content > article > nav[aria-labelledby="system-breadcrumb"] a:hover {
  text-decoration: underline;
}

body.path-product #block-mega-prut-content .parameters-group > div {
  border: 1px solid #e8ecf7;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

body.path-product #block-mega-prut-content .parameters-group > div > div:first-child {
  display: block !important;
  color: #59627a;
  font-size: 14px;
  white-space: nowrap;
  flex: 0 0 auto;
}

body.path-product #block-mega-prut-content .parameters-group > div > div:last-child {
  display: block !important;
  color: #0f172a;
  font-weight: 600;
  white-space: nowrap;
  flex: 1 1 auto;
  text-align: right;
}

body.path-product #block-mega-prut-content form.commerce-order-item-add-to-cart-form {
  position: relative;
  margin-top: 14px;
  border: 1px solid #e8ecf7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: 14px;
}

body.path-product #block-mega-prut-content > article > div:has(> form.commerce-order-item-add-to-cart-form) {
  grid-column: 1 / -1;
  order: 40;
}

/* Remove decorative non-clickable favorites stub (::after). */
body.path-product #block-mega-prut-content form.commerce-order-item-add-to-cart-form::after {
  content: none !important;
  display: none !important;
}

/* Real Flag link: place under cart form and style as the favorites button. */
body.path-product #block-mega-prut-content > article > .flag.flag-izbrannoe-prutok {
  grid-column: 1 / -1;
  order: 50;
  margin: 12px 0 0;
}

body.path-product #block-mega-prut-content > article > .flag.flag-izbrannoe-prutok a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border: 1px solid #f3c7cf;
  border-radius: 10px;
  background: #fff7f8;
  color: #b42318;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

body.path-product #block-mega-prut-content > article > .flag.flag-izbrannoe-prutok a:hover {
  background: #ffecef;
  text-decoration: none;
  color: #912018;
}

body.path-product #block-mega-prut-content > article > .flag.flag-izbrannoe-prutok a::before {
  content: "\2661";
  margin-right: 0.4em;
}

body.path-product #block-mega-prut-content .commerce-order-item-add-to-cart-form .form-item-quantity-0-value {
  margin-bottom: 12px;
}

body.path-product #block-mega-prut-content .commerce-order-item-add-to-cart-form .form-item-quantity-0-value label {
  color: #59627a;
  font-size: 14px;
  margin-bottom: 6px;
}

body.path-product #block-mega-prut-content .commerce-order-item-add-to-cart-form .form-item-quantity-0-value input {
  min-height: 42px;
  border: 1px solid #d8deef;
  border-radius: 10px;
  padding: 8px 10px;
}

body.path-product #block-mega-prut-content .button--add-to-cart {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  box-shadow: 0 10px 20px rgba(31, 64, 165, 0.22);
}

@media (max-width: 980px) {
  body.path-product #block-mega-prut-content > article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.path-product #block-mega-prut-content [class*="product--variation-field--variation_price__"],
  body.path-product #block-mega-prut-content [class*="product--variation-field--variation_field_stock_level__"] {
    grid-column: 1 / -1;
  }

  body.path-product #block-mega-prut-content [class*="product--variation-field--variation_field_stock_level__"] {
    justify-content: flex-start;
  }

  body.path-product #block-mega-prut-content .img-and-parameters {
    grid-template-columns: 1fr;
  }

  body.path-product #block-mega-prut-content .img-and-parameters .img-parameters-group img {
    max-width: min(100%, 420px);
  }
}
