/* ========================================
   Layout Styles
   Top Bar, Header, Footer
   ======================================== */

/* ========================================
   MOBILE HEADER (new design — mobile only)
   ======================================== */

/* Hidden by default (desktop) */
.site-header {
  display: none;
}

/* Show only on mobile/tablet */
@media (max-width: 1023px) {
  .site-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(
      to bottom,
      rgba(245, 243, 238, 1) 0%,
      rgba(245, 243, 238, 1) 60%,
      rgba(245, 243, 238, 0.9) 80%,
      rgba(245, 243, 238, 0.5) 92%,
      transparent 100%
    );
    padding-bottom: 22px;
  }

  .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    gap: 14px;
  }

  /* Logo */
  .header-logo { flex-shrink: 0; }
  .header-logo a { display: block; }
  .header-logo img {
    height: 58px;
    width: auto;
    display: block;
    transition: opacity 0.4s ease;
  }
  .header-logo a:hover img { opacity: 0.8; }

  /* Divider */
  .header-divider {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, transparent, rgba(30,30,60,0.12) 25%, rgba(30,30,60,0.12) 75%, transparent);
    flex-shrink: 0;
  }

  /* Phone */
  .header-phone { text-align: center; flex-shrink: 0; }
  .header-phone-number {
    display: block;
    font-family: inherit;
    font-size: 22px;
    font-weight: 400;
    color: #1a1a3a;
    text-decoration: none;
    letter-spacing: 1.5px;
    white-space: nowrap;
    transition: color 0.3s ease;
  }
  .header-phone-number:hover { color: #2a2a5a; }
  .header-schedule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
  }
  .header-schedule span {
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    color: rgba(30, 30, 60, 0.4);
    letter-spacing: 1.8px;
    text-transform: uppercase;
  }
  .schedule-dot {
    width: 3px;
    height: 3px;
    background: rgba(30, 30, 60, 0.25);
    border-radius: 50%;
  }

  /* Messengers — frost glass icons (high specificity to override sections2.css) */
  .header-messengers {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }
  .site-header .messenger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(44, 36, 23, 0.025);
    border: 1px solid rgba(44, 36, 23, 0.06);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    box-shadow: none;
    transition: all 0.3s ease;
  }
  .site-header .messenger-btn:hover {
    transform: translateY(-1px);
  }
  .site-header .messenger-btn svg {
    display: block;
    width: 32px;
    height: 32px;
  }
  .site-header .messenger-max {
    background: linear-gradient(135deg, #00c8ff 0%, #5533ee 60%, #9933dd 100%);
    border: none;
  }
  .site-header .messenger-max svg path { fill: #fff; }
  .site-header .messenger-max:hover { opacity: 0.85; }
  .site-header .messenger-telegram:hover {
    background: rgba(38, 165, 230, 0.07);
    border-color: rgba(38, 165, 230, 0.15);
  }

  /* Hide old header on mobile */
  .header { display: none !important; }

  /* Offset body for fixed header */
  body { padding-top: 82px; }
}

/* Mobile smaller breakpoints */
@media (max-width: 640px) {
  .header-inner { height: 72px; padding: 0 17px; gap: 10px; }
  .header-logo img { height: 46px; }
  .header-phone-number { font-size: 17px; letter-spacing: 1px; }
  .header-schedule span { font-size: 11px; letter-spacing: 1.2px; }
  .site-header .messenger-btn { width: 40px; height: 40px; border-radius: 11px; }
  .site-header .messenger-btn svg { display: block; width: 30px; height: 30px; }
  .header-messengers { gap: 10px; }
  .header-divider { display: none; }
  body { padding-top: 72px; }
}

@media (max-width: 420px) {
  .header-inner { height: 65px; padding: 0 12px; gap: 7px; }
  .header-logo img { height: 36px; }
  .header-phone-number { font-size: 14px; letter-spacing: 0.5px; }
  .header-schedule span { font-size: 10px; }
  .site-header .messenger-btn { width: 36px; height: 36px; border-radius: 10px; }
  .site-header .messenger-btn svg { display: block; width: 26px; height: 26px; }
  body { padding-top: 65px; }
}

/* ========================================
   FOOTER (brainandhome.ru style)
   ======================================== */

.footer {
  background: #f5f3ee;
  color: #2d2d2d;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- ROW TOP (accent bar: logo + phones + CTA) --- */
.footer__row-top {
  background: #e8e4dd;
}

.footer__row-top .footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 35px;
  padding-bottom: 35px;
}

.footer__top-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer__logo {
  display: inline-flex;
  flex-shrink: 0;
}

.footer__logo-img {
  height: 50px;
  width: auto;
  transition: opacity 0.3s;
}

.footer__logo:hover .footer__logo-img {
  opacity: 0.8;
}

.footer__site-descr {
  color: #6b6560;
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
  letter-spacing: 0.02em;
}

.footer__top-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.footer__box-phone {
  display: flex;
  gap: 30px;
}

.footer__phone-item {
  text-align: center;
}

.footer__phone {
  display: block;
  color: #2d2d2d;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color 0.3s;
}

.footer__phone:hover {
  color: #c41230;
}

.footer__phone-item span {
  display: block;
  color: #8a8580;
  font-size: 12px;
  margin-top: 4px;
}

.footer__cta {
  background: linear-gradient(135deg, #2c2620, #3d3428);
  border: none;
  border-radius: 12px;
  color: var(--color-gray-50);
  font-family: 'Golos Text', sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  padding: 14px 26px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(28,26,21,0.15);
}

.footer__cta:hover {
  background: linear-gradient(135deg, #3d3428, #4a3f32);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(28,26,21,0.25);
}

/* --- ROW MIDDLE (nav + contacts, bordered) --- */
.footer__row-mid {
  border-top: 1px solid #d5d0c9;
  border-bottom: 1px solid #d5d0c9;
}

.footer__row-mid .footer__inner {
  display: flex;
}

.footer__mid-left {
  display: flex;
  justify-content: space-between;
  width: 60%;
  border-right: 1px solid #d5d0c9;
  padding: 45px 3.5% 40px 0;
}

.footer__nav-col {
  margin-right: 8%;
}

.footer__nav-col:last-child {
  margin-right: 0;
}

.footer__list li {
  margin-bottom: 18px;
}

.footer__list li:last-child {
  margin-bottom: 0;
}

.footer__list a {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #5a5550;
  transition: color 0.25s, transform 0.25s;
  display: inline-block;
}

.footer__list a:hover {
  color: #2d2d2d;
  transform: translateX(3px);
}

.footer__mid-right {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 40%;
  padding: 45px 0 40px 3.5%;
}

/* Contacts in right column */
.footer__address-block {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.footer__addr-item {
  color: #5a5550;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.footer__addr-item address {
  font-style: normal;
}

.footer__addr-label {
  color: #2d2d2d;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.footer__mail {
  color: #5a5550;
  font-size: 14px;
  transition: color 0.25s;
}

.footer__mail:hover {
  color: #c41230;
}

/* Social links with text labels */
.footer__soc-block {
  padding-left: 5%;
}

.footer__soc-label {
  color: #2d2d2d;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.footer__soc-list {
  display: flex;
  flex-direction: column;
}

.footer__soc-list li {
  margin-top: 28px;
}

.footer__soc-list li:first-child {
  margin-top: 0;
}

.footer__soc-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #5a5550;
  padding: 6px 10px;
  border-radius: 6px;
  margin: -6px -10px;
  transition: color 0.25s, background 0.25s;
}

.footer__soc-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.footer__soc-link:hover {
  color: #2d2d2d;
  background: rgba(0,0,0,0.05);
}

/* QR codes block (desktop only) */
.footer__qr-codes {
  display: none;
}

@media (min-width: 1024px) {
  .footer__qr-codes {
    display: flex;
    gap: 20px;
    margin-top: 28px;
  }

  .footer__qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.25s;
  }

  .footer__qr-item:hover {
    transform: translateY(-2px);
  }

  .footer__qr-item img {
    width: 100px;
    height: 100px;
    border-radius: 14px;
    object-fit: cover;
  }

  .footer__qr-item--tg img {
    background: #fff;
    padding: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  }

  .footer__qr-item--max img {
    background: #1c1a15;
    padding: 4px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  }

  .footer__qr-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #78736a;
  }
}

/* --- ROW BOTTOM (legal) --- */
.footer__row-bot .footer__inner {
  padding-top: 0;
  padding-bottom: 0;
}

.footer__legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 30px 0 35px;
}

