/* =========================================================================
   هدیه برای او — جعبه‌ی هدیه‌ی آتلیه (inc/gift.php + assets/js/gift.js)
   ========================================================================= */
.gf {
  --gf-burg: var(--rg-burgundy, #4e0000);
  --gf-navy: var(--rg-navy, #13273f);
  --gf-navy-deep: var(--rg-navy-deep, #0d1b2e);
  --gf-ivory: var(--rg-cream, #fdfbf7);
  --gf-paper: #f1e9db;
  --gf-bw: min(70vw, 300px);          /* عرض جعبه */
  position: relative;
  margin: 56px auto 0;
  max-width: 1200px;
  overflow-x: clip;                    /* کاغذهای باز از لبه‌ی صفحه بیرون نزنند */
  overflow-y: visible;
}
.gf *, .gf *::before, .gf *::after { box-sizing: border-box; }
@media (min-width: 1024px) { .gf { margin-top: 80px; --gf-bw: 400px; } }

.gf-hint {
  margin: 4px 16px 0; min-height: 1.6em;
  font-size: 12px; line-height: 1.6; color: rgba(19, 39, 63, 0.62); text-align: right;
  transition: opacity 0.3s ease;
}
.gf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- صحنه ---------- */
.gf-stage {
  position: relative; width: var(--gf-bw); margin: 14px auto 0;
  padding-top: calc(var(--gf-bw) * 0.837);      /* جای درِ باز بالای جعبه */
}
.gf-scene {
  position: relative; width: 100%; aspect-ratio: 270 / 226;
  perspective: 1100px;
  will-change: transform;
}
.gf-shadow {
  position: absolute; left: -5%; right: -5%; bottom: -10%; height: 18%;
  background: radial-gradient(closest-side, rgba(40, 10, 10, 0.35), transparent);
  pointer-events: none;
}
.gf-base {
  position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(170deg, #4d0915, #2d040b);
  box-shadow: inset 0 0 0 5px #3f0711, inset 0 10px 18px rgba(0, 0, 0, 0.45);
}
/* کاغذ پوستی ساده (شیری، کمی نیمه‌شفاف، با الیاف خیلی محو) */
.gf-paper, .gf-flap {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 40%),
    repeating-linear-gradient(100deg, rgba(150, 120, 80, 0.05) 0 1px, transparent 1px 5px),
    var(--gf-paper);
}
.gf-paper { position: absolute; inset: 2.6%; border-radius: 2px; box-shadow: inset 0 8px 14px rgba(0, 0, 0, 0.25); }

.gf-slots { position: absolute; inset: 0; pointer-events: none; }
.gf-slot {
  position: absolute; display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  transition: left 0.6s var(--rg-ease, cubic-bezier(.16,1,.3,1)), top 0.6s var(--rg-ease, cubic-bezier(.16,1,.3,1)),
              width 0.6s var(--rg-ease, cubic-bezier(.16,1,.3,1)), height 0.6s var(--rg-ease, cubic-bezier(.16,1,.3,1)), opacity 0.3s ease;
}
.gf-slot img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; filter: drop-shadow(0 8px 6px rgba(40, 10, 10, 0.3)); }
/* عکس‌های با پس‌زمینه: مثل یک عکس کوچک که لای کاغذ گذاشته شده */
.gf-slot.is-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; border: 3px solid var(--gf-ivory); filter: none; box-shadow: 0 6px 10px -4px rgba(40, 10, 10, 0.4); }
.gf-slot.is-hidden { opacity: 0; }
.gf-fly { position: fixed; z-index: 9990; pointer-events: none; margin: 0; transform-origin: 0 0; }
.gf-fly img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 8px rgba(40, 10, 10, 0.3)); }
.gf-fly.is-photo img { object-fit: cover; border-radius: 4px; border: 3px solid var(--gf-ivory); filter: none; }

/* قلب‌های ریز بورگاندی (داخل جعبه و روی کاغذ بسته) */
.gf-hearts { position: absolute; inset: 0; pointer-events: none; }
.gf-heart {
  position: absolute; width: 5.4%; aspect-ratio: 1; opacity: 0;
  transform: translate(-50%, -50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23a3141f'/%3E%3Cstop offset='.55' stop-color='%236a0a14'/%3E%3Cstop offset='1' stop-color='%234e0000'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M12 21.2C5.6 16.4 1 12.3 1 7.4 1 4 3.6 1.4 6.9 1.4c2.1 0 3.9 1.1 5.1 2.8 1.2-1.7 3-2.8 5.1-2.8C20.4 1.4 23 4 23 7.4c0 4.9-4.6 9-11 13.8z' fill='url(%23g)'/%3E%3Cpath d='M6.2 4.6c-1.6.4-2.6 1.8-2.5 3.4' stroke='%23fff' stroke-opacity='.45' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1.5px 1.5px rgba(40, 0, 6, 0.35));
}
.gf-heart.is-sm { width: 4.2%; }

