/* ============================================================
   GIFT HINT FEATURE — modal + gift page + success panel
   Loaded on product pages and on /gift/{token} only.
   Uses sixfront brand fonts (Bicubik display, IBMPlexMono mono),
   declared in app.css — do not re-@font-face here.
   ============================================================ */

:root {
  --hint-black:    #0a0a0a;
  --hint-white:    #f5f4f0;
  --hint-gray-50:  #f5f4f0;
  --hint-gray-100: #e8e7e3;
  --hint-gray-200: #d4d3cf;
  --hint-gray-300: #b8b7b2;
  --hint-gray-500: #7a7975;
  --hint-gray-700: #3d3d3a;
  --hint-font:     'IBMPlexMono', monospace;
  --hint-mono:     'IBMPlexMono', monospace;
  --hint-display:  'Bicubik', serif;
}

/* --- Кнопка на странице товара (стиль «В кошик», но инвертированная и чуть меньше) --- */
.product-page-hint-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5556vw;
  width: 100%;
  min-height: 3.5vw;
  padding: 0.9vw 0;
  background: var(--color-white, #fff);
  color: var(--color-black, #0a0a0a);
  border: 1px solid var(--color-black, #0a0a0a);
  font-family: 'Bicubik', serif;
  font-size: 1.1111vw;
  line-height: 120%;
  cursor: pointer;
  transition: .3s;
  margin-bottom: 1.3889vw;
}
.product-page-hint-btn:hover {
  background: var(--color-black, #0a0a0a);
  color: var(--color-white, #fff);
}
/* sixfront's app.css forces `color: var(--color-black)` on ALL <span> via
   `p, a, span, h1-h6 { color: ... }`, and `* { font-family: 'IBMPlexMono' }`
   wins over inherited font-family from the button. Force both. */
.product-page-hint-btn span { color: inherit; font-family: 'Bicubik', serif; }
.hint-btn-icon { font-size: 1.1vw; line-height: 1; }
.hint-btn-text-mobile { display: none; }

@media (max-width: 768px) {
  .product-page-hint-btn {
    min-height: 52px;
    padding: 14px 0;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 12px;
  }
  .hint-btn-icon { font-size: 16px; }
  .hint-btn-text-desktop { display: none; }
  .hint-btn-text-mobile { display: inline; }
}

/* --- MODAL overlay + slide-in sheet --- */
#hint-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  background: rgba(10,10,10,0);
  align-items: flex-end;
  justify-content: flex-end;
  transition: background .3s;
}
#hint-modal-overlay.visible {
  display: flex;
  background: rgba(10,10,10,0.6);
}
#hint-modal {
  background: #ffffff;
  width: 520px;
  max-width: 100%;
  height: 100vh;
  overflow-y: auto;
  padding: 56px 48px 80px;
  transform: translateX(100%);
  transition: transform .5s cubic-bezier(.16,1,.3,1);
  position: relative;
  font-family: var(--hint-font);
  color: var(--hint-black);
  box-sizing: border-box;
}
#hint-modal.open { transform: translateX(0); }

.hint-modal-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--hint-gray-500);
  line-height: 1;
  padding: 4px 8px;
}
.hint-modal-close:hover { color: var(--hint-black); }

.hint-eyebrow {
  font-family: var(--hint-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--hint-gray-500);
  margin-bottom: 12px;
  text-align: center;
}
.hint-heading {
  font-family: var(--hint-display);
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 16px;
  text-align: center;
  color: var(--hint-black);
}
.hint-sub {
  font-size: 14px;
  color: var(--hint-black);
  margin: 0 0 36px;
  line-height: 1.55;
}

.hint-product-summary {
  display: flex;
  gap: 16px;
  padding: 14px;
  background: var(--hint-gray-100);
  margin-bottom: 36px;
  align-items: center;
}
.hint-product-thumb {
  width: 52px;
  height: 64px;
  background: var(--hint-gray-300);
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}
.hint-product-info-name {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 500;
  margin-bottom: 4px;
}
.hint-product-info-meta {
  font-size: 11px;
  color: var(--hint-gray-500);
}

