/* Variant Energo v4 corrections to v3 refinements. Loaded after site.css
   and mobile-layout.css. Desktop headings and photo containment preserved. */

/* Home hero changes immediately with the in-page lens switch (lens.js).
   The line break and year styling match the previous home-page headline. */
.hero-lens-title .hero-title-variant { display:none; }
.home-page.lens-neutral .hero-title-variant[data-hero-lens="neutral"],
.home-page.lens-goods .hero-title-variant[data-hero-lens="goods"],
.home-page.lens-equipment .hero-title-variant[data-hero-lens="equipment"] { display:inline; }

/* Center headings and the accompanying "Все" links ONLY in phone mode.
   In computer mode leave site.css's original horizontal layout and alignment. */
html[data-site-version="phone"] body:not(.admin-area) .section-heading {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  text-align:center;
}
html[data-site-version="phone"] body:not(.admin-area) .section-heading > :is(h2,h3) {
  margin:0;
  text-align:center;
}
html[data-site-version="phone"] body:not(.admin-area) .section-heading > a {
  display:inline-block;
  align-self:center;
  margin:0;
  max-width:100%;
  text-align:center;
  white-space:normal;
}
html[data-site-version="phone"] body:not(.admin-area) :is(.production-group,.catalog-results,.gallery) > h2,
html[data-site-version="phone"] body:not(.admin-area) main.wrap > :is(h1,h2),
html[data-site-version="phone"] body:not(.admin-area) main.wrap > .back {
  text-align:center;
}
html[data-site-version="phone"] body:not(.admin-area) main.wrap > .back {
  margin-inline:auto;
}

/* Home: visibly separate whole sections and the individual preview tiles.
   The existing full-screen hero, per-lens order and responsive card sizes
   are retained. */
.home-page .home-section {
  margin-block-start:clamp(72px,7vw,112px);
}
.home-page .home-section .section-heading {
  margin-bottom:clamp(31px,3vw,45px);
}
.home-page .home-production-works {
  margin-block-start:clamp(72px,7vw,112px);
}
.home-page .home-section .grid {
  row-gap:clamp(48px,5vw,66px);
  column-gap:clamp(18px,3.5vw,48px);
}
/* Do not give cart rows (or the equipment calculation's forms) gigantic
   inter-item gaps: their lists are transactional, not showcase cards. */
.home-page .home-section .cart-item-list { gap:12px; }

/* Product cart: selected goods, then add another, then totals/checkout. */
.cart-content .cart-subheading {
  margin:26px 0 15px;
  font-size:clamp(18px,2.4vw,23px);
  line-height:1.3;
  text-align:left;
}
html[data-site-version="phone"] .cart-content .cart-subheading { text-align:center; }
.cart-content .cart-subheading:first-child { margin-top:0; }
.cart-content .cart-add-form { margin-bottom:26px; }

/* Photos: preserve the complete photograph (no cropping, no background
   duplicates). The site's own .cover-img/gallery rules provide object-fit:
   contain and size the image boxes. For "Наши работы" the project photo is
   stored as a project-logo inside a padded .project-client-mark. Let that
   img occupy the entire mark's frame (previously 12px were lost on each
   side) while preserving contain and leaving text-only marks padded. */
body:not(.admin-area) :is(.home-production-section,.production-group)
  .equipment-tile > .project-client-mark { position:relative; }
body:not(.admin-area) :is(.home-production-section,.production-group)
  .equipment-tile > .project-client-mark > img.project-logo {
    position:absolute;
    inset:0;
    display:block;
    width:100%;
    height:100%;
    max-width:100%;
    max-height:100%;
    padding:0;
    margin:0;
    object-fit:contain;
    object-position:center;
  }

/* Phone-only header alignment: contacts are anchored on the left,
   the logo/title group is anchored on the RIGHT (including <=360px).
   The navigation remains a separate full-width row underneath. */
html[data-site-version="phone"] .site-header .head {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  grid-template-rows:auto auto;
  column-gap:clamp(9px,2.7vw,22px);
  row-gap:13px;
  padding-inline:clamp(10px,2.7vw,18px);
  width:100%;
  max-width:100%;
  align-items:center;
}
html[data-site-version="phone"] .site-header .header-contacts {
  grid-column:1;
  grid-row:1;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-self:start;
  align-self:center;
  gap:4px;
  margin:0;
  padding:0;
  min-width:0;
  max-width:100%;
  text-align:left;
}
html[data-site-version="phone"] .site-header .header-contacts a {
  font-size:clamp(11px,2.5vw,14px);
  line-height:1.3;
  max-width:100%;
  overflow-wrap:anywhere;
  white-space:normal;
}
html[data-site-version="phone"] .site-header a.brand.brand-lockup {
  grid-column:2;
  grid-row:1;
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  justify-self:end;
  align-self:center;
  flex-wrap:nowrap;
  gap:clamp(5px,1.4vw,10px);
  width:max-content;
  max-width:100%;
  min-width:0;
  margin:0;
  text-align:left;
}
html[data-site-version="phone"] .site-header .brand-lockup .brand-logo {
  flex:0 0 clamp(30px,6vw,45px);
  width:clamp(30px,6vw,45px);
  height:clamp(30px,6vw,45px);
  min-width:0;
}
html[data-site-version="phone"] .site-header .brand-lockup .brand-copy {
  min-width:0;
  align-items:flex-start;
  justify-content:center;
}
html[data-site-version="phone"] .site-header .brand-lockup .brand-title {
  font-size:clamp(11px,2.5vw,16px);
  line-height:1.22;
  white-space:normal;
  overflow-wrap:normal;
}
html[data-site-version="phone"] .site-header .brand-lockup .brand-subtitle {
  font-size:clamp(10px,2.1vw,12px);
  line-height:1.2;
}
html[data-site-version="phone"] .site-header nav {
  grid-column:1 / -1;
  grid-row:2;
  width:100%;
  min-width:0;
  margin:0;
}

/* Phone-only: both product-cart and equipment-calculation adders use
   precisely one full-width field per row, regardless of CSS zoom width. */
html[data-site-version="phone"] .cart-add-form {
  display:grid;
  grid-template-columns:minmax(0,1fr)!important;
  gap:16px;
  align-items:stretch;
  width:100%;
}
html[data-site-version="phone"] .cart-add-form > :is(.field,button,noscript,.draft-operation-status) {
  grid-column:1 / -1!important;
  min-width:0;
}
html[data-site-version="phone"] .cart-add-form > .field :is(select,input) {
  width:100%;
  min-width:0;
  max-width:100%;
}
html[data-site-version="phone"] .cart-add-form > button {
  justify-self:center;
  width:min(100%,340px);
  min-width:0;
}
html[data-site-version="phone"] .cart-item-list {
  display:grid;
  grid-template-columns:minmax(0,1fr);
}
html[data-site-version="phone"] .cart-item-list > .cart-item {
  width:100%;
  min-width:0;
}
/* Center solitary textual headings in both home lens modes and catalog
   without disrupting paired cart controls or admin editor fields. */
html[data-site-version="phone"] body:not(.admin-area) :is(
  .catalog-directions,.equipment-grid,.catalog-product-grid
) :is(h2,h3,p) {
  text-align:center;
}
@media (max-width:480px) {
  .home-page .home-section .grid { row-gap:54px; }
  .home-page .home-section .section-heading { margin-bottom:36px; }
}
