/* Custom shim CSS for "Домик Строй" — replaces missing Tilda project CSS.
   Targets generic Tilda block classes (t-*) with sensible construction-company styling. */

:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --ink: #1f1a14;
  --ink-muted: #6b6055;
  --line: #e5ddcd;
  --line-soft: #efe9da;
  --accent: #2f7d3a;
  --accent-hover: #266830;
  --accent-soft: #e7f1e5;
  --wood: #7d4d2b;
  --warn: #b14a2a;
}

/* ---------- BASE ---------- */
html { -webkit-text-size-adjust: 100%; }
body, .t-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'TildaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }
ul, ol { list-style: none; padding: 0; margin: 0; }
button { font-family: inherit; cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ---------- LAYOUT HELPERS (complement to tilda-grid) ---------- */
.t-records { width: 100%; }
.t-rec { width: 100%; box-sizing: border-box; }
.t-container { box-sizing: content-box; padding-left: 20px; padding-right: 20px; }

/* Float-based t-col system gets a clearfix already via tilda-grid; just spacing helpers */
.t-row { display: block; }
.t-clear { clear: both; }
.t-margin_auto { margin-left: auto !important; margin-right: auto !important; float: none !important; }

/* Section paddings — supplement Tilda's inline rec_pt/pb where they're absent */
.t-rec:not([style*="padding"]) { padding-top: 40px; padding-bottom: 40px; }

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.2; color: var(--ink); margin: 0; }

.t-name      { font-family: inherit; font-weight: 500; line-height: 1.3; }
.t-name_xs   { font-size: 14px; }
.t-name_sm   { font-size: 16px; }
.t-name_md   { font-size: 18px; }
.t-name_lg   { font-size: 22px; font-weight: 600; }
.t-name_xl   { font-size: 28px; font-weight: 600; }

.t-title     { font-family: inherit; font-weight: 700; line-height: 1.15; color: var(--ink); letter-spacing: -.01em; }
.t-title_xxs { font-size: 22px; }
.t-title_xs  { font-size: 26px; }
.t-title_sm  { font-size: 32px; }
.t-title_md  { font-size: 40px; }
.t-title_lg  { font-size: 52px; }
.t-title_xl  { font-size: 64px; }

.t-heading    { font-family: inherit; font-weight: 700; line-height: 1.15; color: var(--ink); letter-spacing: -.01em; }
.t-heading_xs { font-size: 26px; }
.t-heading_sm { font-size: 32px; }
.t-heading_md { font-size: 40px; }
.t-heading_lg { font-size: 52px; }

.t-text      { font-family: inherit; line-height: 1.6; color: var(--ink); }
.t-text_xs   { font-size: 13px; }
.t-text_sm   { font-size: 14px; }
.t-text_md   { font-size: 16px; }
.t-text_lg   { font-size: 18px; }
.t-text_xl   { font-size: 20px; }

.t-descr     { font-family: inherit; line-height: 1.55; color: var(--ink-muted); }
.t-descr_xxs { font-size: 12px; }
.t-descr_xs  { font-size: 14px; }
.t-descr_sm  { font-size: 16px; }
.t-descr_md  { font-size: 18px; }
.t-descr_lg  { font-size: 22px; }
.t-descr_xl  { font-size: 26px; }

.t-section__title    { font-size: 36px; font-weight: 700; line-height: 1.15; margin: 0 0 12px; color: var(--ink); }
.t-section__descr    { font-size: 18px; line-height: 1.55; color: var(--ink-muted); margin: 0 0 30px; }
.t-section__container { padding: 0; }

/* ---------- HEADER MENU (t228 block) ---------- */
#t-header { position: relative; z-index: 100; }
#t-header .t-rec { padding-top: 18px; padding-bottom: 18px; }

.t228, .t228__maincontainer {
  display: flex;
  align-items: center;
  width: 100%;
}
.t228__maincontainer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 24px;
  justify-content: space-between;
}
.t228__padding40px { display: contents; }
.t228__leftside    { flex: 0 0 auto; }
.t228__centerside  { flex: 1 1 auto; display: flex; justify-content: center; }
.t228__rightside   { flex: 0 0 auto; }
.t228__leftcontainer, .t228__centercontainer, .t228__rightcontainer { display: flex; align-items: center; gap: 16px; }