.hint-step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}
.hint-dot {
  flex: 1;
  height: 2px;
  background: var(--hint-gray-100);
  transition: background .3s;
}
.hint-dot.done { background: var(--hint-black); }
.hint-dot.act  { background: var(--hint-black); opacity: .45; }

.hint-field-group { margin-bottom: 28px; }
.hint-field-label {
  font-size: 13px;
  letter-spacing: 2.5px;
  color: var(--hint-black);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hint-opt-tag { font-size: 9px; letter-spacing: 1px; color: var(--hint-gray-500); font-weight: 400; }

.hint-field-input {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hint-gray-200);
  padding: 10px 0;
  font-family: var(--hint-font);
  font-size: 16px;
  color: var(--hint-black);
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.hint-field-input:focus { border-bottom-color: var(--hint-black); }
.hint-field-input::placeholder { color: var(--hint-gray-300); font-size: 15px; }
.hint-field-input[type="date"] { font-size: 14px; cursor: pointer; }

.hint-field-hint {
  font-size: 16px;
  color: var(--hint-black);
  margin-top: 10px;
  line-height: 1.55;
}
.hint-field-hint b { font-weight: 700; color: var(--hint-black); }

.hint-contact-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--hint-gray-200);
  margin-bottom: 12px;
}
.hint-ctab {
  border: none;
  background: none;
  padding: 9px 0;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--hint-gray-300);
  cursor: pointer;
  font-family: var(--hint-font);
  transition: background .15s, color .15s;
}
.hint-ctab.on { background: var(--hint-black); color: var(--hint-white); }

.hint-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.hint-date-col { position: relative; }
.hint-date-sub-label {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--hint-black);
  font-weight: 600;
  margin-bottom: 8px;
}
.hint-date-display { cursor: pointer; font-size: 14px; }
.hint-date-display::placeholder { color: var(--hint-gray-300); font-size: 14px; }

/* Custom date picker — calendar popover, replaces native input[type=date] */
.hint-dp {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: 280px;
  max-width: calc(100vw - 48px);
  background: var(--hint-white);
  border: 1px solid var(--hint-gray-200);
  box-shadow: 0 12px 36px rgba(10,10,10,.18);
  padding: 14px 14px 10px;
  box-sizing: border-box;
  font-family: var(--hint-font);
}
.hint-dp[hidden] { display: none; }
.hint-dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.hint-dp-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--hint-black);
  font-weight: 500;
}
.hint-dp-nav {
  background: none;
  border: 1px solid transparent;
  color: var(--hint-black);
  font-size: 18px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hint-font);
  transition: background .15s;
}
.hint-dp-nav:hover { background: var(--hint-gray-100); }
.hint-dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.hint-dp-weekdays span {
  font-size: 9px;
  letter-spacing: 1px;
  text-align: center;
  color: var(--hint-gray-300);
  padding: 6px 0 4px;
}
.hint-dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.hint-dp-cell {
  background: none;
  border: 1px solid transparent;
  padding: 8px 0;
  font-family: var(--hint-font);
  font-size: 13px;
  cursor: pointer;
  color: var(--hint-black);
  transition: background .12s, color .12s;
  line-height: 1;
}
.hint-dp-cell:hover:not(:disabled):not(.empty) {
  background: var(--hint-gray-100);
}
.hint-dp-cell.empty { visibility: hidden; cursor: default; }
.hint-dp-cell.past {
  color: var(--hint-gray-200);
  cursor: not-allowed;
}
.hint-dp-cell.today { border-color: var(--hint-gray-300); }
.hint-dp-cell.sel {
  background: var(--hint-black);
  color: var(--hint-white);
  border-color: var(--hint-black);
}
.hint-dp-clear {
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--hint-gray-100);
  margin-top: 8px;
  padding: 8px 0 4px;
  font-family: var(--hint-font);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--hint-gray-500);
  cursor: pointer;
  transition: color .15s;
}
.hint-dp-clear:hover { color: var(--hint-black); }

