:root {
  --bg: #060606;
  --text: #f2ede4;
  --text-dim: #a89f92;
  --accent: #c8623a;
  --accent-pink: #e0578f;
  --border: rgba(242, 237, 228, 0.14);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
}

body.home {
  height: 100%;
  overflow: hidden;
}

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

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

/* ---------- Topbar (glass, overlays hero) ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 74px;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 62px;
  width: auto;
  display: block;
}

.main-nav {
  display: flex;
  gap: 36px;
}

.main-nav a {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.instagram-link,
.home-link {
  display: flex;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.instagram-link:hover,
.home-link:hover {
  color: var(--text);
}

.lang-switch {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-switch:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* ---------- Page ---------- */
body.home main {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Hero ---------- */
.hero {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding-top: 74px;
  display: flex;
}

.hero-frame {
  position: relative;
  flex: 1;
  min-height: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 55%, transparent 100%),
                       linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 55%, transparent 100%),
              linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-composite: intersect;
}

/* ---------- Categories ---------- */
.categories {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 5vw 3vh;
  margin-top: -14vh;
  max-width: 1400px;
  width: 100%;
  margin-inline: auto;
}

.star-border-container {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 50% 50% 10px 10px;
  overflow: hidden;
  padding: 2.5px;
}

.border-gradient-bottom,
.border-gradient-top {
  position: absolute;
  display: block;
  width: 55%;
  height: 45%;
  opacity: 0.9;
  border-radius: 50%;
  z-index: 0;
  will-change: transform;
}

.border-gradient-bottom {
  bottom: -12px;
  right: -55%;
  background: linear-gradient(to left, var(--accent-pink) 0%, var(--accent) 35%, transparent 80%);
  animation: star-movement-bottom 3s linear infinite;
}

.border-gradient-top {
  top: -12px;
  left: -55%;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent-pink) 35%, transparent 80%);
  animation: star-movement-top 3s linear infinite;
}

@keyframes star-movement-bottom {
  0% { transform: translate(0%, 0%); }
  100% { transform: translate(-320%, 0%); }
}

@keyframes star-movement-top {
  0% { transform: translate(0%, 0%); }
  100% { transform: translate(320%, 0%); }
}

.category-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 9px 9px;
  overflow: hidden;
  isolation: isolate;
  z-index: 1;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 45%);
  z-index: 1;
}

.categories .category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 55% at 50% 38%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0.92) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 30%);
  z-index: 1;
}

