/* guest_cart_panel.css — #cartPanel side panel + #cartPanelAccess form
 * (phase 5, Task 6). Guest-only surface, loaded for anonymous visitors
 * (styles.ftlh, <#if !isAuthenticated>) — tokens only, both brands
 * ([[feedback_no_hardcoded_hex_new_ui]]); main.css/tokens.css are always
 * already loaded on every newUI page, so this file only adds what neither
 * of them declares.
 *
 * Reused AS-IS from main.css, deliberately NOT redeclared here:
 *   .btn-cart-primary / .btn-cart-secondary  — footer + form submit buttons
 *   .qty-stepper / .qty-btn / .qty-value     — bare (unscoped) rule, already
 *                                              sized for a narrow mobile
 *                                              target (96-104px) — exactly
 *                                              right for a 400px panel
 *   .cart-item-remove                        — bare icon-button look
 *   .cart-modal-backdrop / .cart-modal*      — session-expired modal
 *
 * Panel item rows are their OWN small set of classes (.cart-panel-item*),
 * NOT a reuse of .cart-item's CSS grid from main.css: that grid is re-shaped
 * by four separate viewport-width media queries tuned for the full-width
 * /b/cart page, and the panel is always a narrow fixed-width column
 * regardless of the browser's viewport (see guest_cart_panel_body.ftlh's
 * header comment for the full reasoning).
 */

/* ── Overlay scrim token (new — see inforeisen/oponytomy tokens.css) ──────
   Neither brand had a token for a true modal/panel backdrop: --bg-scrim on
   OTM is a lighter dropdown-dimmer (.12 alpha, explicitly "TBD" for INFR)
   and reusing it here would be repurposing a token flagged as a pending
   design decision. --overlay-scrim reuses each brand's own shadow hue
   (--shadow-1/2/3's rgb base) at a backdrop-appropriate alpha instead. */

.cart-panel-backdrop{
  position:fixed; inset:0; z-index:9000;
  display:flex; justify-content:flex-end;
  background:var(--overlay-scrim);
}
/* [hidden] alone loses to any author rule with equal-or-lower specificity
   that sets display — author origin always wins over the UA default, so
   the flex rule above would otherwise show the backdrop regardless of the
   attribute ([[tior-legacy-cartjs-hijack]] sibling lesson, same trap
   cart_v2.js's hide()/show() comment documents for .cart-summary-card). */
.cart-panel-backdrop[hidden]{ display:none; }