.hint-occasion-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.hint-pill {
  padding: 6px 14px;
  border: 1px solid var(--hint-gray-300);
  background: none;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--hint-black);
  cursor: pointer;
  font-family: var(--hint-font);
  transition: all .15s;
}
.hint-pill.on {
  background: var(--hint-black);
  color: var(--hint-white);
  border-color: var(--hint-black);
}

textarea.hint-field-input {
  resize: none;
  height: 68px;
  line-height: 1.5;
}
.hint-skip-link {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--hint-black);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hint-skip-link:hover { color: var(--hint-gray-700); }
.hint-char-count { font-size: 11px; color: var(--hint-gray-500); }

.hint-btn-create {
  width: 100%;
  height: 52px;
  background: var(--hint-black);
  color: var(--hint-white);
  border: none;
  font-family: var(--hint-font);
  font-size: 11px;
  letter-spacing: 3px;
  cursor: pointer;
  margin-top: 32px;
  transition: opacity .2s;
  opacity: .3;
  pointer-events: none;
}
.hint-btn-create.ready { opacity: 1; pointer-events: auto; }
.hint-btn-create.ready:hover { opacity: .82; }

.hint-divider {
  border: none;
  border-top: 1px solid var(--hint-gray-100);
  margin: 28px 0;
}

/* --- SUCCESS panel (после создания) --- */
#hint-success-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--hint-black);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  box-sizing: border-box;
}
.hint-success-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--hint-white);
}
.hint-success-icon {
  width: 72px;
  height: 72px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
  font-size: 26px;
}
.hint-success-heading {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 400;
  color: var(--hint-white);
  margin: 0 0 12px;
  line-height: 1.1;
  font-family: var(--hint-display);
}
.hint-success-sub {
  font-size: 13px;
  color: rgba(255,255,255,.45);
  margin: 0 0 52px;
  line-height: 1.7;
  max-width: 320px;
}
.hint-link-box {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  padding: 18px 24px;
  font-family: var(--hint-mono);
  font-size: 12px;
  color: rgba(255,255,255,.55);
  letter-spacing: 1px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  word-break: break-all;
  box-sizing: border-box;
}
.hint-link-box:hover {
  background: rgba(255,255,255,.09);
  color: var(--hint-white);
}
.hint-link-copy-hint {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.2);
  margin-bottom: 40px;
}
.hint-success-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.hint-btn-action {
  height: 52px;
  border: 1px solid rgba(255,255,255,.15);
  background: none;
  color: rgba(255,255,255,.55);
  font-family: var(--hint-font);
  font-size: 10px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
  box-sizing: border-box;
}
.hint-btn-action:hover {
  background: rgba(255,255,255,.07);
  color: var(--hint-white);
  border-color: rgba(255,255,255,.3);
}
.hint-btn-action.primary {
  background: var(--hint-white);
  color: var(--hint-black);
  border-color: var(--hint-white);
  grid-column: 1 / -1;
  height: 56px;
  font-size: 11px;
  letter-spacing: 3px;
  margin-bottom: 4px;
}
.hint-btn-action.primary:hover { opacity: .88; }

.hint-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--hint-black);
  color: var(--hint-white);
  padding: 12px 24px;
  font-size: 11px;
  letter-spacing: 2px;
  opacity: 0;
  transition: all .3s;
  z-index: 999;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
}
.hint-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- GIFT PAGE (/gift/{token}) --- */
body.gift-page-body {
  background: var(--hint-black);
  color: var(--hint-white);
}
/* Footer should stay on the normal (white) brand background even on the dark
   gift page — otherwise the dark-fill logo SVGs and copy disappear on black. */
