:root {
  --limestone: #f7f1e7;
  --ivory: #fffaf1;
  --sand: #d8c3a2;
  --sand-soft: #eadfcd;
  --terracotta: #9b5742;
  --brown: #2f2119;
  --brown-soft: #6f5b4b;
  --egyptian-blue: #123f73;
  --gold: #a9894b;
  --green: #557d55;
  --green-bg: #e6efe2;
  --amber: #a97835;
  --amber-bg: #f1e5cc;
  --gray: #77736e;
  --gray-bg: #e6e3df;
  --white: #fffdf8;
  --shadow: 0 14px 38px rgba(47, 33, 25, 0.11);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--brown);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--limestone);
  isolation: isolate;
  line-height: 1.55;
}

.page-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../public/images/egyptian-wallpaper-new.webp");
  background-repeat: repeat;
  background-size: 520px;
  opacity: 0.5;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .site-header {
  opacity: 0;
  pointer-events: none;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

#modal-root {
  position: relative;
  z-index: 100;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
textarea {
  outline-offset: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(18, 63, 115, 0.45);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(16px, 4vw, 48px) 18px;
  border-bottom: 1px solid rgba(47, 33, 25, 0.16);
  background:
    linear-gradient(90deg, rgba(18, 63, 115, 0.12), transparent 24%, rgba(155, 87, 66, 0.1)),
    rgba(255, 250, 241, 0.96);
  box-shadow: 0 12px 28px rgba(47, 33, 25, 0.12);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 50px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(18, 63, 115, 0.62);
  border-radius: 21px 21px 8px 8px;
  background:
    linear-gradient(180deg, rgba(169, 137, 75, 0.2), rgba(155, 87, 66, 0.11)),
    rgba(247, 241, 231, 0.92);
  box-shadow: inset 0 0 0 4px rgba(255, 250, 241, 0.82);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 8px 10px;
  border: 2px solid rgba(155, 87, 66, 0.62);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--egyptian-blue);
}

.brand-mark span {
  position: absolute;
  bottom: 8px;
  width: 18px;
  height: 2px;
  background: rgba(169, 137, 75, 0.82);
  box-shadow: 0 -20px 0 rgba(169, 137, 75, 0.58);
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-name,
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.brand-name {
  color: var(--egyptian-blue);
  font-size: 1.22rem;
}

.brand-subtitle {
  color: var(--terracotta);
  font-size: 0.76rem;
  font-weight: 700;
}

.site-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brown-soft);
  font-size: 0.9rem;
}

.site-nav a,
.site-footer a {
  text-decoration: none;
}

.site-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(18, 63, 115, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.62);
  color: var(--brown);
  font-weight: 700;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--egyptian-blue);
}

.site-nav a:hover {
  border-color: rgba(18, 63, 115, 0.45);
  background: rgba(18, 63, 115, 0.08);
}

main {
  overflow: hidden;
}

.hero,
.catalog-section,
.info-section,
.process-section,
.contact-section {
  padding: clamp(42px, 7vw, 82px) clamp(16px, 5vw, 64px);
}

.section-band {
  position: relative;
}

.section-band::before {
  content: "";
  position: absolute;
  inset: 18px clamp(14px, 4vw, 46px);
  pointer-events: none;
  border-top: 1px solid rgba(169, 137, 75, 0.36);
  border-bottom: 1px solid rgba(155, 87, 66, 0.13);
  opacity: 0.7;
}

.hero {
  min-height: 430px;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(18, 63, 115, 0.06), transparent 24%),
    linear-gradient(135deg, rgba(234, 223, 205, 0.72), rgba(255, 253, 248, 0.9));
}

.hero-content,
.section-heading,
.split-layout,
.steps,
.contact-section,
.site-footer {
  max-width: 1180px;
  margin-inline: auto;
}

.hero-content {
  position: relative;
  width: min(760px, 100%);
}

.hero-content::after {
  content: "";
  display: block;
  width: min(380px, 72vw);
  height: 12px;
  margin-top: 30px;
  background:
    linear-gradient(90deg, transparent 0 4%, var(--terracotta) 4% 9%, transparent 9% 15%),
    repeating-linear-gradient(90deg, rgba(18, 63, 115, 0.35) 0 18px, rgba(169, 137, 75, 0.42) 18px 22px, transparent 22px 36px);
  opacity: 0.45;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 830px;
  margin: 0;
  font-size: 4.35rem;
  line-height: 1.02;
}

h2 {
  margin: 0;
  font-size: 2.75rem;
  line-height: 1.08;
}

.hero-copy,
.hero-place,
.section-heading p {
  max-width: 680px;
  color: var(--brown-soft);
}

.hero-copy {
  margin: 18px 0 0;
  font-size: 1.22rem;
}

.hero-place {
  margin: 6px 0 28px;
  font-weight: 700;
}

