/* ==========================================================================
   Мануфактура Стелі — palette.html only
   ========================================================================== */

/* ---- swatch hover popover ---- */
.swatch-popover {
  position: fixed;
  z-index: 300;
  display: flex;
  width: 440px;
  max-width: calc(100vw - 32px);
  background: var(--cream-card);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  box-shadow:
    0 30px 60px rgba(32, 29, 24, 0.22),
    0 0 0 1px var(--accent-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease),
    visibility 0.2s;
}
.swatch-popover.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.swatch-popover.centered {
  left: 50%;
  top: 50%;
  transform: translate(-50%, 8px);
}
.swatch-popover.centered.show {
  transform: translate(-50%, -50%);
}
.swatch-popover-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(32, 29, 24, 0.06);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  display: none;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}
.swatch-popover-close:hover {
  color: var(--accent);
  background: var(--bg-alt);
}
.swatch-popover-media {
  position: relative;
  flex: 0 0 150px;
  background: var(--bg-alt);
  border-radius: var(--radius) 0 0 var(--radius);
  overflow: hidden;
}
.swatch-popover-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.swatch-popover-body {
  flex: 1;
  padding: 1.3em 1.4em;
  min-width: 0;
}
@media (max-width: 640px) {
  .swatch-popover {
    flex-direction: column;
    width: min(360px, calc(100vw - 32px));
  }
  .swatch-popover-media {
    flex: 0 0 170px;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .swatch-popover-close {
    display: flex;
    background: rgba(32, 29, 24, 0.5);
    color: #fff;
  }
  .swatch-popover-close:hover {
    background: var(--accent);
    color: #fff;
  }
}
.swatch-popover-body h4 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.5em;
  color: var(--ink);
}
.swatch-popover-body p {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 1em;
  max-height: 140px;
  overflow-y: auto;
}
.btn-sm {
  padding: 0.6em 1.3em;
  font-size: 0.68rem;
  white-space: nowrap;
}

/* ---- order modal shell ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 14, 0.55);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s var(--ease),
    visibility 0.25s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  position: relative;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: var(--cream-card);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 2.2em;
  box-shadow:
    0 0 0 1px rgba(15, 83, 158, 0.08),
    0 40px 80px rgba(32, 29, 24, 0.28);
  transform: translateY(16px);
  transition: transform 0.25s var(--ease);
}
.modal-overlay.show .modal-card {
  transform: translateY(0);
}
.modal-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.3em;
}
.modal-sub {
  font-size: 0.84rem;
  color: var(--accent);
  margin-bottom: 1.4em;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  transition:
    color 0.2s ease,
    background 0.2s ease;
}
.modal-close:hover {
  color: var(--accent);
  background: var(--bg-alt);
}
@media (max-width: 640px) {
  .modal-card .cf-turnstile {
    margin-left: -2.2em;
    margin-right: -2.2em;
    display: flex;
    justify-content: center;
  }
}
