/* =============================================
   style.css — Natali · демонстраційна версія
   ============================================= */

/* ── Custom properties ── */
:root {
  --clr-plum:      #332238;
  --clr-plum-soft: #59415F;
  --clr-gold:      #C69A59;
  --clr-gold-hover:#B8894A;
  --clr-gold-deep: #7A5428;
  --clr-cream:     #FAF4EC;
  --clr-sheet:     #F4EBE1;
  --clr-ink:       #302431;
  --clr-on-gold:   #302431;
  --clr-on-plum:   #FAF4EC;
  --clr-danger:    #9C2F3A;
  --clr-danger-h:  #7E2430;
  --clr-photo-well:#EFE6DA;

  --clr-bg:        var(--clr-cream);
  --clr-surface:   #FFFCF8;
  --clr-border:    #E4D5C6;
  --clr-accent:    var(--clr-gold);
  --clr-accent-h:  var(--clr-gold-hover);
  --clr-text:      var(--clr-ink);
  --clr-muted:     #6E5A68;
  --clr-overlay:   rgba(51, 34, 56, 0.72);
  --clr-demo-bg:   #F3E6C4;
  --clr-demo-text: #6A4A22;

  --ff-display: "Cormorant Garamond", "Georgia", serif;
  --ff-body:    "Inter", "Segoe UI", sans-serif;

  --radius:  12px;
  --shadow:  0 8px 24px rgba(51, 34, 56, 0.12);
  --transition: 0.22s ease;

  --container-max: 1160px;
  --page-gutter:   clamp(16px, 3vw, 40px);
  --logo-home:     680px;
  --logo-header:   460px;
  --sheet-radius:  20px;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background-color: var(--clr-plum);
  scroll-behavior: smooth;
}

html::before {
  background-color: var(--clr-plum);
  background-image: url("../images/site-fabric.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

body {
  background: transparent;
  color: var(--clr-on-plum);
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

body:not(.admin-body) {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

a { color: var(--clr-gold-deep); }
a:focus-visible { outline: 2px solid var(--clr-plum); outline-offset: 3px; border-radius: 3px; }

/* ── Demo banner ── */
.site-header,
.site-footer {
  align-self: stretch;
  width: 100%;
}

/* ── Header ── */
.site-header {
  background: transparent;
  border-bottom: 1px solid rgba(198, 154, 89, 0.35);
  text-align: center;
  padding: 8px var(--page-gutter) 16px;
}

.site-brand {
  display: block;
  width: min(var(--logo-header), 100%);
  margin-inline: auto;
  line-height: 0;
  border-radius: 8px;
}

.site-header--home .site-brand {
  width: min(var(--logo-home), 100%);
}

.site-brand img {
  width: 100%;
  height: auto;
}

.site-header a:focus,
.site-header a:focus-visible,
.site-brand:focus,
.site-brand:focus-visible {
  outline: 2px solid #E4C48A;
  outline-offset: 4px;
}

.site-header__contact {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.82rem;
  color: var(--clr-muted);
  background: var(--clr-demo-bg);
  color: var(--clr-demo-text);
  padding: 5px 14px;
  border-radius: 20px;
  font-weight: 600;
}

/* ── Main content wrapper ── */
.main {
  background: var(--clr-sheet);
  border: 1px solid rgba(198, 154, 89, 0.38);
  border-radius: var(--sheet-radius);
  box-shadow: 0 18px 48px rgba(20, 10, 18, 0.28);
  color: var(--clr-ink);
  flex: 1 0 auto;
  margin: 8px 0 32px;
  padding: clamp(24px, 4vw, 40px) clamp(18px, 3vw, 36px) 48px;
  text-align: start;
  width: min(var(--container-max), calc(100% - 2 * var(--page-gutter)));
}

/* ── Section heading ── */
.section-title {
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  color: var(--clr-gold-deep);
  margin-bottom: 24px;
  letter-spacing: 0.03em;
}

/* ── Filters ── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-btn {
  appearance: none;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: 24px;
  color: var(--clr-muted);
  cursor: pointer;
  font-family: var(--ff-body);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 20px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-btn:hover {
  border-color: var(--clr-gold-deep);
  color: var(--clr-gold-deep);
}

.filter-btn.active,
.filter-btn:focus-visible {
  background: var(--clr-gold);
  border-color: var(--clr-gold);
  color: var(--clr-on-gold);
  outline: none;
}

.filter-btn:focus-visible {
  outline: 2px solid var(--clr-plum);
  outline-offset: 2px;
}

/* ── Product grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

/* empty state */
.product-grid:empty::after {
  content: "Нічого не знайдено у цій категорії.";
  grid-column: 1 / -1;
  text-align: center;
  color: var(--clr-muted);
  font-style: italic;
  padding: 40px 0;
}

.product-grid--managed:empty::after {
  content: none;
  display: none;
}

/* ── Product card ── */
.product-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(90, 60, 20, 0.16);
  outline: none;
}

.product-card:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}

/* placeholder image */
.product-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--clr-photo-well);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--clr-accent);
  opacity: 0.6;
}

