/* =========================================================
   MR SHRIMP — витрина живности: каталог, корзина (drawer), checkout.
   Дополняет storefront.css (токены, шапка, футер, кнопки, модалка — там).
   Подключается на всех публичных страницах: корзина живёт в шапке.
   ========================================================= */

/* Активный пункт навигации (страница каталога) */
.nav-links a.active { color: var(--text-light); }
.nav-links a.active::after { width: 100%; }

/* Кнопки — дополнительные размеры */
.btn-sm { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }

/* =========================================================
   Кнопка корзины в шапке: счётчик + пульс
   ========================================================= */
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px;
  border-radius: 999px; background: var(--accent-warm); color: #fff;
  font-family: var(--font-sans); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; padding: 0 5px; line-height: 1;
  border: 2px solid var(--bg-primary);
}
.cart-count.hidden { display: none; }
.cart-btn.bump { animation: cartBump .45s cubic-bezier(.16,.7,.3,1); }
@keyframes cartBump { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* =========================================================
   Шапка страницы (компактная, не hero)
   ========================================================= */
.page-head { padding: calc(var(--header-h) + clamp(46px, 8vw, 88px)) 0 0; position: relative; }
.page-head-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 120% at 85% -10%, rgba(12,112,135,0.22) 0%, rgba(12,112,135,0) 55%), linear-gradient(180deg, #013047 0%, var(--bg-primary) 70%);
}
.page-head .lead-wrap { max-width: 620px; }

/* =========================================================
   Каталог
   ========================================================= */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 38px; }
.pill {
  padding: 10px 22px; border-radius: 999px; border: 1px solid var(--line-subtle);
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-family: var(--font-sans); font-weight: 600; font-size: 14.5px; letter-spacing: 0.01em;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.pill:hover { border-color: var(--accent-cool-line); color: var(--text-light); }
.pill.active { background: var(--accent-cool); border-color: var(--accent-cool); color: #fff; }

.catalog-section { padding: 42px 0 clamp(70px, 10vw, 120px); }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; align-items: stretch; }
.cat-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--accent-cool-line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12,112,135,0.09), rgba(0,35,54,0.35));
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: 0 26px 52px -28px rgba(0,0,0,0.6); border-color: var(--accent-cool); }
.cat-card.hide { display: none; }