.primary-link,
.secondary-button,
.text-button,
.filter-chip,
.icon-button,
.close-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  color: var(--white);
  background: var(--egyptian-blue);
  font-weight: 700;
  box-shadow: 0 9px 22px rgba(18, 63, 115, 0.19);
}

.primary-link:hover {
  background: #0d315c;
}

.catalog-section {
  background: rgba(255, 253, 248, 0.82);
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.filters {
  max-width: 1180px;
  margin: 0 auto 24px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.filter-chip {
  flex: 0 0 auto;
  padding: 9px 16px;
  color: var(--brown);
  background: var(--sand-soft);
  border: 1px solid rgba(47, 33, 25, 0.1);
}

.filter-chip.is-active {
  color: var(--white);
  background: var(--brown);
}

.pricing-note {
  max-width: 1180px;
  margin: 0 auto 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid rgba(169, 137, 75, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.78);
  color: var(--brown);
  box-shadow: 0 10px 26px rgba(47, 33, 25, 0.08);
}

.pricing-note strong {
  color: var(--egyptian-blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.06rem;
  font-weight: 500;
}

.pricing-note span {
  font-weight: 700;
}

.pricing-note small {
  color: var(--brown-soft);
  font-weight: 700;
}

.rug-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr));
  gap: 22px;
}