.product-card__placeholder svg {
  width: 54px;
  height: 54px;
}

.product-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__placeholder-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--clr-demo-bg);
  color: var(--clr-demo-text);
  padding: 2px 8px;
  border-radius: 10px;
}

.product-card__demo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--clr-demo-bg);
  color: var(--clr-demo-text);
  padding: 3px 9px;
  border-radius: 10px;
}

.product-card__body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card__category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-gold-deep);
}

.product-card__name {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--clr-text);
}

.product-card__price {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.82rem;
  color: var(--clr-muted);
  font-style: italic;
}

.modal__contact {
  align-self: flex-start;
  background: var(--clr-accent);
  border-radius: 24px;
  color: var(--clr-on-gold);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 600;
  justify-content: center;
  line-height: 1.2;
  margin-top: 4px;
  padding: 10px 18px;
  text-decoration: none;
}

.modal__contact:hover {
  background: var(--clr-accent-h);
  color: var(--clr-on-gold);
}

.modal__contact:focus-visible {
  outline: 2px solid var(--clr-accent-h);
  outline-offset: 2px;
}

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--clr-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal window ── */
.modal {
  background: var(--clr-surface);
  border-radius: var(--radius);
  box-shadow: 0 16px 64px rgba(42, 24, 8, 0.28);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform: translateY(18px) scale(0.97);
  transition: transform var(--transition);
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

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

.modal__img-wrap {
  position: relative;
  background: var(--clr-photo-well);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  overflow: hidden;
}

.modal__photo {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: cover;
  display: block;
}

.modal__photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--clr-text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal__photo-nav { left: 10px; }
.modal__photo-nav--next { left: auto; right: 10px; }

.modal__photo-nav:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}

.modal__photo-count {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  margin: 0;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--clr-text);
  font-size: 0.78rem;
}

.modal__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--clr-accent);
  opacity: 0.55;
}

.modal__placeholder svg {
  width: 72px;
  height: 72px;
}

.modal__placeholder-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--clr-demo-bg);
  color: var(--clr-demo-text);
  padding: 3px 10px;
  border-radius: 10px;
}

.modal__content {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__category {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-gold-deep);
}

.modal__name {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--clr-text);
}

.modal__divider {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: 4px 0;
}

.modal__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clr-muted);
  margin-bottom: 2px;
}

.modal__value {
  font-size: 0.95rem;
  color: var(--clr-text);
}

.modal__description {
  font-size: 0.93rem;
  color: var(--clr-muted);
  line-height: 1.65;
}

.modal__price-block {
  margin-top: 4px;
  background: var(--clr-demo-bg);
  border-radius: 8px;
  padding: 10px 14px;
}

.modal__price-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clr-demo-text);
  margin-bottom: 2px;
}

.modal__price {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--clr-demo-text);
}

.modal__order-note {
  font-size: 0.78rem;
  color: var(--clr-muted);
  font-style: italic;
  margin-top: auto;
  padding-top: 8px;
}

/* ── Close button ── */
.modal__close {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--clr-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  z-index: 1;
}

.modal__close:hover { color: var(--clr-text); background: var(--clr-border); }
.modal__close:focus-visible { outline: 2px solid var(--clr-accent); outline-offset: 2px; }

/* ── Footer ── */
.site-footer {
  background: transparent;
  border-top: 1px solid rgba(198, 154, 89, 0.28);
  text-align: center;
  padding: 4px 2px;
  font-size: 0.82rem;
  color: #E8D7C4;
}

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