.cat-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-alt); overflow: hidden; }
.cat-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* плейсхолдер-заглушка, если фото ещё нет */
.cat-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-cool); background: linear-gradient(160deg, #013047, var(--bg-alt)); }
.cat-ph svg { width: 44%; opacity: 0.5; }

.status-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.status-badge.in { background: rgba(12,112,135,0.28); border: 1px solid var(--accent-cool-line); color: var(--text-light); }
.status-badge.in::before { background: #4fd1c5; box-shadow: 0 0 8px #4fd1c5; }
.status-badge.pre { background: rgba(0,20,32,0.5); border: 1px solid var(--line-subtle); color: var(--text-muted); }
.status-badge.pre::before { background: var(--text-muted); }

.cat-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.cat-name { font-size: 20px; font-weight: 600; line-height: 1.2; }
.cat-latin { font-family: var(--font-serif); font-style: italic; font-size: 14px; color: var(--text-muted); }
.cat-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; flex-grow: 1; }
.cat-price { font-family: var(--font-serif); font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; }
.cat-price span { font-size: 15px; color: var(--text-muted); font-weight: 400; font-family: var(--font-sans); }
.cat-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

/* степпер количества */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--accent-cool-line); border-radius: 999px; flex-shrink: 0; }
.stepper button { width: 38px; height: 40px; background: none; border: none; color: var(--accent-cool); cursor: pointer; font-size: 20px; display: grid; place-items: center; transition: color .2s ease; }
.stepper button:hover { color: var(--text-light); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper .qty { min-width: 30px; text-align: center; font-family: var(--font-sans); font-weight: 600; font-size: 15px; color: var(--text-light); font-variant-numeric: tabular-nums; }
.cat-foot .btn { flex-grow: 1; }
.cat-foot .btn.added { background: var(--accent-cool); box-shadow: none; pointer-events: none; }

/* пустое состояние каталога */
.cat-empty {
  display: none; margin-top: 10px;
  border: 1px dashed var(--accent-cool-line); border-radius: var(--radius);
  padding: clamp(50px, 8vw, 84px) 30px; text-align: center;
  flex-direction: column; align-items: center; background: rgba(12,112,135,0.04);
}
.cat-empty.show { display: flex; }
.cat-empty .re-art { width: 120px; color: var(--accent-cool); opacity: 0.85; margin-bottom: 28px; }
.cat-empty h3 { font-size: clamp(24px, 3.4vw, 30px); margin-bottom: 12px; }
.cat-empty p { color: var(--text-muted); font-size: 16px; max-width: 44ch; line-height: 1.6; }

/* =========================================================
   Корзина (drawer)
   ========================================================= */
.drawer-overlay { position: fixed; inset: 0; z-index: 210; background: rgba(0,12,20,0.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 211;
  background: var(--bg-primary); border-left: 1px solid var(--accent-cool-line);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .38s cubic-bezier(.16,.7,.3,1);
  box-shadow: -30px 0 60px -30px rgba(0,0,0,0.7);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 26px; border-bottom: 1px solid var(--line-subtle); flex-shrink: 0; }
.drawer-head h3 { font-size: 24px; }
.drawer-head .count-note { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.drawer-body { flex-grow: 1; overflow-y: auto; padding: 8px 26px; display: flex; flex-direction: column; }
.drawer-foot { flex-shrink: 0; padding: 22px 26px calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-subtle); background: var(--bg-alt); }

.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line-subtle); align-items: start; }
.cart-line:last-child { border-bottom: none; }
.cart-thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-alt); border: 1px solid var(--line-subtle); position: relative; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .cat-ph svg { width: 52%; }
.cart-info { min-width: 0; }
.cart-info .cl-name { font-family: var(--font-serif); font-size: 16px; font-weight: 600; line-height: 1.25; }
.cart-info .cl-price { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.cart-info .cl-status { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; display: inline-flex; align-items: center; gap: 6px; }
.cart-info .cl-status.pre::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.cart-line .stepper { margin-top: 10px; }
.cart-line .stepper button { width: 32px; height: 34px; font-size: 17px; }
.cart-line .stepper .qty { min-width: 26px; font-size: 14px; }
.cart-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.cl-sum { font-family: var(--font-serif); font-weight: 700; font-size: 17px; white-space: nowrap; }
.cl-remove { width: 30px; height: 30px; border: 1px solid var(--line-subtle); border-radius: 8px; background: none; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; transition: .2s; }
.cl-remove:hover { border-color: var(--accent-warm); color: var(--accent-warm); }
.cl-remove svg { width: 15px; height: 15px; }

.cart-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.cart-total .lbl { font-size: 15px; color: var(--text-muted); }
.cart-total .val { font-family: var(--font-serif); font-size: 30px; font-weight: 700; }
.cart-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 8px 0 18px; }

/* пустая корзина */
.cart-empty { display: none; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px; margin: auto 0; }
.cart-empty.show { display: flex; }
.cart-empty .ce-art { width: 96px; color: var(--accent-cool); opacity: 0.8; margin-bottom: 22px; }
.cart-empty h4 { font-size: 22px; margin-bottom: 10px; }
.cart-empty p { color: var(--text-muted); font-size: 14.5px; max-width: 30ch; line-height: 1.6; margin-bottom: 24px; }

/* =========================================================
   Checkout: карточка формы (поля — те же классы, что на лендинге)
   ========================================================= */
.form-card { background: var(--bg-alt); border: 1px solid var(--line-subtle); border-radius: var(--radius); padding: 38px 36px; }

/* Дубль форменных стилей лендинга — checkout живёт без landing.css. */
.form-row { margin-bottom: 22px; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label.field-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-light); margin-bottom: 10px; letter-spacing: 0.01em; }
label.field-label .req { color: var(--accent-warm); }
.input, .textarea, .select {
  width: 100%; background: rgba(1,38,57,0.6); border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm); color: var(--text-light); font-family: var(--font-sans);
  font-size: 15.5px; padding: 14px 16px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.input::placeholder, .textarea::placeholder { color: rgba(228,214,185,0.34); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent-cool); background: rgba(1,38,57,0.9); box-shadow: 0 0 0 3px var(--accent-cool-soft); }
.input.invalid, .textarea.invalid { border-color: var(--accent-warm); box-shadow: 0 0 0 3px rgba(243,94,74,0.15); }
.textarea { resize: vertical; min-height: 96px; }
.field-error { font-size: 13px; color: var(--accent-warm); margin-top: 7px; display: none; }
.field-error.show { display: block; }

.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card { position: relative; border: 1px solid var(--line-subtle); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: border-color .2s ease, background .2s ease; }
.radio-card:hover { border-color: var(--accent-cool-line); }
.radio-card input { position: absolute; opacity: 0; }
.radio-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.6px solid var(--accent-cool-line); flex-shrink: 0; display: grid; place-items: center; transition: .2s; }
.radio-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-cool); transform: scale(0); transition: transform .2s ease; }
.radio-card input:checked ~ .radio-dot { border-color: var(--accent-cool); }
.radio-card input:checked ~ .radio-dot::after { transform: scale(1); }
.radio-card:has(input:checked) { border-color: var(--accent-cool); background: var(--accent-cool-soft); }
.radio-card .rc-text strong { display: block; font-size: 15px; font-weight: 600; }
.radio-card .rc-text span { font-size: 13px; color: var(--text-muted); }