body.gift-page-body footer {
  background: #fff;
  color: var(--color-black, #0a0a0a);
}
body.gift-page-body footer,
body.gift-page-body footer a,
body.gift-page-body footer p,
body.gift-page-body footer span,
body.gift-page-body footer h1,
body.gift-page-body footer h2,
body.gift-page-body footer h3,
body.gift-page-body footer h4,
body.gift-page-body footer h5,
body.gift-page-body footer h6,
body.gift-page-body footer div,
body.gift-page-body footer input {
  color: var(--color-black, #0a0a0a);
}
body.gift-page-body footer svg path { fill: #111214; }
.gift-banner {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(14,14,14,.97);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--hint-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
/* Defensive — sixfront's global typography may colour <span> elements; force white inside the banner */
.gift-banner span,
.gift-banner .gift-banner-emoji {
  color: #ffffff;
}
.gift-banner-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  opacity: .55;
  flex-shrink: 0;
}
.gift-banner-emoji { font-size: 14px; line-height: 1; }

.gift-hero {
  width: 100%;
  height: 75vh;
  min-height: 520px;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.gift-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10,10,10,.15) 0%,
    transparent 30%,
    transparent 45%,
    rgba(10,10,10,.98) 100%);
  z-index: 2;
  pointer-events: none;
}
.gift-hero-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.gift-photo-cell {
  background: #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}
.gift-photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gift-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hint-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.12);
}
.gift-hero-content {
  position: relative;
  z-index: 3;
  padding: 52px 48px;
  width: 100%;
  box-sizing: border-box;
}
.gift-eyebrow {
  font-family: var(--hint-mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(255,255,255,.75);
  margin-bottom: 14px;
}
.gift-product-name {
  font-family: var(--hint-display);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 400;
  letter-spacing: -1px;
  line-height: .95;
  margin: 0 0 12px;
  color: #fff;
}
.gift-price {
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 300;
  color: rgba(255,255,255,.85);
}

.gift-body {
  padding: 64px 48px;
  max-width: 680px;
  margin: 0 auto;
  box-sizing: border-box;
}
.gift-occasion-badge {
  display: inline-block;
  font-family: var(--hint-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.3);
  padding: 6px 14px;
  margin-bottom: 32px;
}
.gift-message-block { margin-bottom: 52px; }
.gift-from-label {
  font-family: var(--hint-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255,255,255,.55);
  margin-bottom: 14px;
}
.gift-message-text {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 300;
  line-height: 1.65;
  color: #fff;
  font-style: italic;
}
.gift-message-from {
  font-size: 15px;
  color: rgba(255,255,255,.65);
  margin-top: 16px;
  font-style: normal;
}
.gift-meta-row {
  display: flex;
  gap: 40px;
  margin-bottom: 52px;
  flex-wrap: wrap;
}
.gift-meta-label {
  font-family: var(--hint-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.5);
  margin-bottom: 8px;
}
.gift-meta-val {
  font-size: 15px;
  letter-spacing: 1px;
  color: rgba(255,255,255,.9);
}
.gift-btn-buy {
  display: block;
  width: 100%;
  height: 60px;
  line-height: 60px;
  background: var(--hint-white);
  color: var(--hint-black);
  border: none;
  font-family: var(--hint-font);
  font-size: 12px;
  letter-spacing: 4px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: opacity .2s;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
.gift-btn-buy:hover { opacity: .88; color: var(--hint-black); }
.gift-footer-note {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  text-align: center;
  line-height: 1.6;
}

/* Lightbox */
#hint-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,.95);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#hint-lightbox.open { display: flex; }
#hint-lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
}
.lb-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 22px;
  cursor: pointer;
  font-family: var(--hint-font);
  line-height: 1;
}
.lb-close:hover { color: var(--hint-white); }
.lb-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--hint-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255,255,255,.3);
}
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  font-size: 28px;
  cursor: pointer;
  padding: 16px;
  font-family: var(--hint-font);
  line-height: 1;
}
.lb-arrow:hover { color: var(--hint-white); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* --- Mobile --- */
@media (max-width: 640px) {
  #hint-modal {
    width: 100%;
    height: 92vh;
    border-radius: 12px 12px 0 0;
    padding: 40px 24px 60px;
  }
  #hint-modal-overlay {
    align-items: flex-end;
    justify-content: center;
  }
  .hint-field-hint { font-size: 14px; }
  .hint-field-label { font-size: 11px; }
  .hint-date-sub-label { font-size: 11px; }
  .gift-hero {
    height: 55vh;
    min-height: 420px;
  }
  .gift-body { padding: 40px 24px; }
  .gift-hero-content { padding: 32px 24px; }
  .gift-meta-row { gap: 24px; }
}