/* ── Responsive ── */
@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .modal__contact,
  .contact-form__submit,
  .contact-otp__actions,
  .contact-otp__actions .home-action {
    align-self: stretch;
    display: flex;
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  .contact-otp__actions {
    flex-direction: column;
  }

  .site-header {
    padding: 4px var(--page-gutter) 12px;
  }

  .modal__content {
    padding: 24px 20px;
  }
}

/* ── Catalog status (loading / error) ── */
.catalog-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 8px;
  font-size: 0.95rem;
  color: var(--clr-muted);
}

.catalog-status[hidden] {
  display: none;
}

.catalog-status--error {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--clr-text);
  background: #F8E8E6;
  border: 1px solid #E4B8B4;
  border-radius: var(--radius);
  padding: 20px 24px;
}

.catalog-status--error strong {
  color: var(--clr-danger);
}

.catalog-status__retry {
  appearance: none;
  background: var(--clr-accent);
  border: none;
  border-radius: 20px;
  color: var(--clr-on-gold);
  cursor: pointer;
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
  padding: 7px 20px;
  transition: background var(--transition);
}
.catalog-status__retry:hover { background: var(--clr-accent-h); }
.catalog-status__retry:focus-visible { outline: 2px solid var(--clr-accent-h); outline-offset: 2px; }