.t228__imgwrapper { display: inline-block; }
.t228__imgwrapper img { max-height: 56px; width: auto; }

.t228__list, .t-menu__list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px 24px;
  align-items: center;
  margin: 0; padding: 0;
}
.t228__list_hidden { display: flex !important; }
.t228__list .t-menu__item, .t-menu__item { list-style: none; }
.t-menu__link-item, .t228__list a {
  display: inline-block;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.t-menu__link-item:hover, .t228__list a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.t228__right_descr  { font-size: 16px; font-weight: 600; color: var(--ink); }
.t228__right_descr a { color: var(--ink); }
.t228__right_descr a:hover { color: var(--accent); }
.t228__right_buttons_wrapper { display: flex; gap: 12px; align-items: center; }

/* Mobile menu visibility on desktop — hide burger */
.tmenu-mobile, .t-menuburger { display: none !important; }
@media (max-width: 960px) {
  .tmenu-mobile { display: block !important; }
  .t228__centerside { display: none; }
  .t228__rightside { display: none; }
}

/* ---------- SOCIAL LINKS ---------- */
.t-sociallinks__wrapper {
  display: flex; gap: 10px; align-items: center;
  margin: 0; padding: 0;
}
.t-sociallinks__item { list-style: none; }
.t-sociallinks__item a { display: block; line-height: 0; opacity: .9; transition: opacity .15s, transform .15s; }
.t-sociallinks__item a:hover { opacity: 1; transform: translateY(-1px); }

/* ---------- BUTTONS ---------- */
.t-btn, .t-submit, .t-form__submit button, button.t-submit, a.t-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  background: var(--accent);
  color: #fff !important;
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: .01em;
  transition: background .15s, border-color .15s, transform .05s;
  text-align: center;
  min-height: 44px;
  box-sizing: border-box;
}
.t-btn:hover, .t-submit:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.t-btn:active { transform: translateY(1px); }
.t-btn_md { padding: 12px 24px; font-size: 14px; }
.t-btn_lg { padding: 16px 32px; font-size: 16px; }