/* دو لبه‌ی کاغذ: بیرون از جعبه باز، سپس روی محصول تا می‌شوند */
.gf-flap {
  position: absolute; top: 1%; bottom: 1%; width: 51%;
  border: 1px solid rgba(190, 170, 140, 0.35); opacity: 0.94;
  box-shadow: 0 6px 12px -6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.gf-flap--l { left: -48.5%; transform-origin: 100% 50%; transform: perspective(800px) rotateY(-38deg); }
.gf-flap--r { right: -48.5%; transform-origin: 0 50%; transform: perspective(800px) rotateY(38deg); }

.gf-seal {
  position: absolute; left: 50%; top: 50%; width: 12.6%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(0);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0;
  background: radial-gradient(circle at 38% 32%, #6a0c18, #3a0510);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(241, 233, 219, 0.35);
}
.gf-seal img { width: 60%; height: auto; }

/* در جعبه: رو = همان رنگ داخل جعبه، پشت = عکس واقعی داخل در */
.gf-lid {
  position: absolute; inset: -1.5%; transform-style: preserve-3d; transform-origin: 50% 0;
  transform: rotateX(-180deg); pointer-events: none;
}
.gf-face { position: absolute; inset: 0; border-radius: 6px; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.gf-face--in { background: var(--gf-lid) center / 100% 100% no-repeat, #4c0d17; transform: rotateX(180deg); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.15); }
.gf-face--out {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 95% at 50% 40%, #520a17 0%, #44081a 45%, #2f050c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 200, 200, 0.25), inset 0 0 0 1px rgba(0, 0, 0, 0.25), 0 22px 30px -16px rgba(40, 0, 6, 0.7);
}
.gf-face--out::before { content: ''; position: absolute; inset: 0; border-radius: 6px; opacity: 0.05; background: repeating-linear-gradient(115deg, #fff 0 1px, transparent 1px 4px); }
.gf-face--out img { width: 29%; height: auto; margin-top: -4%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }

/* روبان و پاپیون شیری */
.gf-rb { position: absolute; box-shadow: 0 1px 3px rgba(60, 30, 20, 0.35); }
.gf-rb--v { left: 72%; top: -1.5%; bottom: -1.5%; width: 6%; margin-left: -3%; transform-origin: 50% 0; transform: scaleY(0);
  background: linear-gradient(90deg, #e6dccb, #fbf6ec 45%, #fffdf8 55%, #e2d6c2); }
.gf-rb--h { top: 72%; left: -1.5%; right: -1.5%; height: 7%; margin-top: -3.5%; transform-origin: 100% 50%; transform: scaleX(0);
  background: linear-gradient(180deg, #e6dccb, #fbf6ec 45%, #fffdf8 55%, #e2d6c2); }
.gf-bow { position: absolute; left: 72%; top: 72%; width: 46%; height: auto; aspect-ratio: 96 / 66; transform: translate(-50%, -52%) scale(0); opacity: 0;
  filter: drop-shadow(0 4px 5px rgba(60, 30, 20, 0.35)); }

/* ---------- کارت‌های محصول ---------- */
.gf-row {
  list-style: none; margin: 30px 0 0; padding: 4px 16px 14px;
  display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gf-row::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .gf-row { justify-content: center; flex-wrap: wrap; overflow: visible; } }
.gf-item { flex: 0 0 auto; scroll-snap-align: start; }
.gf-card {
  position: relative; display: block; width: 118px; padding: 3px; border: 0; border-radius: 18px; cursor: pointer;
  background: linear-gradient(160deg, #1a2f4a, var(--gf-navy-deep) 60%, #091422);
  box-shadow: 0 14px 22px -14px rgba(9, 20, 34, 0.6);
  font: inherit; color: inherit; text-align: right; -webkit-tap-highlight-color: transparent;
  transition: transform 0.35s var(--rg-ease, cubic-bezier(.16,1,.3,1));
}
.gf-card:active { transform: scale(0.96); }
.gf-card:focus-visible { outline: 2px solid var(--gf-burg); outline-offset: 3px; }
.gf-card__ph { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 15px; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, #fffdf9, #f1ece4 75%, #e8e1d6); }
/* عکس کامل و بدون برش؛ اسم و قیمت زیر عکس */
.gf-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } /* عکس ۳:۴ در قاب ۳:۴: کامل و بدون حاشیه */
.gf-card__lb {
  display: block; padding: 7px 7px 5px;
  color: #fff; font-size: 10.5px; line-height: 1.6;
}
.gf-card__lb b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-card__pr { opacity: 0.85; }
.gf-card[aria-pressed="true"] .gf-card__ph { outline: 2px solid var(--gf-ivory); outline-offset: -6px; }
.gf-card__ck {
  position: absolute; top: 9px; left: 9px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff; background: var(--gf-burg);
  opacity: 0; transform: scale(0.4); transition: opacity 0.25s ease, transform 0.4s var(--rg-ease, cubic-bezier(.16,1,.3,1));
}
.gf-card__ck svg { width: 13px; height: 13px; }
.gf-card[aria-pressed="true"] .gf-card__ck { opacity: 1; transform: none; }
.gf.is-locked .gf-card { cursor: default; }

/* ---------- انتخاب سایز ---------- */
.gf-sizes {
  margin: 4px 16px 0; padding: 12px 14px; border-radius: var(--rg-r, 22px);
  border: 1px solid var(--rg-edge, rgba(255,255,255,.72)); background: var(--rg-glass, rgba(232,240,248,.5));
  -webkit-backdrop-filter: var(--rg-blur, blur(24px) saturate(170%)); backdrop-filter: var(--rg-blur, blur(24px) saturate(170%));
  box-shadow: var(--rg-hi, inset 0 1px 0 rgba(255,255,255,.92)), var(--rg-shadow, 0 18px 40px -22px rgba(28,48,76,.42));
  color: var(--gf-navy);
}
.gf-sizes[hidden] { display: none; }
@media (min-width: 640px) { .gf-sizes { max-width: 460px; margin-inline: auto; } }
.gf-sizes__t { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; }
.gf-sizes__list { display: flex; flex-wrap: wrap; gap: 6px; }
.gf-sizes__list button {
  min-width: 44px; min-height: 36px; padding: 6px 12px; border-radius: 99px; cursor: pointer;
  border: 1px solid rgba(19, 39, 63, 0.25); background: rgba(255, 255, 255, 0.7); color: var(--gf-navy);
  font: inherit; font-size: 12px; font-weight: 700;
}
.gf-sizes__list button:hover, .gf-sizes__list button:focus-visible { border-color: var(--gf-burg); color: var(--gf-burg); outline: none; }
.gf-sizes__x { margin-top: 8px; padding: 4px 0; border: 0; background: none; color: rgba(19, 39, 63, 0.6); font: inherit; font-size: 11.5px; cursor: pointer; }

/* ---------- دکمه‌ها ---------- */
.gf-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 14px 16px 0; }
.gf-btn {
  width: 100%; max-width: 420px; min-height: 48px; padding: 12px 18px; border: 0; border-radius: 99px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 800; color: var(--gf-ivory);
  background: linear-gradient(160deg, #1d3554, var(--gf-navy-deep) 60%, #081321);
  box-shadow: 0 12px 22px -10px rgba(9, 20, 34, 0.7);
  transition: opacity 0.3s ease, transform 0.35s var(--rg-ease, cubic-bezier(.16,1,.3,1));
}
.gf-btn:active { transform: scale(0.97); }
.gf-btn:focus-visible { outline: 2px solid var(--gf-burg); outline-offset: 3px; }
.gf-btn[disabled] { opacity: 0.5; cursor: default; transform: none; }
.gf-btn[aria-busy="true"] { cursor: progress; }
.gf-edit { padding: 6px 10px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; color: var(--gf-navy); text-decoration: underline; text-underline-offset: 4px; }
.gf-edit[hidden] { display: none; }

.gf-noscript { display: none; flex-wrap: wrap; gap: 8px; margin: 12px 16px 0; }
.gf-noscript a { padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(19,39,63,.2); color: var(--gf-navy); font-size: 12px; }
.gf-admin-note { margin: 24px 16px; padding: 10px 14px; border-radius: 12px; border: 1px dashed rgba(78,0,0,.4); font-size: 12px; color: var(--rg-burgundy, #4e0000); }

@media (prefers-reduced-motion: reduce) {
  .gf-slot, .gf-card, .gf-card__ck, .gf-btn { transition: none; }
}

/* حالت بسته بدون Web Animations API (مرورگرهای خیلی قدیمی) */
.gf.is-closed .gf-stage { padding-top: calc(var(--gf-bw) * 0.06); }
.gf.is-closed .gf-flap--l { transform: perspective(800px) rotateY(-178deg); }
.gf.is-closed .gf-flap--r { transform: perspective(800px) rotateY(178deg); }
.gf.is-closed .gf-seal { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.gf.is-closed .gf-lid { transform: rotateX(0deg); }
.gf.is-closed .gf-rb--v { transform: scaleY(1); }
.gf.is-closed .gf-rb--h { transform: scaleX(1); }
.gf.is-closed .gf-bow { opacity: 1; transform: translate(-50%, -52%) scale(1); }