.rug-card {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(47, 33, 25, 0.1);
  border-radius: var(--radius);
  background: var(--ivory);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.rug-card:hover {
  border-color: rgba(18, 63, 115, 0.26);
  box-shadow: 0 18px 44px rgba(47, 33, 25, 0.15);
  transform: translateY(-2px);
}

.rug-card:focus-visible {
  outline: 3px solid rgba(18, 63, 115, 0.45);
  outline-offset: 4px;
}

.rug-card.status-sold .rug-media {
  filter: grayscale(0.75);
  opacity: 0.58;
}

.rug-media {
  aspect-ratio: 3 / 4;
  height: auto;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 10px;
  background: #efe5d4;
}

.rug-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.rug-image.is-landscape-card {
  width: 133.333%;
  height: 75%;
  max-width: none;
  max-height: none;
  transform: rotate(90deg);
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: var(--brown-soft);
  background:
    linear-gradient(135deg, rgba(155, 87, 66, 0.09), transparent 32%),
    repeating-linear-gradient(45deg, rgba(18, 63, 115, 0.06) 0 8px, transparent 8px 19px),
    var(--sand-soft);
}

.photo-placeholder span {
  font-size: 0.9rem;
}

.photo-placeholder strong {
  color: var(--brown);
  font-size: 1.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.photo-placeholder.large {
  min-height: 320px;
}

.rug-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.rug-topline,
.card-actions,
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rug-topline h3 {
  margin: 0;
  color: var(--brown);
  font-size: 1.45rem;
}

.rug-title {
  margin: 0;
  color: var(--brown-soft);
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill.status-available {
  color: var(--green);
  background: var(--green-bg);
}

.status-pill.status-reserved {
  color: var(--amber);
  background: var(--amber-bg);
}

.status-pill.status-sold {
  color: var(--gray);
  background: var(--gray-bg);
}

.rug-meta,
.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.rug-meta div,
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(47, 33, 25, 0.09);
  padding-bottom: 8px;
}

dt {
  color: var(--brown-soft);
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.card-actions {
  margin-top: auto;
}

.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
}

.secondary-button {
  color: var(--brown);
  background: transparent;
  border: 1px solid rgba(47, 33, 25, 0.18);
}

.secondary-button:hover {
  border-color: var(--egyptian-blue);
  color: var(--egyptian-blue);
}

.text-button {
  color: var(--terracotta);
  background: transparent;
  font-weight: 700;
}

.text-button:hover {
  color: var(--egyptian-blue);
}

.primary-link:disabled,
.secondary-button:disabled,
.text-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.info-section {
  background: rgba(247, 241, 231, 0.76);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(22px, 5vw, 60px);
  align-items: start;
}

.text-block {
  color: var(--brown-soft);
  font-size: 1.05rem;
}

.highlight-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.highlight-list li {
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid rgba(47, 33, 25, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
  text-align: center;
  font-weight: 700;
}

.process-section {
  background:
    linear-gradient(90deg, rgba(155, 87, 66, 0.09), transparent 34%, rgba(18, 63, 115, 0.06)),
    rgba(234, 223, 205, 0.78);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  list-style-position: inside;
}

.steps li {
  min-height: 118px;
  padding: 18px;
  border-top: 3px solid rgba(18, 63, 115, 0.5);
  background: rgba(255, 250, 241, 0.64);
  font-weight: 700;
}

.note {
  max-width: 1180px;
  margin: 8px auto 0;
  color: var(--brown-soft);
}

.contact-section {
  text-align: left;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(16px, 5vw, 64px);
  color: var(--brown-soft);
  border-top: 1px solid rgba(47, 33, 25, 0.11);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 0 0 100vmax rgba(255, 253, 248, 0.86);
  clip-path: inset(0 -100vmax);
}

.site-footer div {
  display: grid;
  gap: 2px;
}

.site-footer strong {
  color: var(--brown);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(47, 33, 25, 0.48);
}

.modal-panel {
  position: relative;
  width: min(1120px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--ivory);
  box-shadow: 0 24px 70px rgba(47, 33, 25, 0.28);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  color: var(--brown);
  background: rgba(255, 250, 241, 0.92);
  border: 1px solid rgba(47, 33, 25, 0.12);
  font-size: 1.7rem;
  line-height: 1;
}

.detail-modal {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
}

.detail-gallery {
  position: relative;
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: 12px;
  padding: 18px;
  background: #efe5d4;
}

.detail-photo {
  min-height: 440px;
  display: grid;
  place-items: center;
  background: rgba(255, 250, 241, 0.58);
}

.full-image-link {
  justify-self: start;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgba(18, 63, 115, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.78);
  color: var(--egyptian-blue);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.full-image-link:hover {
  background: rgba(18, 63, 115, 0.08);
}

.detail-image {
  width: 100%;
  max-height: 68vh;
  display: block;
  object-fit: contain;
}

.gallery-controls {
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.icon-button {
  width: 44px;
  color: var(--brown);
  background: rgba(255, 250, 241, 0.92);
  pointer-events: auto;
  font-size: 1.7rem;
}

.thumb-row {
  display: flex;
  gap: 8px;
  min-height: 64px;
  overflow-x: auto;
}

.thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--sand);
}

.thumb.is-active {
  border-color: var(--egyptian-blue);
}

.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.detail-content {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: clamp(26px, 5vw, 48px);
}

.detail-content h2 {
  font-size: 3rem;
}

.detail-content p {
  color: var(--brown-soft);
}

.detail-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.contact-modal {
  width: min(720px, 100%);
  padding: clamp(24px, 5vw, 44px);
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-summary {
  display: grid;
  gap: 6px;
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(47, 33, 25, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.form-summary p {
  margin: 0;
  color: var(--brown-soft);
}

.form-summary strong {
  color: var(--brown);
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--brown-soft);
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(47, 33, 25, 0.18);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--brown);
  background: var(--white);
}

.contact-form textarea {
  resize: vertical;
}

.full-field,
.contact-form button,
.form-note,
.form-status {
  grid-column: 1 / -1;
}

.form-note {
  margin: 0;
  color: var(--brown-soft);
  font-size: 0.9rem;
}

.form-status {
  min-height: 24px;
  margin: 0;
  font-weight: 700;
}

.form-status.is-success {
  color: var(--green);
}

.form-status.is-error {
  color: #9a312d;
}

.contact-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.form-success {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(85, 125, 85, 0.24);
  border-radius: var(--radius);
  background: var(--green-bg);
  color: var(--green);
  font-weight: 700;
}

.form-success p {
  margin: 0;
}

.form-success p + p {
  margin-top: 8px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  background: var(--limestone);
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  h1 {
    font-size: 3.25rem;
  }

  h2,
  .detail-content h2 {
    font-size: 2.35rem;
  }

  .hero-copy {
    font-size: 1.12rem;
  }

  .site-header,
  .site-footer,
  .split-layout,
  .detail-modal {
    grid-template-columns: 1fr;
  }

  .site-header,
  .site-footer {
    display: grid;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

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

  .detail-gallery {
    grid-template-rows: minmax(300px, auto) auto;
  }

  .detail-photo {
    min-height: 320px;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 2.45rem;
  }

  h2,
  .detail-content h2 {
    font-size: 1.95rem;
  }

  .hero-copy {
    font-size: 1.03rem;
  }

  .hero,
  .catalog-section,
  .info-section,
  .process-section,
  .contact-section {
    padding-inline: 14px;
  }

  .site-header {
    padding-inline: 14px;
  }

  .site-nav {
    font-size: 0.86rem;
  }

  .hero {
    min-height: 380px;
  }

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

  .rug-card {
    min-height: 0;
  }

  .rug-media {
    aspect-ratio: 3 / 4;
  }

  .rug-topline,
  .card-actions,
  .rug-meta div,
  .detail-list div {
    align-items: flex-start;
  }

  .card-actions,
  .detail-list div {
    flex-direction: column;
  }

  .secondary-button,
  .text-button,
  .primary-link {
    width: 100%;
  }

  .highlight-list,
  .steps,
  .contact-form {
    grid-template-columns: 1fr;
  }

  .pricing-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .steps li {
    min-height: 88px;
  }

  .modal-overlay {
    padding: 0;
    place-items: stretch;
  }

  .modal-panel {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .detail-gallery {
    padding: 12px;
  }

  .detail-photo {
    min-height: 300px;
  }

  .gallery-controls {
    left: 16px;
    right: 16px;
  }
}