.category-label {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

@media (max-width: 900px) {
  .categories {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-nav {
    gap: 18px;
  }
  .main-nav a {
    font-size: 0.8rem;
  }
}

@media (max-width: 640px) {
  .main-nav {
    display: none;
  }
}

@media (max-width: 520px) {
  .categories {
    gap: 14px;
  }
}

@media (max-height: 640px) {
  body.home {
    height: auto;
    overflow: auto;
  }
  body.home main {
    height: auto;
  }
  .hero {
    height: 80vh;
  }
}

/* ---------- ColorBends WebGL background ---------- */
.colorbends-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

/* ---------- Inner pages (gallery / subcategories / products) ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 134px 40px 60px;
}

.page-title {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 28.8px;
  letter-spacing: 0.02em;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-spark {
  width: 0.85em;
  height: 0.85em;
  flex-shrink: 0;
}

.page-title-spark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* fallback text glyph when no star image is used */
.page-title-spark:empty::before {
  content: "+";
  color: var(--accent);
  font-size: 1.1rem;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-cards.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cards.two-col .star-border-container.flat {
  aspect-ratio: 4 / 3;
}

/* ---------- Centered page (used when content should sit as one block, e.g. main gallery) ---------- */
.page.centered {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Title + grid share one centered block, so the title's left edge lines up
   exactly with the first card's left edge at every viewport size.
   Fluid width lets the cards scale; the vh term keeps the 2x2 grid of 4/3
   cards inside the viewport height (grid height = 2 * col/(4/3) + gap). */
.page.centered .centered-block {
  width: min(72vw, calc(62vh * 4 / 3), 1000px);
  margin-inline: auto;
}

.star-border-container.flat {
  /* square, matching instagram posts so uploaded images fit without cropping */
  aspect-ratio: 1 / 1;
  border-radius: 16px;
}

.star-border-container.flat .category-card {
  border-radius: 15px;
}


.hover-swap {
  position: relative;
}

.hover-swap .img-default,
.hover-swap .img-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease;
}

.hover-swap .img-hover {
  opacity: 0;
}

.hover-swap:hover .img-default {
  opacity: 0;
}

.hover-swap:hover .img-hover {
  opacity: 1;
}

@media (max-width: 900px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .grid-cards {
    grid-template-columns: 1fr;
  }
}

/* ---------- Back link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  transition: color 0.2s ease;
  margin-bottom: 28px;
}

.back-link:hover {
  color: var(--text);
}

.back-arrow {
  font-size: 1.1rem;
  line-height: 1;
}

/* ---------- Product cards (list page) ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  /* frosted glass panel */
  background: rgba(242, 237, 228, 0.035);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border: 1px solid rgba(242, 237, 228, 0.08);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.product-card:hover {
  background: rgba(242, 237, 228, 0.055);
  border-color: rgba(242, 237, 228, 0.14);
}

/* --- media area: image with the travelling glow around it --- */
.product-card-media {
  position: relative;
  display: block;
  margin: 10px 10px 0;
  border-radius: 8px;
  /* the glow lives in this padding ring, hugging the image */
  padding: 2px;
  overflow: hidden;
  isolation: isolate;
}

.media-glow {
  position: absolute;
  display: block;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  z-index: 0;
}

.media-frame {
  position: relative;
  z-index: 1;
  display: block;
  border-radius: 7px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #111;
}

.media-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.45s ease, transform 0.5s ease;
}

.media-frame .img-hover {
  opacity: 0;
}

.product-card-media:hover .img-default {
  opacity: 0;
}

.product-card-media:hover .img-hover {
  opacity: 1;
}

.product-card-media:hover .media-frame img {
  transform: scale(1.03);
}

/* --- body: divider, spark, name, price, arrow --- */
.product-card-body {
  position: relative;
  /* top padding clears the spark that straddles the divider */
  padding: 20px 12px 15px;
  margin-top: 12px;
  border-top: 2px solid rgba(200, 98, 58, 0.55);
}

/* larger spark straddling the divider line */
.card-spark {
  position: absolute;
  top: -12px;
  left: 12px;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.product-card-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-right: 40px;
}

/* small spark in front of the name */
.name-spark {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  object-fit: contain;
}

.product-card-price {
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.product-card-go {
  position: absolute;
  right: 12px;
  bottom: 13px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(242, 237, 228, 0.18);
  color: var(--text-dim);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.product-card-go svg {
  display: block;
}

.product-card-go:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(200, 98, 58, 0.16);
  transform: translateX(2px);
}

@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

.empty-note {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* section heading for collections split into volumes */
.vol-title {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 40px 0 18px;
}

.vol-title:first-child {
  margin-top: 0;
}

/* ---------- Product detail page ---------- */
.product-page {
  max-width: 1200px;
}

.product-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.product-topbar .back-link {
  margin-bottom: 0;
}

.product-pager {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.pager-btn {
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.pager-btn:hover {
  color: var(--text);
}

.pager-btn.is-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* --- main 3-column layout: thumbs | hero | info --- */
.product-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.product-thumbs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thumb {
  padding: 0;
  border: 1px solid transparent;
  background: #111;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.6;
}

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

.thumb:hover,
.thumb.is-active {
  opacity: 1;
  border-color: var(--border);
}

.product-hero {
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

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

/* --- right info column --- */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.product-collection {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.product-title {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.product-info .product-price {
  position: static;
  font-size: 1rem;
  color: var(--text);
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.size-options {
  display: flex;
  gap: 10px;
}

.size-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.size-btn:hover {
  border-color: var(--text-dim);
}

.size-btn.is-active {
  background: #6b5b52;
  border-color: #6b5b52;
}

.size-guide {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  width: fit-content;
  transition: color 0.2s ease;
}

.size-guide:hover {
  color: var(--text);
}

.order-btn {
  display: block;
  text-align: center;
  padding: 15px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.order-btn:hover {
  background: rgba(242, 237, 228, 0.06);
  border-color: var(--text-dim);
}

.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.care-block {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.care-toggle {
  cursor: pointer;
  transition: color 0.2s ease;
}

.care-toggle:hover {
  color: var(--text);
}

.care-text {
  display: none;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.care-text.is-open {
  display: block;
}

/* --- on body --- */
.on-body {
  margin-top: 64px;
}

.on-body-title {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.on-body-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.on-body-item {
  background: #111;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.on-body-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.on-body-item:hover img {
  transform: scale(1.04);
}

@media (max-width: 1000px) {
  .product-main {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .product-info {
    grid-column: 1 / -1;
    margin-top: 12px;
  }
}

@media (max-width: 700px) {
  .product-main {
    grid-template-columns: 1fr;
  }
  .product-thumbs {
    flex-direction: row;
    order: 2;
    overflow-x: auto;
  }
  .product-thumbs .thumb {
    width: 68px;
    flex-shrink: 0;
  }
  .on-body-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
