/* ========== DESIGN SYSTEM ========== */
:root {
  --bg: #FBFAF7;
  --bg-alt: #F2F0EB;
  --text: #1a1a1a;
  --text-muted: #666666;
  --accent: #B08D57;
  --accent-2: #6B1F2A;
  --line: rgba(0, 0, 0, 0.08);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --header-h: 72px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

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

html {
  scroll-behavior: auto;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
fieldset { border: none; }
legend { font-family: var(--font-serif); font-size: 1.125rem; letter-spacing: 0.04em; margin-bottom: 1rem; }

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden { display: none !important; }

/* ========== TYPOGRAPHY ========== */
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.15;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section { padding: clamp(4rem, 10vw, 7rem) 0; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.35s var(--ease);
}

.btn--primary {
  background: var(--accent-2);
  color: #fff;
}

.btn--primary:hover {
  background: #521822;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(107, 31, 42, 0.25);
}

.btn--outline {
  border: 1px solid var(--text);
  color: var(--text);
  background: transparent;
}

.btn--outline:hover {
  background: var(--text);
  color: var(--bg);
}

.btn--lg { padding: 1.125rem 2.25rem; font-size: 0.875rem; }

.btn--telegram { background: #229ED9; color: #fff; }
.btn--whatsapp { background: #25D366; color: #fff; }
.btn--max { background: var(--accent-2); color: #fff; }
.btn--wishlist { border: 1px solid var(--line); width: 100%; margin-bottom: 1rem; }
.btn--wishlist:hover { border-color: var(--accent); color: var(--accent); }

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.header--solid {
  background: rgba(251, 250, 247, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}

.header--solid .header__logo,
.header--solid .header__links a,
.header--solid .mega-trigger { color: var(--text); }

.header:not(.header--solid) .header__logo,
.header:not(.header--solid) .header__links a,
.header:not(.header--solid) .mega-trigger {
  color: #fff;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 0.25em;
  font-weight: 600;
}

.header__nav { display: none; }

.header__links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.header__links a,
.mega-trigger {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.3s;
}

.header__links a:hover,
.mega-trigger:hover { opacity: 0.7; }

.has-mega { position: relative; }

.mega-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.5rem 2rem;
  z-index: 100;
}

.mega-menu[hidden] { display: none; }

.mega-menu__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.mega-menu h4 {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.mega-menu ul { list-style: none; }
.mega-menu a {
  display: block;
  padding: 0.4rem 0;
  color: var(--text);
  font-size: 0.9rem;
}

.mega-menu a:hover { color: var(--accent-2); }

.header__cta { display: none; }

.burger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  z-index: 1001;
}

.burger span {
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s;
}

.header:not(.header--solid) .burger { color: #fff; }
.header--solid .burger { color: var(--text); }

.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1024px) {
  .header__nav { display: block; }
  .header__cta { display: inline-flex; }
  .burger { display: none; }
}

@media (max-width: 1023px) {
  .header__nav.is-open {
    display: block;
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: var(--bg);
    padding: 2rem;
    overflow-y: auto;
  }

  .header__nav.is-open .header__links {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .header__nav.is-open .header__links a,
  .header__nav.is-open .mega-trigger { color: var(--text); }

  .mega-menu {
    position: static;
    transform: none;
    min-width: 100%;
    box-shadow: none;
    border: none;
    padding: 1rem 0 0;
  }
}

/* ========== HERO ========== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  max-height: 1000px;
}

.hero-swiper,
.hero-swiper .swiper-slide {
  width: 100%;
  height: 100%;
}

.hero-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--header-h) 1.5rem 3rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.5) 100%);
  color: #fff;
  z-index: 2;
  pointer-events: none;
}

.hero__overlay .btn { pointer-events: auto; }

.hero__badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.5);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 400;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

.hero__subtitle {
  max-width: 520px;
  font-size: clamp(0.95rem, 2vw, 1.125rem);
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

/* ========== BUSINESS UNITS ========== */
.units {
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}

.units__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.units__card {
  padding: 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s;
}

.units__card:last-child { border-bottom: none; }
.units__card:hover { background: var(--bg); }

.units__label {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.units__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .units__grid { grid-template-columns: repeat(3, 1fr); }
  .units__card { border-bottom: none; border-right: 1px solid var(--line); }
  .units__card:last-child { border-right: none; }
}

/* ========== ABOUT ========== */
.about__grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.about__mission {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stats__num {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--accent-2);
  line-height: 1;
}

.stats__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.about__media img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

@media (min-width: 1024px) {
  .about__grid { grid-template-columns: 1fr 1fr; }
}

/* ========== PRODUCTS CAROUSEL ========== */
.products-carousel-wrap {
  position: relative;
  padding: 0 3rem;
}

.products-swiper { overflow: hidden; }

.product-card {
  cursor: pointer;
  transition: transform 0.4s var(--ease);
}

.product-card:hover { transform: translateY(-6px); }

.product-card__img {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--bg-alt);
}

.product-card__img img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.product-card:hover .product-card__img img { transform: scale(1.04); }

.product-card__tag {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  background: rgba(251, 250, 247, 0.92);
  color: var(--accent-2);
}

.product-card__title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.product-card__cta { width: 100%; }

.carousel-btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--bg);
  z-index: 5;
  transition: border-color 0.3s, background 0.3s;
}

.carousel-btn::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--text);
  border-bottom: 1px solid var(--text);
  margin: auto;
}

.carousel-btn--prev { left: 0; }
.carousel-btn--prev::before { transform: rotate(45deg) translate(2px, -2px); }
.carousel-btn--next { right: 0; }
.carousel-btn--next::before { transform: rotate(-135deg) translate(2px, -2px); }

.carousel-btn:hover {
  border-color: var(--accent);
  background: var(--bg-alt);
}

/* ========== MASONRY WORKS ========== */
.masonry {
  column-count: 1;
  column-gap: 1rem;
}

.masonry__item {
  break-inside: avoid;
  margin-bottom: 1rem;
  width: 100%;
  padding: 0;
  overflow: hidden;
  display: block;
  transition: opacity 0.3s;
}

.masonry__item:hover { opacity: 0.92; }

.masonry__item img {
  width: 100%;
  object-fit: cover;
}

@media (min-width: 480px) { .masonry { column-count: 2; } }
@media (min-width: 1024px) { .masonry { column-count: 3; } }
@media (min-width: 1440px) { .masonry { column-count: 4; } }

/* ========== CALCULATOR ========== */
.calculator {
  position: relative;
  background: var(--bg-alt);
}

.calculator__bg {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1567016432779-094069958ea5?w=1600&q=80') center/cover no-repeat;
  opacity: 0.06;
}

.calculator__intro {
  color: var(--text-muted);
  max-width: 560px;
  margin-top: -2rem;
  margin-bottom: 2.5rem;
}

.calc-grid {
  display: grid;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.calc-step {
  background: var(--bg);
  padding: 1.5rem;
  border: 1px solid var(--line);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
  display: block;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s;
}

.chip input:checked + span {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.range-row label { grid-column: 1; font-size: 0.9rem; }
.range-row output { font-variant-numeric: tabular-nums; color: var(--accent); }

.range-row input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent-2);
}

.area-display {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.radios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.radio-card input { position: absolute; opacity: 0; }

.radio-card span {
  display: block;
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.9rem;
}

.radio-card input:checked + span {
  border-color: var(--accent-2);
  background: rgba(107, 31, 42, 0.06);
}

#customDesc {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--line);
  font-family: inherit;
  resize: vertical;
  background: var(--bg);
}

.materials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .materials { grid-template-columns: repeat(4, 1fr); }
}