.cart-panel{
  position:relative;
  width:400px;
  max-width:100%;
  height:100%;
  max-height:100vh;
  /* 16.10 (прототип 15.10) · тло панелі — тло сторінки: на ньому список
     лежить карткою з тінню, а шапка й підвал — власними світлими смугами. */
  background:var(--bg-page);
  box-shadow:var(--shadow-3);
  /* Підйом шапки й підвалу над списком, що їде між ними (прототип 15.10). */
  --cart-panel-edge-shadow:0 6px 16px rgba(0, 0, 0, .06);
  --cart-panel-edge-shadow-up:0 -6px 16px rgba(0, 0, 0, .06);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
@media (max-width:480px){
  .cart-panel{ width:100%; }
}
/* Будь-який прямий блок панелі, схований атрибутом, лишається схованим
   незалежно від власного display-правила нижче (та сама причина, що й на
   завісі). Один блоковий selector на всі — простіше й надійніше, ніж
   повторювати [hidden]{display:none} під кожним класом окремо. */
.cart-panel > [hidden],
.cart-panel-access [hidden]{ display:none !important; }

.cart-panel-head{
  flex:none; position:relative; z-index:1;
  padding:var(--space-sm) var(--space-lg);
  background:var(--bg-input);
  border-bottom:var(--border-width-default) solid var(--border-default);
  box-shadow:var(--cart-panel-edge-shadow);
  display:flex; flex-direction:column; gap:0;
}
/* Два рядки по 48 (прототип 15.10): заголовок + хрестик, лічильник + дія. */
.cart-panel-head-top{
  display:flex; align-items:center; justify-content:space-between;
  gap:var(--space-sm); min-height:48px;
}
.cart-panel-title{
  margin:0;
  font-family:var(--font-body); font-weight:700; font-size:20px;
  color:var(--text-default);
}
.cart-panel-close{
  flex:none;
  display:flex; align-items:center; justify-content:center;
  background:none; border:none; padding:var(--space-xs); margin:-4px;
  color:var(--text-muted); cursor:pointer;
  border-radius:var(--radius-xs);
  transition:color 140ms ease;
}
.cart-panel-close:hover{ color:var(--text-default); }
.cart-panel-close:focus-visible{
  outline:var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset:var(--focus-outline-offset);
}
.cart-panel-head-sub{
  display:flex; align-items:center; justify-content:space-between;
  gap:var(--space-sm); min-height:48px;
}
.cart-panel-count{
  font-family:var(--font-body); font-weight:400; font-size:14px;
  color:var(--text-muted);
}
/* «Wyczyść koszyk» — текстова дія чорнилом (прототип 15.10); зона тапу 48
   прозорим падінгом з компенсаційним margin, як .cart-clear-all на /b/cart. */
.cart-panel-clear{
  appearance:none; background:none; border:0; cursor:pointer; flex:none;
  font-family:var(--font-body); font-weight:400; font-size:16px;
  color:var(--text-on-light);
  padding:14px 8px; margin:-14px -8px;
}
.cart-panel-clear:hover{ text-decoration:underline; text-underline-offset:3px; }
.cart-panel-clear:focus-visible{ outline:none; box-shadow:var(--focus-ring); border-radius:var(--radius-xs); }
.cart-panel-clear[hidden]{ display:none; }

.cart-panel-body{
  flex:1 1 auto; min-height:0;
  overflow-y:auto;
  padding:var(--space-md) 0;
}

/* ── Item rows (fragment root rendered by guest_cart_panel_body.ftlh) ───── */
/* 16.10 (прототип 15.10) · список — картка з тінню на тлі панелі. */
.cart-panel-list{
  list-style:none; margin:0; padding:0;
  border-radius:var(--radius-sm);
  box-shadow:var(--shadow-card);
}
/* Сітка рядка: [сезон | назва+розмір | кошик]; другий рядок — степер під
   назвою, замок праворуч (прототип 15.10, .cart-panel .cart-item). */
.cart-panel-item{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) 32px;
  grid-template-areas:"icon info remove" ".    bottom bottom";
  column-gap:var(--space-sm); row-gap:var(--space-sm);
  align-items:start;
  padding:var(--space-md) var(--space-lg);
}
.cart-panel-item + .cart-panel-item{ border-top:1px solid var(--border-surface); }
.cart-panel-item-icon{
  grid-area:icon;
  display:flex; align-items:center; justify-content:center;
  height:20px; min-width:18px;
}
.cart-panel-item-icon .season-icon{ display:block; }
.cart-panel-item-info{ grid-area:info; min-width:0; }
.cart-panel-item-name{
  margin:0;
  font-family:var(--font-body); font-weight:500; font-size:16px;
  color:var(--text-default);
}
.cart-panel-item-size{
  font-family:var(--font-mono); font-size:16px;
  color:var(--text-muted); margin-top:2px;
}
.cart-panel-item .cart-item-remove{
  grid-area:remove; justify-self:center;
  width:32px; height:32px; margin-top:-6px;
  display:flex; align-items:center; justify-content:center;
}
.cart-panel-item-bottom{
  grid-area:bottom;
  display:flex; align-items:center; justify-content:space-between;
  gap:var(--space-sm);
}
/* Степер у рядку — без власної заливки й з тонкою рамкою (прототип:
   .cart-item .qty-stepper{ background:transparent }). */
.cart-panel-item .qty-stepper{
  background:transparent;
  border-width:var(--border-width-default);
}
/* Замок замість плашки «Cena po zalogowaniu» (прототип 15.10): гліф у
   зоні тапу 48, пояснення — тултіп під ним (ховер; тап — tip_tap.js). */
.cart-panel-item-lock{
  position:relative; flex:none;
  display:inline-flex; align-items:center; justify-content:center;
  /* Центр замка — на одній вертикалі з кошиком над ним: колонка кошика 32,
     її центр за 16 від краю; коробка 48 з margin-right -8 ставить свій
     центр туди ж. */
  width:48px; height:48px; margin:-4px -8px -4px 0;
  outline:none; cursor:default;
}
.cart-panel-lock-ico{ font-size:20px; line-height:1; }
.cart-panel-sr{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
}
.cart-panel-item-lock .chip-tip{
  position:absolute; top:calc(100% - 6px); right:0;
  width:210px; box-sizing:border-box;
  /* ДС §2.3 — рецепт тултипа (той самий, що .chip-tip у card_result.css). */
  background:var(--text-on-light); color:var(--text-inverted);
  font-family:var(--font-body); font-size:14px; line-height:16px;
  padding:5px 10px; border-radius:var(--radius-chip, 6px);
  white-space:normal; text-align:left;
  box-shadow:0 2px 8px rgba(0, 0, 0, .2);
  opacity:0; pointer-events:none; transition:opacity 140ms ease;
  z-index:5;
}
.cart-panel-item-lock:hover .chip-tip,
.cart-panel-item-lock:focus-visible .chip-tip,
.cart-panel-item-lock.is-tip-open .chip-tip{ opacity:1; }
.cart-panel-item-lock:focus-visible{ box-shadow:var(--focus-ring); border-radius:var(--radius-xs); }

