/* Подарочная открытка A5 (148 × 210 мм) — одна разметка для превью в оформлении заказа и для печати из админки.
   Все размеры — в cqw от ширины открытки (1 мм = 100cqw / 148), поэтому превью любого размера = печать один в один.
   Рендер — public/gift-card.js (window.GiftCard). */
@font-face { font-family: 'Onest'; src: url('/fonts/onest/onest.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/fonts/caveat/caveat-cyr.woff2') format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Caveat'; src: url('/fonts/caveat/caveat-lat.woff2') format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }

.gc { container-type: inline-size; width: 100%; aspect-ratio: 148 / 210; }
.gc__in { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--gc-paper, #fbf6ec) center top / cover no-repeat; color: #2b2622;
  font-family: 'Onest', system-ui, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.gc__in::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; bottom: 0;   /* «бумага» под текстом — у всех дизайнов одинаково */
  background: linear-gradient(to bottom, transparent 0, var(--gc-paper, #fbf6ec) 18%, var(--gc-paper, #fbf6ec) 100%); }
.gc__body { position: absolute; z-index: 1; left: 9cqw; right: 9cqw; top: 58%; bottom: 9.5cqw; display: flex; flex-direction: column; }
.gc__title { margin: 0 0 2.4cqw; font: 800 var(--gc-title, 7.4cqw)/1.05 'Onest', system-ui, sans-serif; letter-spacing: -0.02em; color: var(--gc-accent, #1f6b3a); }
.gc__to { margin: 0 0 1.2cqw; font: 700 var(--gc-to, 6.6cqw)/1.1 'Caveat', cursive; }
.gc__msg { margin: 0; flex: 1; min-height: 0; overflow: hidden; font: 500 var(--gc-msg, 5.6cqw)/1.18 'Caveat', cursive; white-space: pre-line; overflow-wrap: anywhere; }
.gc__from { margin: 1.4cqw 0 0; align-self: flex-end; font: 700 6cqw/1.1 'Caveat', cursive; }
.gc__brand { position: absolute; z-index: 1; left: 50%; bottom: 2.8cqw; width: 38cqw; transform: translateX(-50%); opacity: .9; }
.gc__brand img { display: block; width: 100%; height: auto; }   /* логотипы ХоумЛаб 3D | Bambu Lab — images/site/gift-cards/brand.png */
.gc__ph { opacity: .35; }   /* подсказка вместо пустого поля — только в превью */

/* Блок «Это подарок» в оформлении заказа (checkout-gift.js) */
.gift-box { margin: 0;  /* отступы задаёт gap шага (16 px) — как между полями */ border-radius: 16px; background: #f6f3e4; overflow: hidden; transition: box-shadow .2s; box-shadow: 0 6px 20px rgba(120, 90, 20, .10); }
.gift-box[hidden] { display: none; }
.gift-box.is-on { box-shadow: inset 0 0 0 2px var(--accent, #00b22d), 0 6px 20px rgba(120, 90, 20, .10); }
/* шапка — праздничная плашка: подарки справа, светлый градиент под текстом (images/site/gift-cards/banner.webp) */
.gift-box__head { position: relative; display: flex; align-items: center; gap: 14px; min-height: 130px; padding: 16px 200px 16px 18px; cursor: pointer;
  background: linear-gradient(180deg, #fdefce 0%, #edefc6 50%, #cfe8c9 100%); }
/* панда справа — отдельной картинкой с мягким растворением левого края в общий градиент (без швов на любой ширине) */
.gift-box__head::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 190px; pointer-events: none;
  background: url('/images/site/gift-cards/banner2-m.webp') right bottom / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28%); mask-image: linear-gradient(90deg, transparent 0, #000 28%); }
.gift-box__head input, .gift-box__head > span { position: relative; z-index: 1; }
.gift-box__head input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent, #00b22d); cursor: pointer; }
.gift-box__ic, .gift-box__free { display: none; }
.gift-box__head > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.gift-box__head b { display: block; font: 800 19px/1.2 var(--display, inherit); letter-spacing: -0.01em; color: #1c2a1f; }
.gift-box__head small { display: block; color: #5d5a45; font-size: 14px; line-height: 1.4; }
.gift-box__head small em { font-style: normal; font-weight: 700; color: #0e7a2b; }
.gift-box__head:hover b { color: #0e7a2b; }
@media (max-width: 760px) {
  .gift-box__head { min-height: 0; padding: 176px 16px 16px; align-items: flex-start; }
  .gift-box__head::after { left: 0; width: auto; bottom: auto; height: 160px; background-position: center top; background-size: auto 160px;
    -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 100%); mask-image: linear-gradient(180deg, #000 80%, transparent 100%); }
  .gift-box__head input { margin-top: 2px; }
  .gift-box__head b { font-size: 17px; }
}
.gift-box__body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; padding: 18px 18px 18px; background: #f7f8f5; }
.gift-box__body[hidden] { display: none; }
.gift-box__lbl { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted, #5a635d); }
.gift-box__form .form-group { margin-top: 12px; }
.gift-box__form label small { float: right; font-weight: 400; color: var(--muted, #5a635d); }
.checkout-page .gift-box__form .form-group input, .checkout-page .gift-box__form .form-group textarea, .gift-box__form input, .gift-box__form textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid #d5dbd6; border-radius: 10px; background: #fff; font-size: 15px; line-height: 1.4; }
.checkout-page .gift-box__form .form-group input:focus, .checkout-page .gift-box__form .form-group textarea:focus { border-color: var(--accent, #00b22d); box-shadow: 0 0 0 3px rgba(0, 178, 45, .12); }
.gift-box__form textarea { min-height: 96px; resize: vertical; }
.gift-box__form label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
/* увеличение превью */
.gift-box__prev #giftPreview { position: relative; cursor: zoom-in; }
.gift-zoom-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 8px; border: 0; border-radius: 10px;
  background: #fff; color: var(--ink, #141a16); font: 600 13px/1 inherit; cursor: pointer; box-shadow: inset 0 0 0 1.5px #d5dbd6; }
.gift-zoom-btn:hover { box-shadow: inset 0 0 0 1.5px var(--accent, #00b22d); }
.gift-zoom { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(14, 20, 16, .72);
  cursor: zoom-out; animation: gzIn .2s ease; }
.gift-zoom[hidden] { display: none; }
.gift-zoom__card { width: min(560px, 92vw, calc((100vh - 48px) * 148 / 210)); box-shadow: 0 24px 60px rgba(0, 0, 0, .4); border-radius: 8px; overflow: hidden; }
.gift-zoom__x { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
@keyframes gzIn { from { opacity: 0; } to { opacity: 1; } }
.gift-box__note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted, #5a635d); }
.gift-pick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 2px; }
.gift-box__form { min-width: 0; }
.gift-pick__item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 0; border-radius: 10px; background: #fff; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px transparent; font: 600 11px/1.2 inherit; color: var(--ink, #141a16); text-align: center; transition: box-shadow .15s, transform .15s; }
.gift-pick__item img { width: 100%; height: auto; aspect-ratio: 148 / 210; object-fit: cover; border-radius: 6px; }
.gift-pick__item:hover { transform: translateY(-1px); }
.gift-pick__item.is-on { box-shadow: inset 0 0 0 2px var(--accent, #00b22d); }
.gift-box__prev .gc { box-shadow: 0 8px 24px rgba(20, 26, 22, .16); border-radius: 6px; overflow: hidden; }
@media (max-width: 760px) {
  .gift-box__body { grid-template-columns: minmax(0, 1fr); }
  .gift-box__prev { max-width: 260px; margin: 0 auto; width: 100%; }
  .gift-pick { display: flex; overflow-x: auto; max-height: none; scroll-snap-type: x mandatory; }
  .gift-pick__item { flex: 0 0 88px; scroll-snap-align: start; }
}
.gift-pick__item span { width: 100%; font-size: 10.5px; line-height: 1.2; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }

/* /otkrytka/ — конструктор открытки (gift-page.js) */
.gp__in { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; padding: 22px; border-radius: 18px; background: var(--bg-2, #f4f6f4); }
.gp__form { min-width: 0; }
.gp__form .gift-pick { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gp__step { margin-top: 18px !important; }
.gp__form .form-group { margin-top: 12px; display: flex; flex-direction: column; }
.gp__form label { margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.gp__form label small { float: right; font-weight: 400; color: var(--muted, #5a635d); }
.gp__form input, .gp__form textarea { width: 100%; padding: 12px 14px; border: 1.5px solid #d5dbd6; border-radius: 10px; background: #fff; font: inherit; font-size: 15px; box-sizing: border-box; }
.gp__form input:focus, .gp__form textarea:focus { outline: none; border-color: var(--accent, #00b22d); box-shadow: 0 0 0 3px rgba(0, 178, 45, .12); }
.gp__form textarea { min-height: 96px; resize: vertical; }
.gp__saved { margin: 12px 0 0; color: #0e7a2b; font-size: 14px; font-weight: 600; transition: transform .2s; }
.gp__saved.is-pulse { transform: scale(1.03); }
.gp__cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.gp__prev #gpPrev { cursor: zoom-in; box-shadow: 0 12px 32px rgba(20, 26, 22, .18); border-radius: 8px; overflow: hidden; }
@media (max-width: 860px) {
  .gp__in { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .gp__prev { max-width: 300px; margin: 0 auto; width: 100%; }
  .gp__form .gift-pick { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .gp__form .gift-pick__item { flex: 0 0 88px; scroll-snap-align: start; }
}
.gp__img { display: block; width: 100%; height: auto; aspect-ratio: 148 / 210; }
.gp__note { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff; color: var(--muted, #5a635d); font-size: 14px; line-height: 1.45; }
@media (max-width: 860px) {   /* телефон: выбор → превью → пояснение и кнопки */
  .gp__in { display: flex; flex-direction: column; gap: 14px; }
  .gp__form { display: contents; }
  .gp__form > .gift-box__lbl { order: 1; margin: 0; } .gp__form > .gift-pick { order: 2; } .gp__prev { order: 3; } .gp__note { order: 4; margin: 0; } .gp__cta { order: 5; margin: 0; }
}