.material-card {
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.material-card:has(input:checked) { border-color: var(--accent); }

.material-card input { position: absolute; opacity: 0; }

.material-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  margin-bottom: 0.5rem;
}

.material-card__name {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
}

.material-card__price {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  cursor: pointer;
}

.check-row input { width: 18px; height: 18px; accent-color: var(--accent-2); }
.check-row em { font-style: normal; color: var(--text-muted); font-size: 0.85rem; }

.calc-result {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 2rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.calc-result__label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.calc-result__total {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  color: var(--accent-2);
  margin: 0.5rem 0 1.5rem;
  line-height: 1;
}

.calc-result__breakdown {
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.calc-result__breakdown li {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
}

.messenger-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.messenger-btns .btn { width: 100%; }

@media (min-width: 1024px) {
  .calc-grid { grid-template-columns: 1.2fr 0.8fr; align-items: start; }
}

/* ========== MATERIALS SHOWCASE ========== */
.materials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.materials-grid__item {
  position: relative;
  overflow: hidden;
}

.materials-grid__item img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.materials-grid__item:hover img { transform: scale(1.05); }

.materials-grid__item span {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

@media (min-width: 768px) {
  .materials-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ========== WHY ========== */
.why {
  position: relative;
}

.why__bg {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1493663284031-b7e3aefcae8e?w=1600&q=80') center/cover no-repeat;
  opacity: 0.05;
}

.why-grid {
  display: grid;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.why-card {
  padding: 2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: box-shadow 0.35s, transform 0.35s;
}

.why-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.why-card__icon {
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.why-card h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.why-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .why-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ========== CONTACTS ========== */
.contacts__grid {
  display: grid;
  gap: 2.5rem;
}

.contacts__list {
  list-style: none;
  margin: 1.5rem 0;
}

.contacts__list li {
  padding: 0.4rem 0;
  color: var(--text-muted);
}

.contacts__list a:hover { color: var(--accent-2); }

.contacts__legal {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contacts__messengers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contacts__messengers .btn { width: 100%; }

@media (min-width: 768px) {
  .contacts__grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ========== FOOTER ========== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.85);
  padding: 4rem 0 2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer__logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  color: #fff;
}

.footer__tagline {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

.footer h4 {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.footer ul { list-style: none; }
.footer a {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.footer a:hover { opacity: 1; color: #fff; }

.footer__social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.footer__social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.footer__bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

.footer__gift {
  color: var(--accent);
  opacity: 1;
}

@media (min-width: 1024px) {
  .footer__grid { grid-template-columns: 1.2fr repeat(4, 1fr); }
}

/* ========== LIGHTBOX & MODAL ========== */
.lightbox,
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden],
.modal[hidden] { display: none; }

.lightbox {
  background: rgba(0,0,0,0.92);
  padding: 2rem;
}

.lightbox__img {
  max-height: 85vh;
  max-width: 90vw;
  object-fit: contain;
  margin: auto;
}

.lightbox__close,
.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  font-size: 2rem;
  z-index: 10;
  width: 48px;
  height: 48px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
}

.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.modal__box {
  position: relative;
  background: var(--bg);
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  z-index: 1;
}

.modal__close { color: var(--text); }

.modal__title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.modal__gallery img {
  width: 100%;
  margin-bottom: 1rem;
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: #fff;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  z-index: 3000;
  transition: transform 0.4s var(--ease);
  pointer-events: none;
}

.toast.is-visible { transform: translateX(-50%) translateY(0); }

/* ========== REVEAL ANIMATIONS ========== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
}