.footer__legal li {
  color: #5a5550;
  font-size: 14px;
  line-height: 1.4;
}

.footer__legal li a {
  color: #5a5550;
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: rgba(0,0,0,0.2);
  text-underline-offset: 3px;
  transition: color 0.25s, text-decoration-color 0.25s;
}

.footer__legal li a:hover {
  color: #2d2d2d;
  text-decoration-color: #2d2d2d;
}

.footer__disclaimer {
  color: #8a8580;
  font-size: 13px;
}

/* --- ROW DEV (developer credit) --- */
.footer__row-dev {
  border-top: 1px solid rgba(28,26,21,0.08);
}

.footer__dev-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 12px 0;
  font-size: 12px;
  color: #ada69c;
}

.footer__dev-label::after {
  content: ' —';
}

.footer__dev-name {
  font-weight: 500;
  color: #8c7b63;
}

.footer__dev-contacts {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer__dev-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ada69c;
  text-decoration: none;
  transition: color 0.2s;
}

.footer__dev-link:hover {
  color: #6b5d4a;
}

/* --- RESPONSIVE --- */

/* Mobile: stack everything */
@media (max-width: 767px) {
  .footer__inner {
    max-width: 600px;
    text-align: center;
  }

  /* Row Top: stack */
  .footer__row-top .footer__inner {
    display: block;
    padding-top: 35px;
    padding-bottom: 35px;
  }

  .footer__top-left {
    display: block;
  }

  .footer__logo-img {
    height: 44px;
    margin: 0 auto 12px;
    display: block;
  }

  .footer__site-descr {
    font-size: 13px;
    margin-top: 15px;
  }

  .footer__top-right {
    display: block;
    margin-top: 25px;
  }

  .footer__box-phone {
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
  }

  .footer__phone {
    font-size: 20px;
  }

  .footer__cta {
    display: block;
    width: 220px;
    margin: 0 auto;
    padding: 14px 20px;
    font-size: 15px;
  }

  /* Row Middle: stack */
  .footer__row-mid .footer__inner {
    display: block;
  }

  .footer__mid-left {
    width: 100%;
    border-right: none;
    padding: 25px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
  }

  .footer__nav-col {
    margin-right: 0;
    margin-bottom: 12px;
    font-size: 14px;
    text-align: left;
    padding: 0 5px;
  }

  .footer__nav-col:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid #e0dbd5;
    padding-top: 12px;
    margin-top: 4px;
  }

  .footer__nav-col:nth-child(3) .footer__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
  }

  .footer__list li {
    margin-bottom: 10px;
  }

  .footer__mid-right {
    width: 100%;
    padding: 35px 0;
    display: block;
    position: relative;
  }

  .footer__mid-right::before {
    content: "";
    position: absolute;
    top: 0;
    left: -999px;
    right: -999px;
    background: #d5d0c9;
    height: 1px;
  }

  .footer__soc-block {
    padding-left: 0;
    margin-top: 30px;
  }

  .footer__soc-list {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
  }

  .footer__soc-list li {
    margin-top: 0;
  }

  /* Row Bottom: stack */
  .footer__legal {
    display: block;
    padding: 30px 0;
  }

  .footer__legal li {
    margin-bottom: 12px;
  }

  .footer__legal li:last-child {
    margin-bottom: 0;
  }
}

/* Small mobile */
@media (max-width: 479px) {
  .footer__box-phone {
    display: block;
  }

  .footer__phone-item {
    margin-bottom: 20px;
  }

  .footer__phone-item:last-child {
    margin-bottom: 0;
  }

  .footer__list a {
    font-size: 13px;
  }

  .footer__list li {
    margin-bottom: 8px;
  }

  .footer__mid-left {
    padding: 20px 0;
    gap: 0 6px;
  }

  .footer__mid-right {
    padding: 25px 0;
  }

  .footer__soc-block {
    margin-top: 20px;
  }

  .footer__legal {
    padding: 20px 0;
  }

  .footer__legal li {
    margin-bottom: 8px;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  .footer__mid-left {
    width: 55%;
    padding-right: 2.5%;
  }

  .footer__mid-right {
    width: 45%;
    padding-left: 2.5%;
  }

  .footer__nav-col {
    margin-right: 5%;
  }

  .footer__site-descr {
    font-size: 12px;
  }

  .footer__cta {
    font-size: 13px;
    padding: 12px 18px;
  }
}

/* Large desktop */
@media (min-width: 1400px) {
  .footer__inner {
    max-width: 1400px;
  }
}