/* Spinner */
.catalog-status__spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--clr-border);
  border-top-color: var(--clr-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Contact page ── */
.site-header--compact {
  padding: 8px var(--page-gutter) 16px;
}

.contact-back {
  margin-bottom: 12px;
}

.contact-lead {
  color: var(--clr-muted);
  margin-bottom: 8px;
  max-width: 40rem;
}

.contact-product {
  align-items: center;
  display: flex;
  gap: 16px;
  margin: 20px 0 28px;
}

.contact-product__photo {
  background: var(--clr-photo-well);
  border-radius: 12px;
  flex-shrink: 0;
  height: 112px;
  overflow: hidden;
  width: 112px;
}

.contact-product__photo img,
.contact-product__photo .product-card__placeholder {
  height: 100%;
  width: 100%;
}

.contact-product__photo img {
  object-fit: cover;
}

.contact-product__name {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
}

.contact-form {
  max-width: 32rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.contact-field label {
  color: var(--clr-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-field label span {
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.contact-field input,
.contact-field textarea {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: 8px;
  color: var(--clr-text);
  font-family: var(--ff-body);
  font-size: 0.95rem;
  padding: 10px 14px;
  transition: border-color var(--transition);
  width: 100%;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--clr-accent);
  outline: none;
}

.contact-field input[readonly] {
  background: var(--clr-bg);
  cursor: default;
}

.contact-field__note {
  color: var(--clr-muted);
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}

.contact-field__note[hidden] {
  display: none !important;
}

.contact-otp {
  max-width: 32rem;
}

.contact-otp[hidden],
.contact-otp__verify[hidden] {
  display: none !important;
}

.contact-otp .contact-lead {
  margin-top: 0;
}

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

.contact-otp__verify .contact-field__note {
  margin-bottom: 16px;
}

.contact-otp__actions .home-action:disabled,
.contact-otp .contact-form__submit:disabled {
  cursor: default;
  opacity: 0.65;
}

.contact-field textarea {
  min-height: 96px;
  resize: vertical;
}

.contact-form__submit {
  appearance: none;
  background: var(--clr-accent);
  border: 0;
  border-radius: 24px;
  color: var(--clr-on-gold);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 600;
  justify-content: center;
  padding: 10px 24px;
}

.contact-form__submit:hover { background: var(--clr-accent-h); }
.contact-form__submit:disabled { cursor: not-allowed; opacity: 0.55; }
.contact-form__submit:focus-visible,
.contact-field input:focus-visible,
.contact-field textarea:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}

.contact-error {
  background: #F8E8E6;
  border: 1px solid #E4B8B4;
  border-radius: 8px;
  color: var(--clr-danger);
  font-size: 0.88rem;
  margin-bottom: 14px;
  padding: 10px 14px;
}

.contact-success {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 36rem;
  padding: 20px 22px;
}

.contact-success h2 {
  color: var(--clr-gold-deep);
  font-family: var(--ff-display);
  font-size: 1.7rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.contact-success p {
  color: var(--clr-text);
}

@media (max-width: 600px) {
  .contact-product {
    align-items: flex-start;
  }
}

/* ── Home, auth, account ── */
.site-header--bar {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 0;
  text-align: center;
}

.site-header--bar .site-brand {
  flex: none;
  margin-inline: auto;
  max-width: calc(100% - 2 * var(--page-gutter));
  min-width: 0;
  width: min(var(--logo-header), calc(100% - 2 * var(--page-gutter)));
}

.site-header__account {
  border-top: 1px solid rgba(198, 154, 89, 0.35);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
  padding: 12px var(--page-gutter) 14px;
  width: 100%;
}

.site-header__account[hidden] {
  display: none !important;
}

.site-header__account a.site-header__action {
  align-items: center;
  background: transparent;
  border: 1.5px solid var(--clr-gold);
  border-radius: 999px;
  color: var(--clr-gold);
  display: inline-flex;
  font-size: 1rem;
  font-weight: 600;
  justify-content: center;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  text-decoration: none;
}

.site-header__account a.site-header__action:hover {
  background: rgba(198, 154, 89, 0.18);
  color: #F0D7A8;
}

.site-header__account a.site-header__action:focus-visible {
  outline: 2px solid #E4C48A;
  outline-offset: 3px;
}

.site-header__account a.site-header__action:active {
  background: rgba(198, 154, 89, 0.32);
  color: #F6E6C4;
}

.site-header__account a.site-header__action--solid {
  background: var(--clr-gold);
  border-color: var(--clr-gold);
  color: var(--clr-on-gold);
}

.site-header__account a.site-header__action--solid:hover {
  background: var(--clr-gold-hover);
  border-color: var(--clr-gold-hover);
  color: var(--clr-on-gold);
}

.site-header__account a.site-header__action--solid:active {
  background: #A67C3E;
  border-color: #A67C3E;
  color: var(--clr-on-gold);
}

/* Gold vine ornaments. Each side stretches from the screen edge to the
   centered buttons or footer text. A short mask fades only the inner tip. */
.site-header__account {
  align-items: center;
  flex-wrap: nowrap;
  padding: 6px 8px;
}

.site-header__account a.site-header__action {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.site-header__account::before,
.site-header__account::after {
  align-self: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  content: "";
  flex: 1 1 0;
  height: auto;
  min-width: 0;
  opacity: 0.94;
  pointer-events: none;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.site-header__account::before {
  aspect-ratio: 993 / 188;
  background-image: url("../images/ornament-nav-left.webp?v=1");
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 44px), transparent);
}

.site-header__account::after {
  aspect-ratio: 996 / 182;
  background-image: url("../images/ornament-nav-right.webp?v=1");
  -webkit-mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 44px), transparent);
}

.site-footer {
  align-items: center;
  column-gap: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.site-footer p {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  max-width: 40rem;
  min-width: 0;
  padding: 8px 2px;
  position: relative;
  z-index: 1;
}

.site-footer::before,
.site-footer::after {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  content: "";
  grid-row: 1;
  justify-self: stretch;
  min-width: 0;
  opacity: 0.94;
  pointer-events: none;
  width: 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.site-footer::before {
  aspect-ratio: 985 / 167;
  background-image: url("../images/ornament-footer-left.webp?v=1");
  grid-column: 1;
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 40px), transparent);
}

.site-footer::after {
  aspect-ratio: 970 / 171;
  background-image: url("../images/ornament-footer-right.webp?v=1");
  grid-column: 3;
  -webkit-mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 40px), transparent);
}

@media (max-width: 860px) {
  .site-header__account::before,
  .site-header__account::after {
    aspect-ratio: auto;
    background-size: auto 100%;
    height: 68px;
  }

  .site-header__account::before {
    background-position: left center;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent);
  }

  .site-header__account::after {
    background-position: right center;
    -webkit-mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 18px), transparent);
  }
}

@media (max-width: 1100px) {
  .site-footer::before,
  .site-footer::after {
    aspect-ratio: auto;
    background-size: auto 100%;
    height: 58px;
  }

  .site-footer::before {
    background-position: left center;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 16px), transparent);
  }

  .site-footer::after {
    background-position: right center;
    -webkit-mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 16px), transparent);
  }
}