/* ---------- COVER / HERO ---------- */
.t-cover {
  position: relative; width: 100%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.t-cover-height { min-height: 480px; }
.t-cover__wrapper { display: flex; align-items: center; justify-content: center; min-height: inherit; width: 100%; }
.t-cover__carrier {
  position: absolute; inset: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  z-index: 0;
}
.t-cover-bg { background-size: cover; background-position: center; }
.t-cover__filter {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,10,.30), rgba(20,16,10,.55));
  z-index: 1;
}
.t-cover .t-container { position: relative; z-index: 2; padding-top: 60px; padding-bottom: 60px; }
.t-cover .t-title, .t-cover h1, .t-cover .t-name { color: #fff !important; text-shadow: 0 1px 24px rgba(0,0,0,.35); }
.t-cover .t-descr, .t-cover .t-text { color: #f0eadf !important; }

/* ---------- CARDS (t-card) ---------- */
.t-card__container { display: flex; flex-wrap: wrap; gap: 24px; }
.t-card__col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  display: flex; flex-direction: column;
  box-sizing: border-box;
  transition: box-shadow .2s, transform .2s;
}
.t-card__col:hover { box-shadow: 0 8px 24px rgba(20,16,10,.08); transform: translateY(-2px); }
.t-card__bgimg, .t-card__img {
  width: 100%; aspect-ratio: 4/3;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border-radius: 4px; margin-bottom: 16px;
}
.t-card__title { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0 0 8px; color: var(--ink); }
.t-card__descr { font-size: 14px; color: var(--ink-muted); line-height: 1.5; margin: 0 0 12px; }
.t-card__price-wrapper { margin: 8px 0 12px; font-weight: 600; color: var(--wood); }
.t-card__price { font-size: 20px; }
.t-card__price-old { font-size: 14px; color: var(--ink-muted); text-decoration: line-through; margin-right: 8px; }
.t-card__btn-wrapper { margin-top: auto; }
.t-card__btn { width: 100%; }
.t-card__link { display: block; color: inherit; }
.t-card__link:hover .t-card__title { color: var(--accent); }

/* ---------- FORMS ---------- */
.t-form { display: block; }
.t-form__inputsbox { display: flex; flex-direction: column; gap: 12px; }
.t-input-block, .t-input-group { display: block; }
.t-input-title, .t-input-block label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.t-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.t-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.t-input { min-height: 96px; resize: vertical; line-height: 1.5; }
.t-input-error { color: var(--warn); font-size: 12px; margin-top: 4px; }
.t-form__submit { margin-top: 16px; }
.t-form__errorbox-text { color: var(--warn); font-size: 13px; }
.t-form__errorbox-item { padding: 2px 0; }

/* ---------- SECTIONS / SLIDERS / CAROUSELS ---------- */
.t-slds, .t-carousel { position: relative; width: 100%; }
.t-slds__container { overflow: hidden; }
.t-slds__items-wrapper, .t-slds__wrapper { display: flex; }
.t-slds__item, .t-carousel__item { flex: 0 0 100%; box-sizing: border-box; }
.t-slds__bgimg { background-size: cover; background-position: center; min-height: 360px; }
.t-slds__arrow_wrapper, .t-slds__arrow_container {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.t-slds__arrow_wrapper:first-child { left: 12px; }
.t-slds__arrow_wrapper:last-child  { right: 12px; }
.t-slds__bullet_wrapper {
  position: absolute; bottom: 16px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 8px; z-index: 5;
}
.t-slds__bullet { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.6); cursor: pointer; }
.t-slds__bullet_active, .t-slds__bullet:hover { background: #fff; }

/* ---------- POPUPS ---------- */
.t-popup {
  position: fixed; inset: 0;
  background: rgba(20,16,10,.55);
  display: none;
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.t-popup_show { display: flex; }
.t-popup__container {
  background: var(--surface);
  max-width: 560px; width: 100%;
  padding: 32px; border-radius: 8px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  max-height: 90vh; overflow-y: auto;
  box-sizing: border-box;
}
.t-popup__close { position: absolute; top: 12px; right: 12px; background: transparent; border: 0; padding: 8px; cursor: pointer; }
.t-popup__close-icon { width: 18px; height: 18px; }

/* ---------- FOOTER ---------- */
#allrecords > .t-rec:last-child,
.t-rec[data-record-type="106"]:last-child {
  background: #1f1a14;
  color: #d8d1c2;
}
#allrecords > .t-rec:last-child a,
#allrecords > .t-rec:last-child .t-name,
#allrecords > .t-rec:last-child .t-text { color: #d8d1c2; }
#allrecords > .t-rec:last-child a:hover { color: #fff; }

/* ---------- MISC TIDY UP ---------- */
.t-records { padding: 0; }
.t-width { box-sizing: border-box; }
.t-width_12 { width: 100%; }
.t-width_10 { width: 83.333%; margin-left: auto; margin-right: auto; }
.t-width_6  { width: 50%; margin-left: auto; margin-right: auto; }
.t-records img.t-img { max-width: 100%; height: auto; }

/* Prevent overlapping floats from breaking layout */
.t-row::after { content: ''; display: table; clear: both; }

/* Fix Tilda's annoying inline backgrounds on text-spans (legacy from rich editor) */
.t-title span[style*="background-color:#000000"],
.t-text span[style*="background-color:#000000"],
.t-name span[style*="background-color:#000000"] { background-color: transparent !important; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1240px) {
  .t-col_12 { max-width: 100% !important; }
  .t-col_10 { max-width: 83.333% !important; }
  .t-col_8  { max-width: 66.666% !important; }
  .t-col_6  { max-width: 50% !important; }
  .t-col_5  { max-width: 41.666% !important; }
  .t-col_4  { max-width: 33.333% !important; }
  .t-col_3  { max-width: 25% !important; }
}
@media (max-width: 760px) {
  .t-title_lg, .t-title_xl, .t-heading_lg, .t-section__title { font-size: 28px !important; }
  .t-title_md, .t-heading_md { font-size: 24px !important; }
  .t-col, .t-col_3, .t-col_4, .t-col_5, .t-col_6, .t-col_8, .t-col_10, .t-col_12 {
    max-width: 100% !important; float: none !important;
    margin-left: 0 !important; margin-right: 0 !important;
  }
  .t-cover-height { min-height: 360px !important; }
  .t228__maincontainer { flex-direction: column; gap: 12px; }
  .t-container { padding: 0 16px; }
  .t-section__title { font-size: 26px; }
}
