/* iOS: не увеличивать текст автоматически */
html { -webkit-text-size-adjust: 100%; }

/* ===== Modal base ===== */
.reveal-modal{
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
}
.reveal-modal.is-open{ pointer-events: auto; opacity: 1; }

/* Backdrop */
.reveal-backdrop{
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .28s ease;
}
.reveal-modal.is-open .reveal-backdrop{ opacity: 1; }

/* Dialog */
.reveal-dialog{
  position: relative; z-index: 1;
  width: min(420px, 92vw);
  min-width: 320px;
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 50% 0%, #151515 0%, #0f0f0f 60%, #0a0a0a 100%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 14px 44px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04);
  transform: translateY(12px) scale(.98);
  opacity: 0;
  transition: transform .32s cubic-bezier(.22,.61,.36,1), opacity .32s ease;

  /* чтобы ничего не «выпирало» */
  overflow: hidden;
}

/* показываем диалог */
.reveal-modal.is-open .reveal-dialog{
  transform: none; opacity: 1;
}

/* ===== Header (title + close) ===== */
.reveal-header{
  position: relative;                    /* ⟵ якорь для absolute-кнопки */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: nowrap;

  /* внутренние отступы так, чтобы справа поместилась кнопка */
  padding: 6px 52px 6px 16px;            /* ⟵ 52px = ширина кнопки + зазор */
  min-height: 48px;                      /* ⟵ высота под кнопку */
  contain: layout paint;                 /* ⟵ iOS-устойчивость */
}

.reveal-title{
  margin: 0;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.3;
  text-align: left;
  color: rgba(255, 255, 255, 0.5);

  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* твой margin-left здесь уже не нужен — отступ сделан паддингом у шапки */
}

/* тонкая декоративная линия под шапкой */
.reveal-header-line{
  height: 1px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  opacity: .9;
}

/* ===== Close button (устойчиво для iOS) ===== */
.reveal-close {
  position: absolute;                    /* ⟵ фиксируем внутри .reveal-header */
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  display: grid; place-items: center;
  border-top-right-radius: 16px;
  z-index: 10;

  background: transparent;
  border-left: 1px solid rgba(255,255,255,.08);
  backdrop-filter: saturate(120%) blur(8px);
  -webkit-backdrop-filter: saturate(120%) blur(8px);
  background-clip: padding-box;

  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transform: translateZ(0);
  will-change: transform;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;

  contain: layout;                       /* ⟵ ещё одна iOS-страховка */
}

/* SVG-крестик */
.reveal-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  fill: none;
  pointer-events: none;
}

@media (hover:hover){
  .reveal-close:hover{
    transform: translateZ(0) scale(1.05);
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.28);
  }
}
.reveal-close:active{ transform: translateZ(0) scale(.98); }
.reveal-close:focus-visible{
  /* box-shadow: 0 0 0 3px rgba(255,255,255,.25); */
}

/* На очень маленьких экранах — кнопка компактнее */
@media (max-width: 479px){
  .reveal-close{ width: 40px; height: 40px; }  /* было 32 — пусть будет чуть больше для тапа */
  .reveal-close svg{ width: 14px; height: 14px; stroke-width: 2; }
  .reveal-header {
    min-height: 40px;
  }
}

/* Подстраховка только для iOS WebKit */
@supports (-webkit-touch-callout: none) {
  .reveal-header { contain: layout paint; }
}

/* ===== Subtitle ===== */
.reveal-sub{
  margin: 32px 16px 16px;
  font-family: "Lora", serif;
  font-style: italic;
  font-weight: 400;
  color: rgba(255,255,255,.85);
  text-align: center;
}

/* ===== Form ===== */
.reveal-form{ 
  display: grid; 
  gap: 12px;
  margin: 0 16px 16px;
}
.reveal-label{
  font-family: "Lora", serif; font-style: italic; font-weight: 400;
  font-size: .95rem; color: rgba(255,255,255,.8);
}
.reveal-input{
  width: 100%;
  background: #0f0f0f; color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  font-size: 16px;                 /* ⟵ чтобы iOS не зумил */
  padding: .75rem .9rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.reveal-input:focus{
  border-color: rgba(255,255,255,.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}

.reveal-submit{
  justify-self: center;
  margin-top: 6px;
  font-family: "Lora", serif;
  font-style: italic;
  font-weight: 600;
  letter-spacing: .6px;
  font-size: .98rem;
  color: #fff; background: #1a1a1a;
  border: 1px solid rgba(255,255,255,.18);
  padding: .6rem 1.2rem; border-radius: 10px; cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
@media (hover:hover){
  .reveal-submit:hover{
    transform: translateY(-1px);
    background:#202020; border-color: rgba(255,255,255,.28);
  }
}

.reveal-hint{
  margin: 6px 0 0; text-align: center;
  font-family: "Lora", serif; font-style: italic;
  font-size: .92rem; color: #ffb3b3;
}

/* ===== Breakpoints ===== */
@media (max-width: 991px){
  .reveal-title{ font-size: 1.5rem; }
}
@media (max-width: 767px){
  .reveal-title{ font-size: 1.35rem; }
}
@media (max-width: 479px){
  .reveal-title{ font-size: 1.25rem; }
  /* .reveal-dialog{ padding: 24px 18px; border-radius: 14px; } */
}




.gift-preview {
  padding: 16px;
  text-align: center;
}
.gift-preview img {    
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0px 0px 4px 2px #e0b66c;
}
.gift-actions {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px 20px;
}
.gift-actions .btn {
  font-family: "Lora", serif;
  font-style: italic;
  padding: .55rem 1.2rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  background: #161616;
  color: #fff;
  cursor: pointer;
  transition: .2s;
  text-decoration: none;
}
.gift-actions .btn:hover {
  background: #202020;
}
.reveal-gift-intro {
  margin: 24px 16px 12px;
  font-family: "Lora", serif;
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(255,255,255,.9);
  text-align: center;
  line-height: 1.5;
}
.reveal-gift-intro strong {
  color: #fff;
  font-weight: 600;
}
.reveal-gift-intro strong.amount {
  color: #e0b66c;
  font-weight: 600;
}
.reveal-gift-image {
  opacity: 0;
  transform: translateY(12px) scale(1.02);
  /* transition: opacity .6s ease, transform .6s ease; */
}
.reveal-modal.is-open .reveal-gift-image {
  opacity: 1;
  transform: none;
}

#gift-modal .reveal-dialog {
  transition: transform 2.55s cubic-bezier(.22,.61,.36,1), opacity 2.5s ease;
}
#gift-modal .reveal-backdrop {
  transition: opacity 2.45s ease;
}