/* === Переменные === */
:root {
  --color-bg: #faf8f5;
  --color-bg-dark: #1a1a1a;
  --color-accent: #2d5a4a;
  --color-accent-light: #3d7a64;
  --color-text: #1a2a3a;
  --color-text-muted: #3d5266;
  --color-cream: #e8e4de;
  --color-white: #ffffff;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 16px 38px rgba(31, 38, 135, 0.2);
  --glass-border: rgba(255, 255, 255, 0.5);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
}

/* === Сброс и база === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: #dff1ff;
  background-image:
    linear-gradient(rgba(234, 245, 255, 0.78), rgba(234, 245, 255, 0.78)),
    url("images/bg-glass.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  overflow-x: hidden;
}

/* === Glassmorphism для карточек/блоков === */
.product-card,
.trust-item,
.case-item,
.review-item,
.catalog-card,
.benefit-item,
.ornate-card,
.order-form {
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, rgba(117, 174, 255, 0.34), rgba(173, 136, 255, 0.3), rgba(255, 145, 166, 0.28));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.product-card::before,
.trust-item::before,
.case-item::before,
.review-item::before,
.catalog-card::before,
.benefit-item::before,
.order-form::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.2));
  pointer-events: none;
}

.product-info,
.trust-item > *,
.case-item > *,
.review-item > *,
.catalog-card > *,
.benefit-item > *,
.order-form > * {
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-light);
}

ul {
  list-style: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Шапка === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.logo img {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
}

/* === Герой === */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 600px;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 2rem 2rem 2.2rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: linear-gradient(140deg, rgba(123, 194, 255, 0.36), rgba(174, 143, 255, 0.3), rgba(255, 166, 183, 0.28));
  box-shadow: 0 16px 38px rgba(31, 38, 135, 0.2);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.hero-content::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.2));
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.hero-decoration {
  position: absolute;
  right: -10%;
  top: 50%;
  transform: translateY(-50%);
  width: 50%;
  max-width: 500px;
  height: 70%;
  background-color: transparent;
  background-image: url("images/r.jpg");
  background-size: contain;
  background-position: left center;
  background-repeat: no-repeat;
  border-radius: 40% 0 0 40%;
  opacity: 1;
  pointer-events: none;
}

.hero .btn {
  position: relative;
  z-index: 1;
}

/* === Кнопки === */
.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.btn-small {
  background: var(--color-cream);
  color: var(--color-text);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.btn-small:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

/* === Секции === */
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
}