@media (max-width: 720px) {
  .site-footer {
    column-gap: 0;
    grid-template-areas:
      "orn-l orn-r"
      "copy copy";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 6px 0 16px;
    row-gap: 2px;
  }

  .site-footer::before,
  .site-footer::after {
    height: 52px;
  }

  .site-footer::before { grid-area: orn-l; }
  .site-footer::after { grid-area: orn-r; }

  .site-footer p {
    grid-area: copy;
    padding: 4px 16px 0;
  }
}

/* Wide screens keep the leafy curl at laptop size. Only the thin intertwined
   branches continue toward the buttons or footer text, so the PNG is not
   scaled up with the viewport. Below 1480px the original ::before/::after
   ornaments stay in place. */
.site-header__tools {
  display: contents;
}

.gold-vine {
  display: none;
}

@media (min-width: 1480px) {
  .site-header__tools {
    align-items: center;
    border-top: 1px solid rgba(198, 154, 89, 0.35);
    box-sizing: border-box;
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding: 6px 8px;
    width: 100%;
  }

  .site-header__tools:has(.site-header__account[hidden]) {
    display: none;
  }

  .site-header__tools .site-header__account {
    border-top: 0;
    flex: 0 0 auto;
    margin-top: 0;
    padding: 0;
    position: relative;
    width: auto;
    z-index: 1;
  }

  .site-header__tools .site-header__account::before,
  .site-header__tools .site-header__account::after,
  .site-footer::before,
  .site-footer::after {
    background: none;
    content: none;
    display: none;
  }

  .gold-vine {
    align-items: stretch;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    opacity: 0.94;
    overflow: hidden;
    pointer-events: none;
    position: relative;
    z-index: 0;
  }

  .gold-vine__head,
  .gold-vine__run {
    background-repeat: no-repeat;
    height: 100%;
  }

  .gold-vine__head {
    background-position: center;
    background-size: 100% 100%;
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
  }

  .gold-vine__run {
    background-size: auto 100%;
    flex: 1 1 auto;
    min-width: 0;
  }

  .gold-vine--nav-left,
  .gold-vine--footer-left {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 40px), transparent);
  }

  .gold-vine--nav-right,
  .gold-vine--footer-right {
    -webkit-mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 40px), transparent);
  }

  .gold-vine--nav-left,
  .gold-vine--nav-right {
    height: 112px;
  }

  .gold-vine--footer-left,
  .gold-vine--footer-right {
    align-self: center;
    height: 80px;
  }

  .gold-vine--nav-left {
    --h: 112;
    --src-h: 188;
    --overlap: 36;
  }

  .gold-vine--nav-left .gold-vine__head {
    aspect-ratio: 736 / 188;
    background-image: url("../images/ornament-nav-left-head.webp?v=1");
  }

  .gold-vine--nav-left .gold-vine__run {
    background-image: url("../images/ornament-nav-left-run.webp?v=1");
    background-position: left center;
    margin-left: calc(var(--overlap) * var(--h) / var(--src-h) * -1px);
  }

  .gold-vine--nav-right {
    --h: 112;
    --src-h: 182;
    --overlap: 36;
  }

  .gold-vine--nav-right .gold-vine__head {
    aspect-ratio: 756 / 182;
    background-image: url("../images/ornament-nav-right-head.webp?v=1");
  }

  .gold-vine--nav-right .gold-vine__run {
    background-image: url("../images/ornament-nav-right-run.webp?v=1");
    background-position: right center;
    margin-right: calc(var(--overlap) * var(--h) / var(--src-h) * -1px);
  }

  .gold-vine--footer-left {
    --h: 80;
    --src-h: 167;
    --overlap: 36;
    grid-column: 1;
    grid-row: 1;
  }

  .gold-vine--footer-left .gold-vine__head {
    aspect-ratio: 506 / 167;
    background-image: url("../images/ornament-footer-left-head.webp?v=1");
  }

  .gold-vine--footer-left .gold-vine__run {
    background-image: url("../images/ornament-footer-left-run.webp?v=1");
    background-position: left center;
    margin-left: calc(var(--overlap) * var(--h) / var(--src-h) * -1px);
  }

  .gold-vine--footer-right {
    --h: 80;
    --src-h: 171;
    --overlap: 48;
    grid-column: 3;
    grid-row: 1;
  }

  .gold-vine--footer-right .gold-vine__head {
    aspect-ratio: 626 / 171;
    background-image: url("../images/ornament-footer-right-head.webp?v=2");
  }

  .gold-vine--footer-right .gold-vine__run {
    background-image: url("../images/ornament-footer-right-run.webp?v=2");
    background-position: right center;
    margin-right: calc(var(--overlap) * var(--h) / var(--src-h) * -1px);
  }
}

