/*
 * Barens Rus — стили
 *
 * Палитра (с Joomla Helix preset + акценты сайта):
 *   --blue #043e9d  — шапки аккордеона, кнопки (как panel на live)
 *   --blue-mid #044cd0
 *   --orange #ec430f — обводка «резка», ссылки hover (preset2)
 *   Montserrat — как на текущем Joomla
 *
 * Hero: текст внутри SVG-контура; padding у .hero-highlight-wrap критичен —
 * без него буквы пересекают штрих. Не увеличивать stroke-width без нужды (заказчик).
 *
 * Форма: карточка .contact-card, не «голые» input на белом (правке «форма сырая»).
 */
/* Barens Rus — дизайн по текущему Joomla-сайту
   Helix Ultimate + SP Page Builder reference
   Палитра: синий #043e9d / #044cd0, оранжевый акцент #ec430f, Montserrat
*/

:root {
  --blue: #043e9d;
  --blue-mid: #044cd0;
  --blue-deep: #032a6b;
  --orange: #ec430f;
  --text: #252525;
  --muted: #555;
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --acc-body: #e8e8e8;
  --line: #e0e0e0;
  --footer: #171717;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --container: 1140px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue-mid); text-decoration: none; }
a:hover { color: var(--orange); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.logo img {
  width: 186px;
  height: auto;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  padding: 8px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
}

.nav a:hover,
.nav a.is-active {
  color: var(--orange);
}

.header-phone {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}

.header-phone:hover { color: var(--orange); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 320px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(8, 28, 72, 0.72) 0%, rgba(12, 48, 120, 0.45) 48%, rgba(20, 60, 140, 0.28) 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 40px 20px;
}

.hero-main {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 40px;
  align-items: start;
  width: 100%;
}

.hero-title {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Весь заголовок внутри оранжевой рамки — больше полей, чтобы буквы не пересекали линию */
.hero-highlight-wrap {
  position: relative;
  display: inline-block;
  /* большие поля — текст не пересекает оранжевый контур */
  padding: 1.35em 1.75em 1.45em 1.55em;
}

.hero-highlight {
  position: relative;
  z-index: 1;
  display: block;
}

.hero-line {
  display: block;
  white-space: nowrap;
}

.hero-line--main {
  margin-top: 0.12em;
}

/*
  SVG path с Joomla — обводка вокруг блока
  Толще stroke, поля у текста больше
*/
.hero-stroke {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.hero-stroke-path {
  fill: none;
  stroke: #ec430f;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* pathLength="1" в SVG — анимация всегда дотягивает контур до конца */
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: cut-draw 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.12s forwards;
}

@keyframes cut-draw {
  to { stroke-dashoffset: 0; }
}

.hero-side {
  text-align: right;
  justify-self: end;
  max-width: 100%;
}

.hero-types {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.hero-types li {
  margin: 0;
  padding: 0;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.42);
  transition: color 0.35s ease, transform 0.35s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.hero-types li.is-on {
  color: #fff;
  transform: translateX(-2px);
}

.hero-contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.hero-phone,
.hero-email {
  display: block;
  color: #fff;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.hero-phone:hover,
.hero-email:hover {
  color: #fff;
  opacity: 0.85;
}

/* ===== Sections ===== */
.section {
  padding: 56px 0;
}

.section-title {
  margin: 0 0 28px;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text h2 {
  margin: 0 0 18px;
  font-size: 28px;
  font-weight: 600;
}

.about-text p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

.about-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.about-logo {
  width: 220px;
  height: auto;
}

.about-barrels {
  width: 260px;
  height: auto;
}

/* ===== Accordion (как на Joomla) ===== */
.accordion {
  border: none;
}

.acc-item {
  margin-bottom: 6px;
}

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: var(--blue);
  color: #fff;
  border: 0;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}

.acc-head:hover {
  background: var(--blue-mid);
}

.acc-item.is-open .acc-head {
  background: var(--blue);
}

.acc-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-top: -4px;
}

.acc-item.is-open .acc-icon {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.acc-body {
  background: var(--acc-body);
  overflow: hidden;
}

.acc-body[hidden] {
  display: none;
}

.acc-body-inner {
  padding: 20px 22px 24px;
}

.acc-product {
  margin-bottom: 22px;
}

.acc-product:last-child {
  margin-bottom: 0;
}

.acc-product h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-mid);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.acc-product h3 a {
  color: inherit;
}

.acc-product h3 a:hover {
  color: var(--orange);
}

.acc-product-desc p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.acc-product-desc p:last-child {
  margin-bottom: 0;
}

/* ===== Contact form ===== */
.contact {
  background: #f7f8fa;
  border-top: 1px solid var(--line);
}

.contact-card {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 36px 40px 32px;
  box-shadow: 0 8px 28px rgba(4, 62, 157, 0.06);
}

.contact-card-head {
  margin-bottom: 28px;
}

.contact-card-head h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
}

.contact-card-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 48ch;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row--full {
  grid-column: 1 / -1;
}

.form-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.form-row label .req {
  color: var(--orange);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #98a2b3;
}

.contact-form input:hover,
.contact-form textarea:hover {
  border-color: #a0a8b4;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(4, 76, 208, 0.12);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.form-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.btn-submit:hover {
  background: var(--blue-mid);
  box-shadow: 0 6px 16px rgba(4, 62, 157, 0.25);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.form-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.4;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.form-msg {
  margin-top: 16px;
  font-size: 14px;
  display: none;
  padding: 10px 14px;
  border-radius: 6px;
}

.form-msg.is-ok {
  display: block;
  color: #0d7a4f;
  background: #ecfdf3;
}

.form-msg.is-err {
  display: block;
  color: #b91c1c;
  background: #fef2f2;
}

/* ===== Product detail page ===== */
.product-hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 36px 0 28px;
}

.product-hero .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(4, 62, 157, 0.08);
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.product-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.5vw, 30px);
  color: var(--text);
}

.product-hero .lead {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 52ch;
}

.product-body {
  padding: 36px 0 56px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 36px;
  align-items: start;
}

.product-desc h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.product-desc p {
  margin: 0 0 12px;
  line-height: 1.65;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.feature-list li {
  padding: 8px 0 8px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.meta-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
}

.meta-box h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.meta-box p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.meta-box strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 2px;
}

.btn-blue {
  display: inline-block;
  padding: 10px 18px;
  background: var(--blue);
  color: #fff;
  border-radius: 3px;
  font-weight: 600;
  font-size: 14px;
}

.btn-blue:hover {
  background: var(--blue-mid);
  color: #fff;
}

.page-404 {
  text-align: center;
  padding: 80px 20px;
}

.page-404 h1 {
  margin: 0 0 12px;
  font-size: 48px;
  color: var(--blue);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--footer);
  color: rgba(255, 255, 255, 0.75);
  padding: 40px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
}

.footer-logo {
  width: 140px;
  height: auto;
  margin-bottom: 12px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-brand p {
  margin: 0;
  font-size: 13px;
  max-width: 360px;
  line-height: 1.5;
}

.footer-contacts a {
  color: rgba(255, 255, 255, 0.85);
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.footer-contacts a:hover {
  color: #fff;
}

.footer-company {
  margin-top: 10px !important;
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 20px;
  font-size: 12px;
}

.footer-bottom p {
  margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid,
  .product-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-side {
    text-align: left;
    justify-self: start;
  }

  .hero-types {
    align-items: flex-start;
  }

  .hero-contacts {
    align-items: flex-start;
  }

  .contact-card {
    padding: 28px 20px 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 10px 16px 14px;
    gap: 2px;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 12px 14px;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .header-phone {
    display: none;
  }

  .section {
    padding: 40px 0;
  }

  .acc-head {
    font-size: 12px;
    padding: 11px 14px;
  }
}


/* ===== Product page — продающий блок ===== */
.product-hero {
  background: #f7f8fa;
  border-bottom: 1px solid var(--line);
  padding: 28px 0 24px;
}

.product-hero .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(4, 62, 157, 0.08);
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.product-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.2vw, 30px);
  color: var(--text);
}

.product-hero .lead {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.5;
}

.product-body {
  padding: 36px 0 20px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 36px;
  align-items: start;
}

.product-desc h2 {
  margin: 24px 0 12px;
  font-size: 18px;
  color: var(--text);
}

.product-desc h2:first-child {
  margin-top: 0;
}

.product-desc p {
  margin: 0 0 12px;
  line-height: 1.65;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.feature-list li {
  padding: 10px 0 10px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: 14px;
  line-height: 1.45;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.meta-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 6px 20px rgba(4, 62, 157, 0.05);
  position: sticky;
  top: 88px;
}

.meta-box h3 {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--text);
}

.meta-box p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.meta-box strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.meta-box .btn-blue {
  display: block;
  text-align: center;
  margin-top: 8px;
}

.product-cta-bar {
  margin-top: 28px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  border-radius: 8px;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-cta-bar p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  max-width: 42ch;
}

.product-cta-bar a {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.product-cta-bar a:hover {
  background: #f0f4ff;
  color: var(--blue-deep);
}

.product-related {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.product-related h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.related-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.related-card:hover {
  border-color: var(--blue-mid);
  box-shadow: 0 4px 14px rgba(4, 62, 157, 0.08);
  color: inherit;
}

.related-card strong {
  display: block;
  font-size: 13px;
  color: var(--blue-mid);
  margin-bottom: 4px;
}

.related-card span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .product-layout {
    grid-template-columns: 1fr;
  }
  .meta-box {
    position: static;
  }
}