.cart-panel-empty{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  gap:var(--space-sm);
  padding:var(--space-2xl) var(--space-lg);
}
.cart-panel-empty-icon{
  width:44px; height:44px; border-radius:50%;
  background:var(--bg-subtle);
  color:var(--text-muted);
  display:flex; align-items:center; justify-content:center;
}
.cart-panel-empty-title{
  margin:0;
  font-family:var(--font-body); font-weight:700; font-size:16px;
  color:var(--text-default);
}
.cart-panel-empty-text{
  margin:0 0 var(--space-sm);
  font-family:var(--font-body); font-size:14px; line-height:1.4;
  color:var(--text-muted);
}
.cart-panel-empty .btn-cart-primary{ width:auto; padding:0 var(--space-xl); }

/* ── Access-request form host ─────────────────────────────────────────── */
/* 21.10 (прототип 15.10) · форма — власна світла смуга з тінню вгору, а
   решта панелі під нею гасне слабшим за зовнішнє затемненням: список
   лишається видимим, але читається як фон, а не як блок поруч з формою. */
.cart-panel-access{
  flex:0 0 auto;
  position:relative; z-index:3;
  max-height:70vh;
  overflow-y:auto;
  padding:var(--space-lg);
  background:var(--bg-input);
  border-top:var(--border-width-default) solid var(--border-default);
  box-shadow:var(--cart-panel-edge-shadow-up);
  display:flex; flex-direction:column; gap:var(--space-md);
}
.cart-panel[data-mode="access"]::after{
  content:""; position:absolute; inset:0; z-index:2;
  background:var(--cart-panel-dim, rgba(0, 0, 0, .32));
  pointer-events:none;
}
.cart-panel-access-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:var(--space-sm);
  margin-bottom:calc(var(--space-xs) - var(--space-md));
}
.cart-panel-access-title{
  font-family:var(--font-body); font-weight:700; font-size:16px; line-height:20px;
  color:var(--text-default);
}
/* «Anuluj» — текстова дія чорнилом, зона тапу 48 прозорим падінгом. */
.cart-panel-access-cancel{
  background:none; border:none; cursor:pointer;
  padding:14px 8px; margin:-14px -8px;
  font-family:var(--font-body); font-size:16px; font-weight:400;
  color:var(--text-on-light);
}
.cart-panel-access-cancel:hover{ color:var(--text-on-light); text-decoration:underline; text-underline-offset:3px; }
.cart-panel-access-cancel:focus-visible{ outline:none; box-shadow:var(--focus-ring); border-radius:var(--radius-xs); }
.cart-panel-access-lead{
  margin:0;
  font-family:var(--font-body); font-size:16px; line-height:20px;
  color:var(--text-muted);
}
/* Обіцянка про кошик — жирна, але тим самим сірим, що й текст навколо (прототип 15.10: .guest-activate-strong{font-weight:700;color:inherit}). */
.cart-panel-access-lead b{ color:inherit; font-weight:700; }

.ac-form{ display:flex; flex-direction:column; gap:var(--space-md); }
.ac-field{ display:flex; flex-direction:column; gap:4px; }
.ac-label{
  font-family:var(--font-body); font-weight:400; font-size:14px; line-height:18px;
  color:var(--text-muted);
}
.ac-input{
  width:100%; box-sizing:border-box;
  height:var(--control-height);
  padding:0 var(--space-md);
  border:var(--border-width-default) solid var(--hover-grey);
  border-radius:var(--radius-sm);
  background:var(--bg-input);
  font-family:var(--font-body); font-size:16px;
  color:var(--text-default);
  outline:none;
  transition:border-color 140ms ease;
}
.ac-input::placeholder{ color:var(--text-placeholder); }
.ac-input:focus{ border-color:var(--text-placeholder); }
.ac-input:focus-visible{
  outline:var(--focus-outline-width) solid var(--focus-outline-color-field);
  outline-offset:0;
}
.ac-input.is-error{
  border-color:var(--status-danger);
  box-shadow:var(--error-ring-inset);
}
.ac-input.is-error:focus{ border-color:var(--status-danger); }
/* [hidden] на обох — покриває блоковий .cart-panel-access [hidden] вище,
   рядки лишені лише для читабельності (видимий стан, не display). */
.ac-error{
  font-family:var(--font-body); font-size:13px; color:var(--status-danger);
}
.ac-form-error{
  font-family:var(--font-body); font-size:13px; color:var(--status-danger);
  background:var(--status-danger-soft); border:1px solid var(--status-danger-ink);
  border-radius:var(--radius-sm);
  padding:var(--space-sm) var(--space-md);
  text-align:center;
}

/* Складений контрол «код країни + номер» — та сама геометрія, що
   .adres-phone/.adres-phone-cc у main.css (адреса доставки), під .ac-*
   іменами за інструкцією плану. */