/* === Каталог продукции === */
.products {
  padding: 4rem 0;
  background: transparent;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.product-card {
  border-radius: var(--radius-lg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.product-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--color-cream);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-image-clickable {
  cursor: pointer;
}

.trust,
.cases,
.reviews {
  padding: 3rem 0;
  background: transparent;
}

.trust-grid,
.cases-grid,
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.trust-item,
.case-item,
.review-item {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.trust-item h3,
.case-item h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

.trust-item p,
.case-item p,
.review-item p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.case-meta,
.review-meta {
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* === Просмотрщик изображений (лайтбокс) === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
}

.lightbox-close::before,
.lightbox-close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 2px;
  margin-left: -11px;
  margin-top: -1px;
  background: var(--color-white);
}

.lightbox-close::before { transform: rotate(45deg); }
.lightbox-close::after { transform: rotate(-45deg); }

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background var(--transition);
}

.lightbox-nav::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  border-top: 2px solid var(--color-white);
  border-right: 2px solid var(--color-white);
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev::before {
  transform: translate(-35%, -50%) rotate(-135deg);
}

.lightbox-next::before {
  transform: translate(-65%, -50%) rotate(45deg);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

body.lightbox-open {
  overflow: hidden;
}

.product-info {
  padding: 1.25rem;
}

.product-info h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.product-info p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.price {
  display: block;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

/* === О нас === */
.about {
  padding: 4rem 0;
  background: transparent;
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about .section-title {
  text-align: left;
  margin-bottom: 1rem;
}

.about-content p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Контакты === */
.contacts {
  padding: 4rem 0;
  background: transparent;
  color: var(--color-text);
}

.contacts .section-title,
.contacts .section-subtitle {
  color: var(--color-text);
}

.contacts .section-subtitle {
  opacity: 1;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.contact-item {
  text-align: center;
}

.contact-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.contact-item strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.contact-item a,
.contact-item p {
  color: var(--color-text);
  font-weight: 500;
}

.contact-item a:hover {
  text-decoration: underline;
  color: var(--color-accent);
}

/* === Подвал === */
.footer {
  padding: 1.5rem;
  background: transparent;
  color: var(--color-text-muted);
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer p {
  margin: 0;
}

/* === Общие стили внутренних страниц === */
.inner-page .header {
  position: relative;
}

.page-main {
  padding: 5rem 0 4rem;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.page-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
}

.page-intro {
  margin-bottom: 1rem;
}

.catalog-section {
  padding: 1rem 0 3rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.catalog-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.catalog-card h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.catalog-card p {
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.catalog-list {
  margin: 0 0 0.75rem 1.2rem;
  padding: 0;
  list-style: disc;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.catalog-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.catalog-card .btn {
  margin-right: 0.5rem;
  margin-top: 0.25rem;
}

.catalog-benefits {
  padding: 1rem 0 3rem;
  background: transparent;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.benefit-item {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.benefit-item h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.benefit-item p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Страницы изделий */
.detail-section {
  padding: 1rem 0 3rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2rem;
  align-items: center;
}

.detail-text h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0.75rem 0 0.4rem;
}

.detail-text ul {
  margin: 0 0 0.75rem 1.2rem;
  padding: 0;
  list-style: disc;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.detail-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Галерея */
.gallery-section {
  padding: 1rem 0 3rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-group {
  margin-top: 2.5rem;
}

.gallery-heading {
  text-align: left;
  font-size: 1.4rem;
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item video,
.gallery-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Фиксированный размер превью видео: 50x50 мм */
#gallery-video .gallery-grid {
  grid-template-columns: repeat(auto-fit, 50mm);
  justify-content: start;
}

#gallery-video .gallery-item {
  width: 50mm;
  height: 50mm;
  position: relative;
  z-index: 1;
  transition: width 0.25s ease, height 0.25s ease, box-shadow 0.25s ease;
}

#gallery-video .gallery-item.video-expanded {
  width: 100mm;
  height: 100mm;
  z-index: 5;
  box-shadow: var(--shadow-card);
}

.gallery-photo-grid {
  grid-template-columns: repeat(auto-fit, 50mm);
  justify-content: start;
}

.gallery-photo-grid .gallery-item {
  width: 50mm;
  height: 50mm;
}

/* Декоративная страница контактов */
.contacts-page .page-main {
  padding-top: 4rem;
}

.contacts-hero .page-subtitle {
  margin-bottom: 1rem;
}

.ornament {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  letter-spacing: 0.35rem;
  color: var(--color-accent);
  margin: 0.5rem 0 1rem;
}

.contacts-ornate {
  padding: 1.5rem 0 3rem;
}

.contacts-ornate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.ornate-card {
  position: relative;
  padding: 1.6rem 1.2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  overflow: hidden;
}

.ornate-card::before,
.ornate-card::after {
  content: "❦";
  position: absolute;
  color: rgba(45, 90, 74, 0.35);
  font-size: 1.1rem;
}

.ornate-card::before {
  top: 0.55rem;
  left: 0.7rem;
}

.ornate-card::after {
  bottom: 0.55rem;
  right: 0.7rem;
}

.ornate-card h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  margin-bottom: 0.25rem;
}

.ornate-label {
  color: var(--color-text-muted);
  margin-bottom: 0.55rem;
}

.ornate-link {
  font-weight: 600;
  font-size: 1.05rem;
}

/* === Страница заказа === */
.order-page .header {
  position: relative;
}

.order-main {
  padding: 5rem 0 4rem;
  min-height: 60vh;
}

.container-narrow {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.order-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.order-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.order-form {
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.form-label {
  display: block;
  margin-bottom: 1.25rem;
}

.form-label span {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-label input,
.form-label select,
.form-label textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--color-cream);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--transition);
}

.form-label input:focus,
.form-label select:focus,
.form-label textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-label textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 1rem;
  font-size: 1.05rem;
}

.order-form-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.order-fallback {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-cream);
}

.order-fallback-title {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.order-fallback-actions {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.order-fallback-actions .btn-small {
  margin-top: 0;
}

.order-note {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.order-note a {
  font-weight: 600;
}

/* === Адаптив === */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    padding: 1rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--color-cream);
  }

  /* На мобильных убираем наложение дракона на текст в hero */
  .hero {
    flex-direction: column;
    padding-top: 5.5rem;
    padding-bottom: 3rem;
  }

  .hero-content {
    max-width: 92vw;
    padding: 1.35rem 1.1rem 1.5rem;
  }

  .hero-decoration {
    position: static;
    transform: none;
    right: auto;
    top: auto;
    width: min(320px, 78vw);
    max-width: none;
    height: 220px;
    margin-top: 1rem;
    background-position: center;
  }

  .about-inner {
    grid-template-columns: 1fr;
  }

  .about .section-title {
    text-align: center;
  }

  .about-content {
    order: 1;
  }

  .about-image {
    order: 0;
  }

  /* Галерея на телефоне: 2 колонки для фото и видео */
  #gallery-video .gallery-grid,
  .gallery-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  #gallery-video .gallery-item,
  .gallery-photo-grid .gallery-item {
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  #gallery-video .gallery-item.video-expanded {
    width: auto;
    height: auto;
    grid-column: span 2;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 75vh;
    padding-top: 5rem;
  }
}