.consent { display: flex; gap: 13px; align-items: flex-start; margin: 4px 0 24px; }
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent .checkbox { width: 22px; height: 22px; flex-shrink: 0; border: 1.6px solid var(--accent-cool-line); border-radius: 6px; display: grid; place-items: center; cursor: pointer; transition: .2s; margin-top: 1px; }
.consent .checkbox svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(0.6); transition: .2s; }
.consent input:checked ~ .checkbox { background: var(--accent-cool); border-color: var(--accent-cool); }
.consent input:checked ~ .checkbox svg { opacity: 1; transform: scale(1); }
.consent input:focus-visible ~ .checkbox { box-shadow: 0 0 0 3px var(--accent-cool-soft); }
.consent label.consent-text { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; cursor: pointer; }
.consent a { color: var(--accent-cool); text-decoration: underline; text-underline-offset: 2px; }

.form-status { margin-top: 16px; font-size: 14.5px; display: none; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm); }
.form-status.show { display: flex; }
.form-status.error { background: rgba(243,94,74,0.14); border: 1px solid rgba(243,94,74,0.5); color: #ffd9d2; }
.form-status svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-submit { width: 100%; margin-top: 4px; }
.form-hint { text-align: center; font-size: 12.5px; color: var(--text-muted); margin-top: 14px; }

/* =========================================================
   Checkout: раскладка, сводка, состояния
   ========================================================= */
.checkout-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: start; margin-top: 12px; }
.summary-card { background: rgba(12,112,135,0.06); border: 1px solid var(--line-subtle); border-radius: var(--radius); padding: 30px 30px; position: sticky; top: calc(var(--header-h) + 20px); }
.summary-card h3 { font-size: 22px; margin-bottom: 20px; }
.sum-line { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-subtle); align-items: center; }
.sum-thumb { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; background: var(--bg-alt); border: 1px solid var(--line-subtle); position: relative; }
.sum-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sum-info .si-name { font-family: var(--font-serif); font-size: 15px; font-weight: 600; line-height: 1.2; }
.sum-info .si-qty { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.sum-sum { font-family: var(--font-serif); font-weight: 700; font-size: 16px; white-space: nowrap; }
.sum-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--accent-cool-line); }
.sum-total .lbl { font-size: 16px; color: var(--text-light); }
.sum-total .val { font-family: var(--font-serif); font-size: 32px; font-weight: 700; }
.sum-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-subtle); }

/* успех */
.checkout-success { display: none; text-align: center; max-width: 560px; margin: 0 auto; padding: 30px 0; }
.checkout-success.show { display: block; }
.checkout-success .cs-icon { width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--accent-cool-line); background: var(--accent-cool-soft); display: grid; place-items: center; color: var(--accent-cool); margin: 0 auto 26px; }
.checkout-success .cs-icon svg { width: 42px; height: 42px; }
.checkout-success h2 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 16px; }
.checkout-success p { color: var(--text-muted); font-size: 17px; line-height: 1.6; max-width: 46ch; margin: 0 auto 12px; }
.checkout-success .order-id { display: inline-block; margin: 8px 0 26px; padding: 12px 22px; border: 1px solid var(--accent-cool-line); border-radius: 999px; font-family: var(--font-serif); font-size: 18px; color: var(--text-light); }
.checkout-success .order-id b { color: var(--accent-cool); }

/* пустой checkout */
.checkout-empty { display: none; text-align: center; max-width: 480px; margin: 0 auto; padding: 40px 0; flex-direction: column; align-items: center; }
.checkout-empty.show { display: flex; }
.checkout-empty .ce-art { width: 110px; color: var(--accent-cool); opacity: 0.85; margin-bottom: 26px; }
.checkout-empty h2 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 14px; }
.checkout-empty p { color: var(--text-muted); font-size: 16px; margin-bottom: 28px; line-height: 1.6; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 1080px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; gap: 26px; }
  .summary-card { position: static; }
}
@media (max-width: 760px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: 1fr; }
  .form-row.two { grid-template-columns: 1fr; }
  .radio-group { grid-template-columns: 1fr; }
  .form-card { padding: 30px 22px; }
  .drawer { width: 100%; }
  .cat-foot { flex-wrap: wrap; }
  .cat-foot .stepper { flex-grow: 1; justify-content: space-between; }
}