/* 16.10 (прототип 15.10, ДС §12.8) · код і номер — ОДНЕ поле: контур, радіус,
   заливку й стани несе обгортка; частини без власних рамок, між ними рівна
   лінія; обід фокуса й помилка — на весь телефон, а не на половину. */
.ac-phone{
  display:flex; align-items:stretch;
  height:var(--control-height); box-sizing:border-box;
  border:var(--border-width-default) solid var(--hover-grey);
  border-radius:var(--radius-sm);
  background:var(--bg-input);
  overflow:hidden;
  transition:border-color 140ms ease;
}
.ac-phone:focus-within{ border-color:var(--text-placeholder); }
.ac-phone:has(:focus-visible){
  outline:var(--focus-outline-width) solid var(--focus-outline-color-field);
  outline-offset:0;
}
.ac-phone:has(.is-error){
  border-color:var(--status-danger);
  box-shadow:var(--error-ring-inset);
}
.ac-phone-cc{
  /* 21.10 (прототип 15.10) · код країни з шевроном, приглушеним кольором:
     поле редаговане (datalist), але виглядає як вибір зі списку. */
  /* 104, як .login-phone-cc на /login: Chrome резервує під поле з datalist
     більше за сам текст, і на 88 «+48» / «+420» обрізались. */
  flex:0 0 104px; width:104px; box-sizing:border-box;
  height:100%;
  padding:0 calc(var(--space-sm) * 2 + var(--icon-xs, 14px)) 0 var(--space-md);
  text-align:left;
  border:0;
  border-right:var(--border-width-default) solid var(--hover-grey);
  border-radius:0;
  background-color:transparent;
  background-image:var(--chevron-url);
  background-repeat:no-repeat;
  background-position:right var(--space-sm) center;
  background-size:var(--icon-xs, 14px) var(--icon-xs, 14px);
  font-family:var(--font-body); font-size:16px;
  color:var(--text-muted);
  cursor:pointer;
  appearance:none; -webkit-appearance:none;
  outline:none;
}
.ac-phone-cc::-webkit-calendar-picker-indicator,
.ac-phone-cc::-webkit-list-button{ display:none; -webkit-appearance:none; appearance:none; }
.ac-phone-cc:focus{ outline:none; }
.ac-phone .ac-phone-input,
.ac-phone .ac-phone-input:focus,
.ac-phone .ac-phone-input.is-error{
  flex:1 1 auto; min-width:0; height:100%;
  border:0; border-radius:0; box-shadow:none; background:transparent;
}
.ac-phone .ac-phone-input:focus-visible{ outline:none; }

.cart-panel-form-alt{
  margin:0;
  text-align:center;
  font-family:var(--font-body); font-size:16px; line-height:20px;
  color:var(--text-muted);
}
.cart-panel-form-alt-link{
  color:var(--accent-primary);
  text-decoration:underline; text-underline-offset:2px;
  font-weight:400;
}

/* ── Activation note + footer ─────────────────────────────────────────── */
.cart-panel-activate{
  flex:none;
  display:flex; flex-direction:column; gap:var(--space-xs);
  padding:var(--space-md) var(--space-lg);
  /* 16.10 (прототип 15.10) · тонована плашка — та сама заливка чипа, що в
     прототипі (--color-bg-chip, обидва бренди). */
  background:var(--color-bg-chip);
  border-top:1px solid var(--border-subtle);
}
.cart-panel-activate-title{
  display:block;
  font-family:var(--font-body); font-weight:700; font-size:16px; line-height:20px;
  color:var(--text-default);
}
.cart-panel-activate-text{
  margin:0;
  font-family:var(--font-body); font-weight:400; font-size:16px; line-height:20px;
  color:var(--text-muted);
}
.cart-panel-activate-text b{ color:inherit; font-weight:700; }

.cart-panel-foot{
  flex:none; position:relative; z-index:1;
  padding:var(--space-lg);
  background:var(--bg-input);
  border-top:var(--border-width-default) solid var(--border-default);
  box-shadow:var(--cart-panel-edge-shadow-up);
  display:flex; flex-direction:column; gap:var(--space-md);
}
/* «Otwórz koszyk» — текстова дія чорнилом, третій ярус (прототип 15.10). */
.cart-panel-openlink{
  display:block; align-self:center; text-align:center;
  background:none; border:none; padding:14px 8px; margin:-14px 0 -10px;
  font-family:var(--font-body); font-size:16px; font-weight:400;
  color:var(--text-on-light); text-decoration:none;
}
.cart-panel-openlink:visited{ color:var(--text-on-light); }
.cart-panel-openlink:hover{ color:var(--text-on-light); text-decoration:underline; text-underline-offset:3px; }
.cart-panel-openlink:focus-visible{ outline:none; box-shadow:var(--focus-ring); border-radius:var(--radius-xs); }
