:root {
  --ink: #263c5a;
  --ink-soft: #637797;
  --sand: #ece6dd;
  --paper: #f7f3ec;
  --white: #fff;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Istok Web", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(191, 211, 227, 0.65), transparent 30%),
    linear-gradient(180deg, #efe7dc 0%, #f8f4ee 45%, #f3eee7 100%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.textiles-page {
  min-height: 100vh;
}

.textiles-header,
main {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.textiles-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(99, 119, 151, 0.15);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  background: rgba(248, 244, 238, 0.76);
  box-shadow: 0 16px 40px rgba(38, 60, 90, 0.08);
}

.textiles-brand {
  width: 78px;
  height: 78px;
  overflow: hidden;
  border-radius: 22px;
}

.textiles-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.textiles-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  color: var(--ink-soft);
}

.header-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 999px;
  transition: transform 180ms ease, background-color 180ms ease;
}

.header-button,
.button-primary {
  background: var(--ink);
  color: var(--white);
}

.button-secondary {
  border: 1px solid rgba(38, 60, 90, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

main {
  padding: 34px 0 72px;
}

.textiles-hero,
.quick-strip,
.catalog-section,
.contact-section {
  margin-top: 30px;
}

.textiles-hero,
.quick-strip,
.catalog-section,
.contact-section {
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(99, 119, 151, 0.12);
  box-shadow: 0 24px 56px rgba(38, 60, 90, 0.08);
}

.textiles-hero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 26px;
  padding: 18px;
}

.textiles-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 46px;
}

.eyebrow {
  margin: 0 0 18px;
  color: #a69580;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
}

.textiles-hero-copy h1,
.quick-strip h2,
.section-head h2,
.contact-section h2,
.product-modal-sidebar h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.94;
}

.textiles-hero-copy h1 {
  max-width: 9ch;
  font-size: clamp(3rem, 5.4vw, 5.3rem);
}

.hero-lead,
.section-copy,
.quick-strip p,
.contact-section p,
.product-modal-sidebar p {
  color: rgba(38, 60, 90, 0.8);
  line-height: 1.65;
}

.hero-lead {
  margin: 22px 0 0;
  max-width: 36ch;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.hero-points li,
.product-tags span,
.product-modal-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(191, 211, 227, 0.2);
  color: var(--ink-soft);
}

.hero-mail {
  margin: 20px 0 0;
  color: rgba(38, 60, 90, 0.72);
}

.hero-mail a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.textiles-hero-media {
  display: grid;
  grid-template-columns: 1.24fr 0.76fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 680px;
}

.textiles-hero-media figure {
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
}

.media-main {
  grid-row: 1 / span 2;
}

.textiles-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-strip,
.contact-section {
  padding: 34px 40px;
}

.quick-strip h2,
.contact-section h2 {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
}

.catalog-section {
  padding: 34px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.section-copy {
  margin: 12px 0 0;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(99, 119, 151, 0.1);
  box-shadow: 0 18px 42px rgba(38, 60, 90, 0.08);
  cursor: pointer;
}

.product-card-image {
  aspect-ratio: 4 / 4.6;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-body {
  padding: 20px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #a69580;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.product-card h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  line-height: 0.98;
}

.product-card p {
  margin: 10px 0 16px;
  color: rgba(38, 60, 90, 0.76);
  line-height: 1.55;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(38, 60, 90, 0.96), rgba(99, 119, 151, 0.9)),
    var(--ink);
  color: var(--white);
}

.contact-section .eyebrow {
  color: rgba(255, 255, 255, 0.84);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-section .button-secondary {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.product-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 31, 47, 0.58);
  backdrop-filter: blur(8px);
}

.product-modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
  width: min(1120px, 100%);
  max-height: min(86vh, 820px);
  padding: 18px;
  border-radius: 30px;
  background: rgba(248, 244, 238, 0.98);
  box-shadow: 0 28px 70px rgba(18, 28, 41, 0.25);
}

.product-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

.product-modal-media {
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(236, 230, 221, 0.88), rgba(255, 255, 255, 0.94));
}

.product-modal-media img {
  width: 100%;
  height: 100%;
  max-height: calc(86vh - 36px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.product-modal-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px 12px 18px 4px;
  min-height: 0;
}

.product-modal-sidebar h3 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.product-modal-sidebar p {
  margin: 14px 0 0;
}

.product-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.product-modal-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
  overflow: auto;
  min-height: 0;
}

.product-modal-thumbs button {
  padding: 0;
  border: 1px solid transparent;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.product-modal-thumbs button.is-active {
  border-color: rgba(38, 60, 90, 0.38);
  box-shadow: 0 0 0 2px rgba(38, 60, 90, 0.08);
}

.product-modal-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

@media (max-width: 1100px) {
  .textiles-hero,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .textiles-header {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 28px;
  }

  .textiles-nav {
    justify-content: center;
    gap: 18px;
  }

  .textiles-hero-copy,
  .quick-strip,
  .catalog-section,
  .contact-section {
    padding: 28px;
  }

  .textiles-hero-media {
    min-height: 520px;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .product-modal-dialog {
    grid-template-columns: 1fr;
    max-height: 88vh;
    padding: 14px;
    gap: 14px;
  }

  .product-modal-media img {
    max-height: 34vh;
  }

  .product-modal-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 22vh;
    padding-right: 4px;
  }

  .product-modal-sidebar {
    overflow: auto;
    padding: 6px 4px;
  }
}

@media (max-width: 560px) {
  .textiles-header,
  main {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .textiles-header {
    margin-top: 10px;
    padding: 12px;
  }

  .textiles-brand {
    width: 64px;
    height: 64px;
  }

  .textiles-hero-copy,
  .textiles-hero-copy h1,
  .hero-lead,
  .hero-mail,
  .textiles-hero-copy .eyebrow {
    text-align: center;
  }

  .textiles-hero-copy {
    align-items: center;
    padding: 24px;
  }

  .textiles-hero-copy h1 {
    max-width: 100%;
    font-size: clamp(2.7rem, 13vw, 4rem);
  }

  .hero-lead {
    max-width: 100%;
  }

  .hero-actions,
  .hero-points {
    justify-content: center;
  }

  .hero-points {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-strip h2,
  .section-head h2,
  .contact-section h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}