.home-lead {
  color: var(--clr-muted);
  margin-bottom: 28px;
  max-width: 38rem;
}

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

button.home-action {
  appearance: none;
  cursor: pointer;
  font-family: var(--ff-body);
}

.home-action {
  align-items: center;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-accent);
  border-radius: 24px;
  color: var(--clr-gold-deep);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 600;
  justify-content: center;
  padding: 10px 22px;
  text-decoration: none;
}

.home-action--primary {
  background: var(--clr-gold);
  border-color: var(--clr-gold);
  color: var(--clr-on-gold);
}

.home-action--danger {
  background: var(--clr-danger);
  border-color: var(--clr-danger);
  color: #fff;
}

.home-action:hover {
  background: var(--clr-gold-hover);
  border-color: var(--clr-gold-hover);
  color: var(--clr-on-gold);
}

.home-action--danger:hover {
  background: var(--clr-danger-h);
  border-color: var(--clr-danger-h);
  color: #fff;
}

.home-action:focus-visible {
  outline: 2px solid var(--clr-accent-h);
  outline-offset: 2px;
}

.account-identity {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px 16px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.account-email {
  flex: 1 1 auto;
  font-size: 1.05rem;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-logout {
  appearance: none;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: 24px;
  color: var(--clr-text);
  cursor: pointer;
  flex-shrink: 0;
  font: inherit;
  font-weight: 600;
  padding: 8px 16px;
}

.account-logout:hover,
.account-logout:focus-visible {
  border-color: var(--clr-gold-deep);
  color: var(--clr-gold-deep);
}

.account-logout:focus-visible {
  outline: 2px solid var(--clr-accent-h);
  outline-offset: 2px;
}

.account-logout:disabled {
  cursor: wait;
  opacity: 0.7;
}

.account-inquiries .section-title {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 14px;
}

.account-inquiries__empty {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  color: var(--clr-muted);
  padding: 16px 18px;
}

.account-inquiries__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.account-inquiries__item {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.account-inquiries__product {
  font-family: var(--ff-display);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.2;
}

.account-inquiries__time {
  color: var(--clr-muted);
  display: block;
  font-size: 0.82rem;
  margin: 4px 0 8px;
}

.account-inquiries__message {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.account-inquiries__open {
  appearance: none;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  cursor: pointer;
  display: block;
  font: inherit;
  padding: 14px 16px;
  text-align: left;
  width: 100%;
}

.account-inquiries__open:hover,
.account-inquiries__open:focus-visible {
  border-color: var(--clr-accent);
}

.account-inquiries__open:focus-visible {
  outline: 2px solid var(--clr-accent-h);
  outline-offset: 2px;
}

.account-inquiries__item {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.account-inquiries__state,
.account-thread__state {
  color: var(--clr-gold-deep);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 4px;
}

.account-inquiries__state--sent,
.account-thread__state--sent {
  color: var(--clr-muted);
}

.account-thread__header {
  align-items: start;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.account-thread__heading {
  min-width: 0;
}

.account-thread__back,
.account-thread__delete {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--clr-gold-deep);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0;
}

.account-thread__delete {
  justify-self: end;
  text-align: right;
}

.account-thread__back:focus-visible,
.account-thread__delete:focus-visible {
  outline: 2px solid var(--clr-plum);
  outline-offset: 2px;
}

.account-thread__title {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 500;
  margin: 0;
  overflow-wrap: anywhere;
}

.account-thread__log {
  background: #fff;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  margin: 12px 0;
  max-height: min(420px, 46vh);
  overflow-y: auto;
  padding: 12px;
}

.account-thread__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
}

.account-thread__bubble {
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  max-width: 100%;
  padding: 12px 14px;
}

.account-thread__bubble--customer {
  background: var(--clr-surface);
}

.account-thread__bubble--owner {
  background: #fff;
  border-color: var(--clr-accent);
}

.account-thread__who {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-thread__body {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.account-thread__edit {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 1.5px solid var(--clr-gold-deep);
  border-radius: 999px;
  color: var(--clr-gold-deep);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  justify-content: center;
  margin-top: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
}

.account-thread__edit:hover {
  background: rgba(122, 84, 40, 0.08);
}

.account-thread__edit:focus-visible {
  outline: 2px solid var(--clr-plum);
  outline-offset: 3px;
}

.account-thread__edit:active {
  background: rgba(122, 84, 40, 0.16);
}

.account-thread__time,
.account-thread__note {
  color: var(--clr-muted);
  font-size: 0.82rem;
}

.account-thread__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.account-thread__form[hidden],
.account-inquiries__list[hidden],
.modal__contact[hidden] {
  display: none !important;
}

.account-thread__form label {
  color: var(--clr-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-thread__form textarea {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: 8px;
  color: inherit;
  font: inherit;
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

.account-thread__form textarea:focus-visible {
  border-color: var(--clr-accent);
  outline: 2px solid var(--clr-accent);
  outline-offset: 1px;
}

.account-thread__delete {
  color: var(--clr-danger);
}

.account-dialog {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--clr-text);
  max-width: 440px;
  padding: 22px;
  width: calc(100% - 32px);
}

.account-dialog::backdrop {
  background: var(--clr-overlay);
}

.account-dialog h2 {
  font-family: var(--ff-display);
  font-size: 1.7rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.account-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.account-edit-dialog {
  max-width: 420px;
}

.account-edit-dialog label {
  color: var(--clr-muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.account-edit-dialog textarea {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: 8px;
  color: var(--clr-ink);
  font: inherit;
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

.account-edit-dialog textarea:focus-visible {
  border-color: var(--clr-accent);
  outline: 2px solid var(--clr-accent);
  outline-offset: 1px;
}

.account-edit-dialog .contact-error {
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .account-dialog__actions,
  .account-dialog__actions .home-action,
  .account-thread__form .contact-form__submit {
    align-self: stretch;
    display: flex;
    width: 100%;
  }

  .account-dialog__actions {
    flex-direction: column;
  }

  .account-thread__header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-thread__delete {
    grid-column: 2;
    grid-row: 1;
  }

  .account-thread__heading {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .account-thread__log {
    max-height: min(240px, 38vh);
  }
}

#auth-wait .home-action,
#login-form .home-action,
#code-login .home-action {
  margin-top: 16px;
}

#auth-modes[hidden],
#login-form[hidden],
#register-form[hidden],
#code-login[hidden] {
  display: none !important;
}

.modal__favorite {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 252, 248, 0.94);
  box-shadow: 0 1px 6px rgba(42, 24, 8, 0.35);
  color: #7d7872;
  cursor: pointer;
}

.modal__favorite svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.modal__favorite:focus-visible {
  color: #e07a9a;
  outline: 2px solid #e07a9a;
  outline-offset: 2px;
}

@media (hover: hover) {
  .modal__favorite:hover {
    color: #e07a9a;
  }
}

.modal__favorite[aria-pressed="true"] {
  color: #b4235a;
}

.modal__favorite[aria-pressed="true"] svg {
  fill: currentColor;
}

.modal__favorite[hidden],
.modal__favorite-login[hidden],
#account-sections[hidden],
#account-favorites[hidden],
#account-inquiries-section[hidden],
#account-favorites-guest[hidden],
#account-favorites-merge[hidden],
#account-guest-inquiries[hidden] {
  display: none !important;
}

.account-favorites-note {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  margin: 0 0 18px;
  padding: 14px 16px;
}

.account-favorites-note p {
  margin: 0 0 12px;
}

#account-favorites-merge {
  margin: 0 0 16px;
}

.modal__favorite-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.modal__favorite-login p {
  margin: 0;
}

.modal__favorite-login__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-favorites .section-title {
  margin-top: 0;
}

.account-favorites .account-inquiries__empty a {
  display: inline-block;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .home-actions,
  .home-action,
  #auth-wait .home-action {
    align-self: stretch;
    display: flex;
    width: 100%;
  }

  .home-actions {
    flex-direction: column;
  }
}
