/* ========== ПЕРЕМЕННЫЕ ========== */
:root{
  --primary:#4f46e5;
  --primary-dark:#4338ca;
  --primary-light:#eef2ff;
  --accent:#f97316;
  --text:#1a1a2e;
  --text-mute:#6b7280;
  --bg:#f7f8fb;
  --card:#ffffff;
  --border:#e5e7eb;
  --shadow-sm:0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:0 12px 32px rgba(15,23,42,.12), 0 4px 8px rgba(15,23,42,.06);
  --radius:14px;
  --radius-lg:20px;
  --nav-h:64px;
  --ease:cubic-bezier(.4,0,.2,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
}

*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{overflow-x:hidden}
body{
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  background:var(--bg);color:var(--text);padding-bottom:calc(var(--nav-h) + 16px);
  -webkit-font-smoothing:antialiased;
}

/* ========== SPLASH ========== */
#splash{
  position:fixed;inset:0;background:linear-gradient(135deg,#4f46e5,#7c3aed);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  z-index:9999;color:#fff;transition:opacity .4s ease,visibility .4s ease;
}
#splash.hide{opacity:0;visibility:hidden;pointer-events:none}
.splash-logo{font-size:64px;animation:pulse 1.4s infinite ease-in-out}
.splash-text{margin-top:16px;font-size:15px;opacity:.85;letter-spacing:.5px}
@keyframes pulse{
  0%,100%{transform:scale(1);opacity:1}
  50%{transform:scale(1.15);opacity:.8}
}

/* ========== TOPBAR ========== */
#topbar{
  position:sticky;top:0;z-index:20;
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(255,255,255,.92));
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  padding:10px 12px;
  border-bottom:1px solid rgba(229,231,235,.6);
  transition:box-shadow .2s var(--ease);
}
#topbar.scrolled{box-shadow:var(--shadow-sm)}
.search-wrap{position:relative;display:flex;align-items:center}
.search-icon{
  position:absolute;left:14px;font-size:16px;opacity:.5;pointer-events:none;
  transition:transform .2s var(--ease);
}
#searchInput{
  width:100%;padding:12px 40px 12px 40px;
  border:1px solid var(--border);border-radius:12px;
  font-size:15px;background:#f9fafb;outline:none;
  transition:border-color .2s var(--ease),background .2s var(--ease),box-shadow .2s var(--ease);
}
#searchInput:focus{
  background:#fff;border-color:var(--primary);
  box-shadow:0 0 0 4px var(--primary-light);
}
.search-wrap:focus-within .search-icon{transform:scale(1.15);opacity:1}
.search-clear{
  position:absolute;right:10px;width:26px;height:26px;border:none;
  background:#e5e7eb;color:#6b7280;border-radius:50%;cursor:pointer;
  font-size:16px;line-height:1;display:none;
  transition:background .15s var(--ease),transform .15s var(--ease);
}
.search-clear:active{transform:scale(.85)}
.search-clear.show{display:block}

/* ========== VIEW ========== */
#view{padding:14px;max-width:900px;margin:0 auto;min-height:60vh}
#view.view-enter{animation:viewIn .35s var(--ease)}
@keyframes viewIn{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}
h2{
  font-size:20px;font-weight:700;padding:8px 4px 12px;
  letter-spacing:-.3px;
}

/* ========== КАТЕГОРИИ ========== */
.grid-cat{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
@media(min-width:600px){.grid-cat{grid-template-columns:repeat(4,1fr)}}
@media(min-width:900px){.grid-cat{grid-template-columns:repeat(5,1fr)}}

.cat-card{
  background:var(--card);border-radius:var(--radius);overflow:hidden;
  text-align:center;padding-bottom:10px;
  box-shadow:var(--shadow-sm);cursor:pointer;
  transition:transform .2s var(--ease),box-shadow .2s var(--ease);
  position:relative;
  animation:cardIn .35s var(--ease) both;
}
@media(hover:hover){
  .cat-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}
}
.cat-card:active{transform:scale(.96)}
.cat-card img{width:100%;aspect-ratio:1/1;object-fit:cover;background:#eef2ff;display:block}
.cat-card span{
  display:block;padding:8px 6px 0;font-size:12px;line-height:1.25;
  font-weight:500;color:var(--text);
}
@keyframes cardIn{
  from{opacity:0;transform:translateY(14px) scale(.96)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

/* ========== ТОВАРЫ ========== */
.products{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
@media(min-width:600px){.products{grid-template-columns:repeat(3,1fr)}}
@media(min-width:900px){.products{grid-template-columns:repeat(4,1fr)}}

.p-card{
  background:var(--card);border-radius:var(--radius);overflow:hidden;
  box-shadow:var(--shadow-sm);display:flex;flex-direction:column;
  transition:transform .2s var(--ease),box-shadow .2s var(--ease);
  animation:cardIn .4s var(--ease) both;
}
@media(hover:hover){
  .p-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}
}
.p-card .pimg{width:100%;aspect-ratio:1/1;object-fit:cover;background:#eef2ff;display:block}
.p-card .info{padding:10px;display:flex;flex-direction:column;gap:5px;flex:1}
.p-name{
  font-size:13px;font-weight:600;line-height:1.25;min-height:2.5em;
  color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.p-meta{font-size:11px;color:var(--text-mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.p-price{
  font-size:17px;font-weight:800;color:var(--primary);
  letter-spacing:-.4px;margin-top:2px;
}
.p-price::after{content:' ₽';font-size:13px;font-weight:600;opacity:.7;margin-left:2px}
.p-actions{display:flex;gap:6px;align-items:center;margin-top:auto;padding-top:6px}
.p-actions input{
  width:42px;text-align:center;padding:6px 2px;
  border:1px solid var(--border);border-radius:8px;font-size:13px;
  background:#f9fafb;font-weight:600;color:var(--text);
  transition:border-color .15s var(--ease);
}
.p-actions input:focus{outline:none;border-color:var(--primary);background:#fff}
.i-info{
  border:none;background:var(--primary-light);color:var(--primary);
  border-radius:8px;padding:7px 9px;cursor:pointer;font-weight:700;
  font-size:12px;line-height:1;
  transition:transform .15s var(--ease),background .15s var(--ease);
}
.i-info:active{transform:scale(.9)}
.btn-add{
  flex:1;padding:8px 6px;border:none;border-radius:8px;
  background:var(--primary);color:#fff;font-size:12px;font-weight:600;
  cursor:pointer;position:relative;overflow:hidden;
  transition:background .2s var(--ease),transform .15s var(--ease);
}
.btn-add:hover{background:var(--primary-dark)}
.btn-add:active{transform:scale(.95)}
.btn-add.added{background:#10b981}

/* Ripple */
.ripple{position:relative;overflow:hidden}
.ripple-effect{
  position:absolute;border-radius:50%;
  background:rgba(255,255,255,.5);transform:scale(0);
  animation:rippleAnim .6s ease-out;pointer-events:none;
}
@keyframes rippleAnim{
  to{transform:scale(4);opacity:0}
}

/* ========== НИЖНЯЯ НАВИГАЦИЯ ========== */
#bottomNav{
  position:fixed;bottom:0;left:0;right:0;height:var(--nav-h);
  background:rgba(255,255,255,.95);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  display:flex;border-top:1px solid rgba(229,231,235,.7);z-index:30;
  padding-bottom:env(safe-area-inset-bottom);
}
#bottomNav button{
  flex:1;border:none;background:none;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:var(--text-mute);cursor:pointer;position:relative;gap:3px;
  transition:color .2s var(--ease);
  font-family:inherit;
}
#bottomNav button .icon{font-size:20px;transition:transform .25s var(--ease-spring)}
#bottomNav button .label{font-size:10px;font-weight:500}
#bottomNav button.active{color:var(--primary)}
#bottomNav button.active .icon{transform:scale(1.2) translateY(-2px)}
#bottomNav button.active::before{
  content:'';position:absolute;top:6px;width:28px;height:3px;
  background:var(--primary);border-radius:2px;
  animation:navDot .25s var(--ease) both;
}
@keyframes navDot{
  from{transform:scaleX(0);opacity:0}
  to{transform:scaleX(1);opacity:1}
}

.badge{
  position:absolute;top:8px;right:24%;
  min-width:18px;height:18px;padding:0 5px;
  background:var(--accent);color:#fff;font-size:10px;font-weight:700;
  border-radius:9px;font-style:normal;line-height:18px;text-align:center;
  box-shadow:0 2px 6px rgba(249,115,22,.4);
  animation:badgePop .4s var(--ease-spring);
}
.badge:empty{display:none}
@keyframes badgePop{
  0%{transform:scale(0)}
  50%{transform:scale(1.3)}
  100%{transform:scale(1)}
}

/* ========== МОДАЛКА ========== */
.modal{
  display:none;position:fixed;inset:0;z-index:100;
  align-items:flex-end;justify-content:center;
}
@media(min-width:600px){.modal{align-items:center}}
.modal.open{display:flex;animation:modalBgIn .2s var(--ease) both}
.modal.open .modal-box{animation:modalBoxIn .35s var(--ease-spring) both}
@keyframes modalBgIn{from{background:rgba(15,23,42,0)}to{background:rgba(15,23,42,.5)}}
@keyframes modalBoxIn{
  from{transform:translateY(40px) scale(.96);opacity:0}
  to{transform:translateY(0) scale(1);opacity:1}
}
.modal-box{
  background:#fff;border-radius:24px 24px 0 0;
  max-width:520px;width:100%;max-height:85vh;overflow:auto;
  padding:24px;position:relative;
  box-shadow:var(--shadow-lg);
}
@media(min-width:600px){.modal-box{border-radius:24px}}
.modal-close{
  position:absolute;right:16px;top:16px;width:32px;height:32px;
  border:none;background:#f3f4f6;border-radius:50%;
  font-size:20px;line-height:1;color:#6b7280;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:background .15s var(--ease),transform .15s var(--ease);
}
.modal-close:hover{background:#e5e7eb}
.modal-close:active{transform:scale(.9)}

/* ========== ЧАТ ========== */
.chat{
  position:fixed;bottom:calc(var(--nav-h) + 10px);
  right:10px;left:10px;max-width:420px;margin-left:auto;
  background:#fff;border-radius:20px;box-shadow:var(--shadow-lg);
  z-index:60;display:flex;flex-direction:column;max-height:65vh;
  overflow:hidden;animation:chatIn .35s var(--ease-spring) both;
}
.chat.hidden{display:none}
@keyframes chatIn{
  from{transform:translateY(20px) scale(.95);opacity:0}
  to{transform:translateY(0) scale(1);opacity:1}
}
.chat-head{
  padding:14px 16px;border-bottom:1px solid var(--border);
  font-weight:600;font-size:14px;display:flex;justify-content:space-between;align-items:center;
  background:linear-gradient(135deg,var(--primary),#7c3aed);color:#fff;
}
.chat-close{
  border:none;background:rgba(255,255,255,.2);color:#fff;
  width:26px;height:26px;border-radius:50%;cursor:pointer;font-size:16px;line-height:1;
  display:flex;align-items:center;justify-content:center;
  transition:background .15s var(--ease);
}
.chat-close:hover{background:rgba(255,255,255,.35)}
.chat-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:8px;background:#f9fafb}
.msg{
  padding:9px 13px;border-radius:16px;max-width:82%;font-size:13px;line-height:1.4;
  word-break:break-word;animation:msgIn .25s var(--ease) both;
}
@keyframes msgIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.msg.client{background:var(--primary);color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.msg.admin{background:#fff;color:var(--text);align-self:flex-start;border-bottom-left-radius:4px;box-shadow:var(--shadow-sm)}
.chat-input{display:flex;border-top:1px solid var(--border);background:#fff}
.chat-input input{flex:1;border:none;padding:14px;font-size:14px;outline:none;font-family:inherit}
.chat-input button{
  border:none;background:var(--primary);color:#fff;padding:0 20px;
  font-size:16px;cursor:pointer;
  transition:background .15s var(--ease);
}
.chat-input button:hover{background:var(--primary-dark)}

/* ========== КОРЗИНА ========== */
.cart-item{
  display:flex;gap:12px;background:var(--card);border-radius:var(--radius);
  padding:12px;margin-bottom:10px;align-items:center;
  box-shadow:var(--shadow-sm);
  animation:cardIn .3s var(--ease) both;
}
.cart-item img{width:68px;height:68px;object-fit:cover;border-radius:10px;background:#eef2ff;flex-shrink:0}
.cart-item input{
  width:56px;padding:6px;text-align:center;border:1px solid var(--border);
  border-radius:8px;font-size:13px;font-weight:600;background:#f9fafb;font-family:inherit;
}
.btn-danger{
  background:#fee2e2;color:#dc2626;border:none;
  padding:7px 12px;border-radius:8px;font-size:12px;font-weight:600;cursor:pointer;
  transition:background .15s var(--ease),transform .15s var(--ease);
}
.btn-danger:hover{background:#fecaca}
.btn-danger:active{transform:scale(.95)}

.cart-total{
  text-align:right;font-weight:800;font-size:20px;padding:14px 4px;
  color:var(--primary);letter-spacing:-.4px;
}
.btn-main{
  width:100%;padding:16px;background:linear-gradient(135deg,var(--primary),#7c3aed);
  color:#fff;border:none;border-radius:14px;font-size:16px;font-weight:700;
  cursor:pointer;margin-top:10px;font-family:inherit;
  box-shadow:0 6px 20px rgba(79,70,229,.3);
  transition:transform .15s var(--ease),box-shadow .2s var(--ease);
  position:relative;overflow:hidden;
}
.btn-main:hover{box-shadow:0 8px 24px rgba(79,70,229,.4)}
.btn-main:active{transform:scale(.98)}

/* ========== EMPTY ========== */
.empty{
  text-align:center;padding:60px 20px;color:var(--text-mute);font-size:14px;
  display:flex;flex-direction:column;align-items:center;gap:12px;
}
.empty::before{content:'📭';font-size:56px;opacity:.5}

/* ========== TOAST ========== */
.toast{
  position:fixed;bottom:calc(var(--nav-h) + 16px);left:50%;
  transform:translateX(-50%) translateY(80px);
  background:#1a1a2e;color:#fff;padding:12px 20px;border-radius:12px;
  font-size:13px;font-weight:500;z-index:200;
  opacity:0;pointer-events:none;
  box-shadow:var(--shadow-lg);
  transition:transform .3s var(--ease-spring),opacity .3s var(--ease);
  max-width:calc(100% - 32px);text-align:center;
}
.toast.show{transform:translateX(-50%) translateY(0);opacity:1}

/* ========== SKELETON ========== */
.skeleton{
  background:linear-gradient(90deg,#f3f4f6 0%,#e5e7eb 50%,#f3f4f6 100%);
  background-size:200% 100%;animation:skel 1.4s ease-in-out infinite;
  border-radius:8px;
}
@keyframes skel{
  0%{background-position:200% 0}
  100%{background-position:-200% 0}
}
.skel-card{
  background:#fff;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm);
}
.skel-card .skeleton{aspect-ratio:1/1;border-radius:0}
.skel-card .skel-text{padding:10px;display:flex;flex-direction:column;gap:8px}
.skel-card .skel-text .skeleton{height:12px;border-radius:4px}
.skel-card .skel-text .skeleton.short{width:60%}

/* ========== КНОПКА ПОДРОБНЕЕ ========== */
.btn-more{
  display:flex;align-items:center;justify-content:center;gap:6px;
  width:100%;padding:8px 10px;margin-top:2px;
  background:#fff;
  border:1.5px solid var(--border);
  border-radius:10px;
  font-size:12px;font-weight:600;
  color:var(--text-mute);
  cursor:pointer;font-family:inherit;
  transition:border-color .2s var(--ease),color .2s var(--ease),background .2s var(--ease),transform .15s var(--ease);
  position:relative;overflow:hidden;
}
.btn-more svg{transition:transform .25s var(--ease-spring)}
.btn-more:hover{
  border-color:var(--primary);
  color:var(--primary);
  background:var(--primary-light);
}
.btn-more:hover svg{transform:scale(1.15) rotate(-8deg)}
.btn-more:active{transform:scale(.97)}

.p-name[data-open]{cursor:pointer;transition:color .15s var(--ease)}
.p-name[data-open]:hover{color:var(--primary)}

/* ========== МОДАЛКА: ЧИПСЫ И ДЕЙСТВИЯ ========== */
.meta-chips{
  display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 12px;
}
.chip{
  display:inline-flex;align-items:center;gap:5px;
  padding:5px 11px;border-radius:100px;
  background:#f3f4f6;color:var(--text-mute);
  font-size:12px;font-weight:600;letter-spacing:.2px;
}
.chip.primary{background:var(--primary-light);color:var(--primary)}

.modal-desc{
  font-size:14.5px;line-height:1.65;color:var(--text);
  padding-bottom:14px;border-bottom:1px dashed var(--border);
  margin-bottom:14px;
}
.modal-note{
  background:#fef9e7;border-left:3px solid #f59e0b;
  padding:10px 12px;border-radius:8px;font-size:13px;
  color:#78350f;margin-bottom:14px;
}
.modal-note b{color:#92400e}

.modal-actions{
  position:sticky;bottom:-24px;
  display:flex;gap:10px;align-items:stretch;
  padding:16px 0 0;
  margin:16px -24px -24px;
  padding:14px 24px calc(14px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg,rgba(255,255,255,.6),#fff 30%);
  border-top:1px solid var(--border);
}
.modal-actions .qty-box{
  display:flex;align-items:center;gap:0;
  background:#f3f4f6;border-radius:12px;overflow:hidden;flex-shrink:0;
}
.modal-actions .qty-btn{
  width:38px;height:44px;border:none;background:transparent;
  font-size:18px;font-weight:600;color:var(--primary);cursor:pointer;
  transition:background .15s var(--ease);font-family:inherit;
}
.modal-actions .qty-btn:hover{background:#e5e7eb}
.modal-actions .qty-btn:active{background:#d1d5db}
.modal-actions .qty-input{
  width:46px;height:44px;border:none;background:transparent;
  text-align:center;font-size:15px;font-weight:700;color:var(--text);
  font-family:inherit;outline:none;
  -moz-appearance:textfield;
}
.modal-actions .qty-input::-webkit-outer-spin-button,
.modal-actions .qty-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.modal-actions .btn-main{
  flex:1;margin:0;padding:0 20px;height:44px;
  font-size:14px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;gap:8px;
}
.modal-actions .btn-main.added{background:#10b981;box-shadow:0 6px 20px rgba(16,185,129,.3)}

/* ========== БЛОК "ВАЖНО" В КАРТОЧКЕ ========== */
.p-note{
  display:flex;gap:6px;align-items:flex-start;
  background:linear-gradient(135deg,#fef3c7,#fde68a);
  border-left:3px solid #f59e0b;
  padding:7px 9px;border-radius:8px;
  font-size:11px;line-height:1.35;
  margin-top:4px;
  animation:noteIn .35s var(--ease-spring) both;
}
@keyframes noteIn{
  from{opacity:0;transform:translateX(-6px)}
  to{opacity:1;transform:translateX(0)}
}
.note-badge{
  flex-shrink:0;
  background:#f59e0b;color:#fff;
  padding:2px 6px;border-radius:4px;
  font-weight:800;font-size:9.5px;
  letter-spacing:.4px;
  white-space:nowrap;
  text-transform:uppercase;
  box-shadow:0 1px 3px rgba(245,158,11,.4);
}
.note-text{
  color:#78350f;font-weight:500;
  word-break:break-word;
  padding-top:1px;
}

/* Вариант "Важно" для модалки */
.chip.warn{
  background:#fef3c7;color:#92400e;
  font-weight:700;
}

/* ========== ОБЁРТКА ФОТО С БЕЙДЖЕМ ========== */
.p-img-wrap{
  position:relative;
  width:100%;
  aspect-ratio:1/1;
  overflow:hidden;
  background:#eef2ff;
}
.p-img-wrap .pimg{
  width:100%;height:100%;object-fit:cover;display:block;
  transition:transform .4s var(--ease);
}
@media(hover:hover){
  .p-card:hover .p-img-wrap .pimg{transform:scale(1.06)}
}

/* Бейдж поверх фото — снизу слева, как у маркетплейсов */
.p-img-badge{
  position:absolute;
  left:8px;bottom:8px;right:8px;
  display:flex;align-items:center;gap:5px;
  padding:5px 9px;
  background:linear-gradient(135deg,#f59e0b,#ea580c);
  color:#fff;
  border-radius:8px;
  font-size:10.5px;font-weight:700;line-height:1.2;
  letter-spacing:.2px;
  box-shadow:0 4px 10px rgba(234,88,12,.4);
  max-width:fit-content;
  backdrop-filter:blur(4px);
  animation:badgeSlide .4s var(--ease-spring) both;
}
@keyframes badgeSlide{
  from{opacity:0;transform:translateY(8px) scale(.9)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.p-img-badge .bi-icon{
  font-size:11px;flex-shrink:0;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.2));
}
.p-img-badge .bi-text{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  word-break:break-word;
}

/* Варианты бейджей по типу примечания (можно использовать в будущем) */
.p-img-badge.warn{background:linear-gradient(135deg,#f59e0b,#ea580c);box-shadow:0 4px 10px rgba(234,88,12,.4)}
.p-img-badge.info{background:linear-gradient(135deg,#3b82f6,#1d4ed8);box-shadow:0 4px 10px rgba(29,78,216,.4)}
.p-img-badge.hit{background:linear-gradient(135deg,#10b981,#059669);box-shadow:0 4px 10px rgba(5,150,105,.4)}
.p-img-badge.new{background:linear-gradient(135deg,#8b5cf6,#6d28d9);box-shadow:0 4px 10px rgba(109,40,217,.4)}
.p-img-badge.hot{background:linear-gradient(135deg,#ef4444,#b91c1c);box-shadow:0 4px 10px rgba(185,28,28,.4)}

/* Старый .p-note оставляем — используется в модалке */

/* ========== ПОДКАТЕГОРИИ НА ЭКРАНЕ "КАТЕГОРИИ" ========== */
.cat-sub-group{margin-top:18px}
.cat-sub-title{
  font-size:12px;font-weight:700;color:var(--text-mute);
  text-transform:uppercase;letter-spacing:.6px;
  padding:6px 4px 10px;
  display:flex;align-items:center;gap:8px;
}
.cat-sub-title::before{
  content:'';width:3px;height:14px;background:var(--primary);border-radius:2px;
}
.subcat-list{display:flex;flex-wrap:wrap;gap:8px}
.subcat-chip{
  display:inline-flex;align-items:center;gap:7px;
  padding:7px 14px 7px 8px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:100px;
  font-size:13px;font-weight:500;color:var(--text);
  cursor:pointer;
  box-shadow:var(--shadow-sm);
  transition:transform .15s var(--ease),box-shadow .2s var(--ease),border-color .2s var(--ease),color .2s var(--ease);
  animation:cardIn .3s var(--ease) both;
}
.subcat-chip:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
  border-color:var(--primary);
  color:var(--primary);
}
.subcat-chip:active{transform:scale(.95)}
.subcat-chip img{
  width:24px;height:24px;border-radius:50%;object-fit:cover;
  background:#eef2ff;flex-shrink:0;
}

/* ========== ЭКРАН "КАТЕГОРИИ": РОДИТЕЛЬ + ДЕТИ ========== */
.cat-branch{margin-bottom:22px}
.cat-branch:last-child{margin-bottom:0}

.cat-parent-row{
  display:flex;align-items:center;gap:14px;
  background:#fff;border-radius:14px;padding:12px 14px 12px 12px;
  box-shadow:var(--shadow-sm);cursor:pointer;
  transition:transform .15s var(--ease),box-shadow .2s var(--ease);
  animation:cardIn .35s var(--ease) both;
  position:relative;overflow:hidden;
}
.cat-parent-row:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}
.cat-parent-row:active{transform:scale(.98)}
.cat-parent-row img{
  width:72px;height:72px;border-radius:12px;object-fit:cover;
  background:#eef2ff;flex-shrink:0;
}
.cat-parent-info{flex:1;min-width:0}
.cat-parent-title{
  font-size:16px;font-weight:700;letter-spacing:-.2px;
  color:var(--text);margin-bottom:3px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.cat-parent-count{font-size:12px;color:var(--text-mute);font-weight:500}
.cat-parent-arrow{
  font-size:26px;color:var(--text-mute);opacity:.5;line-height:1;
  transition:transform .2s var(--ease),color .2s var(--ease),opacity .2s var(--ease);
  flex-shrink:0;
}
.cat-parent-row:hover .cat-parent-arrow{
  transform:translateX(3px);color:var(--primary);opacity:1;
}

.cat-children{
  display:grid;grid-template-columns:repeat(3,1fr);gap:8px;
  margin-top:10px;
  margin-left:38px;
  padding-left:14px;
  border-left:2px solid var(--primary-light);
}
@media(min-width:600px){.cat-children{grid-template-columns:repeat(4,1fr);margin-left:44px}}
@media(min-width:900px){.cat-children{grid-template-columns:repeat(6,1fr)}}

.cat-child{
  background:#fff;border-radius:10px;overflow:hidden;text-align:center;
  box-shadow:var(--shadow-sm);cursor:pointer;
  transition:transform .15s var(--ease),box-shadow .2s var(--ease);
  animation:cardIn .3s var(--ease) both;
  padding-bottom:6px;
}
.cat-child:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}
.cat-child:active{transform:scale(.94)}
.cat-child img{
  width:100%;aspect-ratio:1/1;object-fit:cover;
  background:#eef2ff;display:block;
}
.cat-child span{
  display:block;padding:6px 4px 0;font-size:11px;font-weight:500;
  line-height:1.2;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* ========== ЖЁСТКАЯ ФИКСАЦИЯ РАЗМЕРОВ (иначе SVG-заглушка раздувает) ========== */
.cat-parent-row img,
.cat-parent-row svg{
  width:72px !important;
  height:72px !important;
  max-width:72px !important;
  max-height:72px !important;
  object-fit:cover !important;
  flex-shrink:0 !important;
  display:block !important;
  border-radius:12px !important;
  background:#eef2ff !important;
}
.cat-parent-row{
  min-height:96px !important;
  padding:12px 14px !important;
  overflow:hidden !important;
}
.cat-child img{
  width:100% !important;
  height:auto !important;
  max-height:120px !important;
  aspect-ratio:1/1 !important;
  object-fit:cover !important;
  display:block !important;
}
.cat-subchip img{
  width:18px !important;
  height:18px !important;
  max-width:18px !important;
  max-height:18px !important;
  border-radius:50% !important;
  object-fit:cover !important;
  flex-shrink:0 !important;
}

/* ========== ФИНАЛЬНАЯ ВЁРСТКА ЭКРАНА "КАТЕГОРИИ" ========== */

/* Компактный родитель */
.cat-branch{
  margin-bottom:14px !important;
}
.cat-parent-row{
  display:flex !important;
  align-items:center !important;
  gap:12px !important;
  padding:10px 14px 10px 10px !important;
  min-height:76px !important;
  max-height:76px !important;
  overflow:hidden !important;
  border-radius:14px !important;
}
.cat-parent-row img,
.cat-parent-row svg{
  width:56px !important;
  height:56px !important;
  max-width:56px !important;
  max-height:56px !important;
  min-width:56px !important;
  min-height:56px !important;
  object-fit:cover !important;
  border-radius:12px !important;
  flex-shrink:0 !important;
  display:block !important;
  background:#eef2ff !important;
}
.cat-parent-title{
  font-size:15px !important;
  font-weight:700 !important;
  margin-bottom:2px !important;
}
.cat-parent-count{
  font-size:11.5px !important;
  color:var(--text-mute) !important;
}
.cat-parent-arrow{
  font-size:22px !important;
  flex-shrink:0 !important;
}

/* Дети — маленькие фиксированные плитки 84×84, горизонтальной лентой */
.cat-children{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:10px !important;
  margin-top:10px !important;
  margin-left:28px !important;
  padding-left:12px !important;
  border-left:2px solid var(--primary-light) !important;
  align-items:flex-start !important;
}
.cat-node{
  display:flex !important;
  flex-direction:column !important;
  width:auto !important;
  flex:0 0 auto !important;
}
.cat-child{
  width:84px !important;
  min-width:84px !important;
  max-width:84px !important;
  flex:0 0 84px !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  padding:0 0 5px 0 !important;
  background:#fff !important;
  border-radius:12px !important;
  box-shadow:var(--shadow-sm) !important;
  overflow:hidden !important;
  cursor:pointer !important;
  transition:transform .15s var(--ease),box-shadow .2s var(--ease) !important;
}
.cat-child:hover{
  transform:translateY(-2px) !important;
  box-shadow:var(--shadow-md) !important;
}
.cat-child img,
.cat-child svg{
  width:84px !important;
  height:84px !important;
  max-width:84px !important;
  max-height:84px !important;
  min-width:84px !important;
  min-height:84px !important;
  object-fit:cover !important;
  display:block !important;
  flex-shrink:0 !important;
  border-radius:12px 12px 0 0 !important;
  background:#eef2ff !important;
}
.cat-child span{
  font-size:10.5px !important;
  font-weight:600 !important;
  line-height:1.15 !important;
  padding:5px 3px 2px 3px !important;
  text-align:center !important;
  max-width:100% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

/* Скрываем 3+ уровень на этом экране — он всё равно показывается внутри категории */
.cat-node-children{
  display:none !important;
}

/* На случай, если где-то остался старый .cat-subchip — тоже спрятать */
.cat-subchip{
  display:none !important;
}

/* ========== ОТКРЫТАЯ КАТЕГОРИЯ (внутри) ========== */
.cat-open-header{
  display:flex;align-items:center;gap:8px;
  padding:4px 0 12px;
}
.cat-open-back{
  width:36px;height:36px;
  border:none;background:#fff;border-radius:10px;
  font-size:22px;line-height:1;color:var(--text);
  cursor:pointer;box-shadow:var(--shadow-sm);
  display:flex;align-items:center;justify-content:center;
  transition:transform .15s var(--ease),background .15s var(--ease);
  padding-bottom:3px;
}
.cat-open-back:active{transform:scale(.9)}
.cat-open-title{
  font-size:20px;font-weight:700;padding:0;
  letter-spacing:-.3px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

.cat-open-section{margin-bottom:22px}
.cat-open-section-title{
  font-size:12px;font-weight:700;color:var(--text-mute);
  text-transform:uppercase;letter-spacing:.6px;
  padding:4px 4px 10px;
  display:flex;align-items:center;gap:8px;
}
.cat-open-section-title::before{
  content:'';width:3px;height:14px;background:var(--primary);border-radius:2px;
}

.cat-open-children{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:10px !important;
  align-items:flex-start !important;
}

/* ========== ДЕРЕВО КАТЕГОРИЙ (финальный вариант) ========== */
.cat-tree{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.cat-tree-node{
  display:flex;
  flex-direction:column;
}

.cat-tree-row{
  display:flex;
  align-items:center;
  gap:14px;
  background:#fff;
  border-radius:14px;
  padding:12px 14px 12px 12px;
  box-shadow:0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  cursor:pointer;
  transition:transform .15s cubic-bezier(.4,0,.2,1), box-shadow .2s cubic-bezier(.4,0,.2,1);
  min-height:76px;
  animation:cardIn .35s cubic-bezier(.4,0,.2,1) both;
}
.cat-tree-row:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 16px rgba(15,23,42,.1);
}
.cat-tree-row:active{transform:scale(.985)}

.cat-tree-row img,
.cat-tree-row .cat-tree-noimg{
  width:52px !important;
  height:52px !important;
  min-width:52px !important;
  min-height:52px !important;
  max-width:52px !important;
  max-height:52px !important;
  border-radius:12px;
  object-fit:cover;
  background:#eef2ff;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  color:#4f46e5;
}
.cat-tree-row .cat-tree-noimg{font-size:24px}

.cat-tree-info{flex:1;min-width:0}
.cat-tree-title{
  font-size:15px;
  font-weight:600;
  letter-spacing:-.2px;
  color:var(--text);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.cat-tree-count{
  font-size:11.5px;
  color:var(--text-mute);
  margin-top:3px;
  font-weight:500;
}
.cat-tree-arrow{
  font-size:24px;
  line-height:1;
  color:var(--text-mute);
  opacity:.45;
  flex-shrink:0;
  transition:transform .2s cubic-bezier(.4,0,.2,1), color .2s cubic-bezier(.4,0,.2,1), opacity .2s cubic-bezier(.4,0,.2,1);
  padding-bottom:3px;
}
.cat-tree-row:hover .cat-tree-arrow{
  transform:translateX(3px);
  color:var(--primary);
  opacity:1;
}

/* Вложенные уровни — отступ + вертикальная линия */
.cat-tree-children{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
  margin-left:22px;
  padding-left:16px;
  border-left:2px solid #c7d2fe;
}

/* Отступ у детей поменьше картинка */
.cat-tree-row[data-depth="1"] img,
.cat-tree-row[data-depth="1"] .cat-tree-noimg{
  width:44px !important;height:44px !important;
  min-width:44px !important;min-height:44px !important;
  max-width:44px !important;max-height:44px !important;
}
.cat-tree-row[data-depth="1"]{min-height:64px;padding:10px 12px}
.cat-tree-row[data-depth="1"] .cat-tree-title{font-size:14px}

.cat-tree-row[data-depth="2"] img,
.cat-tree-row[data-depth="2"] .cat-tree-noimg,
.cat-tree-row[data-depth="3"] img,
.cat-tree-row[data-depth="3"] .cat-tree-noimg{
  width:38px !important;height:38px !important;
  min-width:38px !important;min-height:38px !important;
  max-width:38px !important;max-height:38px !important;
}
.cat-tree-row[data-depth="2"]{min-height:56px;padding:8px 12px}
.cat-tree-row[data-depth="3"]{min-height:52px;padding:8px 12px}
.cat-tree-row[data-depth="2"] .cat-tree-title,
.cat-tree-row[data-depth="3"] .cat-tree-title{font-size:13.5px}

/* ========== ПЛИТКИ ПОДКАТЕГОРИЙ ВНУТРИ ОТКРЫТОЙ КАТЕГОРИИ ========== */
/* 3 в ряд на мобильном, крупнее на широком экране — как на главной */

.cat-open-children{
  display:grid !important;
  grid-template-columns:repeat(3,1fr) !important;
  gap:10px !important;
}

.cat-open-children .cat-child{
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
  flex:initial !important;
  border-radius:14px !important;
  padding-bottom:8px !important;
  box-shadow:0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04) !important;
}
.cat-open-children .cat-child img,
.cat-open-children .cat-child svg{
  width:100% !important;
  height:auto !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:100% !important;
  max-height:none !important;
  aspect-ratio:1/1 !important;
  object-fit:cover !important;
  border-radius:14px 14px 0 0 !important;
}
.cat-open-children .cat-child span{
  font-size:11px !important;
  font-weight:600 !important;
  padding:7px 5px 3px 5px !important;
  white-space:normal !important;
  line-height:1.2 !important;
  text-align:center !important;
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
}

/* Планшет — 4 в ряд */
@media(min-width:600px){
  .cat-open-children{grid-template-columns:repeat(4,1fr) !important}
  .cat-open-children .cat-child span{font-size:12.5px !important;padding:9px 6px 4px 6px !important}
}

/* Десктоп — 5 в ряд */
@media(min-width:900px){
  .cat-open-children{grid-template-columns:repeat(5,1fr) !important}
  .cat-open-children .cat-child span{font-size:13.5px !important}
}

/* ========== АКТИВНЫЙ ЗАКАЗ ========== */
.order-open-banner,
.order-lock-banner{
  padding:12px 14px;border-radius:12px;font-size:13px;line-height:1.4;
  margin-bottom:14px;
}
.order-open-banner{
  background:#fef3c7;color:#78350f;border-left:3px solid #f59e0b;
}
.order-lock-banner{
  background:#fee2e2;color:#991b1b;border-left:3px solid #ef4444;
}
.order-open-banner span,
.order-lock-banner span{opacity:.85;font-size:12px}

.order-items{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.order-item-readonly{
  display:flex;gap:12px;align-items:center;background:#fff;padding:10px 12px;
  border-radius:12px;box-shadow:var(--shadow-sm);
}
.order-item-readonly img{
  width:56px;height:56px;object-fit:cover;border-radius:10px;background:#eef2ff;flex-shrink:0;
}
.order-item-readonly .oi-info{flex:1;min-width:0;font-size:13px}
.order-item-readonly .oi-info b{display:block;font-weight:600;margin-bottom:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-item-readonly .oi-price{color:var(--text-mute);font-size:12px}
.order-item-readonly .oi-sum{font-weight:700;color:var(--primary);white-space:nowrap}

.order-status-row{
  display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;
  padding:10px 4px;font-size:12px;color:var(--text-mute);
}

.btn-outline{
  background:#fff;color:var(--primary);border:1.5px solid var(--primary);
  padding:14px 18px;border-radius:14px;font-weight:600;font-size:14px;
  cursor:pointer;font-family:inherit;
  transition:background .15s var(--ease);
}
.btn-outline:hover{background:var(--primary-light)}

/* ========== BADGE НА КОРЗИНЕ ОТ СООБЩЕНИЙ ========== */
#bottomNav button .chat-badge{
  position:absolute;top:8px;right:28%;
  min-width:16px;height:16px;padding:0 4px;
  background:#10b981;color:#fff;
  font-size:9.5px;font-weight:700;line-height:16px;
  border-radius:8px;font-style:normal;text-align:center;
  box-shadow:0 2px 5px rgba(16,185,129,.4);
  animation:badgePop .4s var(--ease-spring);
}
#bottomNav button .chat-badge:empty{display:none}

/* ========== МОИ ЗАКАЗЫ (список) ========== */
.my-orders-list{display:flex;flex-direction:column;gap:10px}
.order-list-card{
  background:#fff;border-radius:14px;padding:14px 16px;
  box-shadow:var(--shadow-sm);cursor:pointer;
  transition:transform .15s var(--ease),box-shadow .2s var(--ease);
  animation:cardIn .3s var(--ease) both;
}
.order-list-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}
.order-list-card:active{transform:scale(.98)}
.olc-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;gap:8px}
.olc-id{font-size:15px;font-weight:700;color:var(--text)}
.olc-status{
  font-size:11px;font-weight:600;padding:4px 10px;border-radius:100px;
  background:#fef3c7;color:#92400e;
}
.olc-status.locked{background:#fee2e2;color:#991b1b}
.olc-meta{font-size:12px;color:var(--text-mute);margin-bottom:8px}
.olc-foot{display:flex;justify-content:space-between;align-items:center}
.olc-unread{
  background:#10b981;color:#fff;font-size:11px;font-weight:700;
  padding:3px 9px;border-radius:100px;
}
.olc-arrow{font-size:22px;color:var(--text-mute);opacity:.5}

/* ========== ВЛОЖЕНИЯ В ЧАТЕ ========== */
.chat-input .attach-label{
  display:flex;align-items:center;justify-content:center;
  width:44px;height:44px;font-size:18px;cursor:pointer;
  background:#f3f4f6;border-radius:0;color:#6b7280;
}
.chat-input .attach-label:hover{background:#e5e7eb}

/* Уведомление о закрытии чата */
#chatLockNotice{
  animation:cardIn .3s var(--ease) both;
}

/* ========== ЧАТ: размеры + чистая шапка + контакты ========== */
.chat{
  max-height:82vh !important;
}
@media(max-height:700px){
  .chat{max-height:88vh !important}
}

/* Шапка — одна строка: заголовок слева, × справа */
.chat-head{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  flex-wrap:nowrap !important;
  gap:10px !important;
  padding:14px 16px !important;
}
.chat-head .chat-title{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:600;
  font-size:14px;
}
.chat-head .chat-close{
  flex-shrink:0;
  width:28px;height:28px;
  font-size:16px;
}

/* Полоска контактов под шапкой */
.chat-contacts-bar{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  background:#f9fafb;
  border-bottom:1px solid #e5e7eb;
  flex-wrap:wrap;
}
.chat-contacts-label{
  font-size:11.5px;
  color:#6b7280;
  font-weight:600;
  letter-spacing:.2px;
  margin-right:2px;
}
.chat-contact-btn{
  width:38px;height:38px;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:10px;
  color:#fff;
  text-decoration:none;
  flex-shrink:0;
  box-shadow:0 2px 6px rgba(15,23,42,.1);
  transition:transform .15s var(--ease),filter .15s var(--ease);
}
.chat-contact-btn:active{transform:scale(.9)}
.chat-contact-btn:hover{filter:brightness(1.1);transform:translateY(-1px)}
.chat-contact-btn.wa{background:#25d366}
.chat-contact-btn.tg{background:#0088cc}
.chat-contact-btn.tel{
  background:#4f46e5;
}

/* ========== ПЛАШКА "ВКЛЮЧИТЬ УВЕДОМЛЕНИЯ" ========== */
#pushBanner{
  position:fixed;
  bottom:calc(var(--nav-h) + 12px);
  left:12px;right:12px;
  max-width:420px;
  margin:0 auto;
  background:#fff;
  border-radius:16px;
  padding:14px 16px;
  box-shadow:0 8px 28px rgba(15,23,42,.18), 0 2px 8px rgba(15,23,42,.08);
  border:1.5px solid #eef2ff;
  z-index:80;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  animation:pushBannerIn .35s var(--ease-spring) both;
}
@keyframes pushBannerIn{
  from{opacity:0;transform:translateY(20px) scale(.96)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.push-banner-icon{
  width:44px;height:44px;border-radius:12px;
  background:linear-gradient(135deg,#4f46e5,#7c3aed);
  display:flex;align-items:center;justify-content:center;
  font-size:20px;flex-shrink:0;
  box-shadow:0 4px 12px rgba(79,70,229,.35);
}
.push-banner-text{
  flex:1;min-width:140px;
  display:flex;flex-direction:column;gap:2px;
}
.push-banner-text b{font-size:14px;color:var(--text)}
.push-banner-text span{font-size:12px;color:var(--text-mute)}
.push-banner-actions{
  display:flex;gap:6px;flex-shrink:0;
}
.push-banner-btn{
  min-height:36px;
  padding:8px 14px;
  border-radius:10px;
  font-size:13px;
  font-weight:600;
  font-family:inherit;
  cursor:pointer;
  border:none;
  transition:transform .15s var(--ease),background .15s var(--ease);
}
.push-banner-btn:active{transform:scale(.95)}
.push-banner-btn.allow{
  background:var(--primary);color:#fff;
}
.push-banner-btn.allow:hover{background:var(--primary-dark)}
.push-banner-btn.skip{
  background:#f3f4f6;color:var(--text-mute);
}
.push-banner-btn.skip:hover{background:#e5e7eb}

/* ========== АРТИКУЛ В КАРТОЧКЕ ЗАКАЗА ========== */
.order-item-readonly .oi-sku{
  font-size:11px;
  color:var(--text-mute);
  font-weight:600;
  margin-bottom:2px;
  letter-spacing:.2px;
}

/* ========== ГАЛЕРЕЯ ФОТО В КАРТОЧКЕ ТОВАРА (КЛИЕНТ) ========== */
.prod-gallery{margin-bottom:16px}
.prod-gallery-main{
  width:100%;
  aspect-ratio:1/1;
  border-radius:16px;
  overflow:hidden;
  background:#eef2ff;
  margin-bottom:8px;
}
.prod-gallery-main img{
  width:100%;height:100%;
  object-fit:cover;display:block;
  cursor:zoom-in;
  transition:transform .3s var(--ease);
}
.prod-gallery-main img:hover{transform:scale(1.02)}

.prod-gallery-thumbs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:4px;
  scrollbar-width:none;
}
.prod-gallery-thumbs::-webkit-scrollbar{display:none}
.prod-thumb{
  flex:0 0 64px;
  width:64px;height:64px;
  border-radius:10px;
  overflow:hidden;
  background:#eef2ff;
  cursor:pointer;
  border:2px solid transparent;
  transition:border-color .15s var(--ease),transform .15s var(--ease);
}
.prod-thumb:active{transform:scale(.94)}
.prod-thumb img{
  width:100%;height:100%;
  object-fit:cover;display:block;
}
.prod-thumb.active{border-color:var(--primary)}

/* ========== B2B-ЭЛЕМЕНТЫ НА КЛИЕНТЕ ========== */
.p-price-retail{
  font-size:11px;
  color:var(--text-mute);
  font-weight:600;
  margin-top:-2px;
  margin-bottom:2px;
}
.p-status-badge{
  display:inline-block;
  font-size:10px;
  font-weight:700;
  padding:3px 8px;
  border-radius:6px;
  margin-top:2px;
  letter-spacing:.2px;
}

/* Таблица уровней в модалке */

/* Статус наличия в модалке */

/* Ссылка на видео */

/* ========== МОДАЛКА ТОВАРА — НОВАЯ СТРУКТУРА ========== */

.modal-prod-title{
  padding:0 0 10px !important;
  font-size:22px !important;
  line-height:1.25 !important;
  letter-spacing:-.3px !important;
}

/* Чипсы под названием (артикул, мин, статус) */
.modal-chips-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}
.meta-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:6px 12px;
  background:#f3f4f6;
  border-radius:100px;
  font-size:12px;
  font-weight:600;
  color:#4b5563;
  white-space:nowrap;
}

/* Статус наличия — маленькая плашка в ряду */
.stock-status{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:6px 12px;
  border-radius:100px;
  font-size:12px;
  font-weight:700;
  border:1.5px solid;
  white-space:nowrap;
}

/* ========== КАРТОЧКИ-СЕКЦИИ В МОДАЛКЕ ========== */
.modal-card{
  background:#fff;
  border:1.5px solid #eef0f4;
  border-radius:14px;
  padding:14px;
  margin-bottom:12px;
}
.modal-card-head{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:700;
  color:#1a1a2e;
  margin-bottom:12px;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.modal-card-icon{
  font-size:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
}

/* ========== БЛОК ОПТОВЫХ ЦЕН (УРОВНИ) ========== */
.tier-highlight{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  background:linear-gradient(135deg,#4f46e5,#7c3aed);
  border-radius:12px;
  color:#fff;
  margin-bottom:14px;
  box-shadow:0 6px 20px rgba(79,70,229,.25);
}
.tier-highlight-label{
  font-size:12px;
  opacity:.9;
  font-weight:500;
  letter-spacing:.2px;
}
.tier-highlight-price{
  font-size:22px;
  font-weight:800;
  letter-spacing:-.5px;
}

.tier-list-new{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.tier-row-new{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px;
  background:#f9fafb;
  border-radius:10px;
  transition:background .15s;
}
.tier-row-new:hover{background:#f3f4f6}
.tier-row-new.best{
  background:#eef2ff;
  border:1.5px solid #c7d2fe;
}
.tier-qty{
  font-size:13.5px;
  color:#4b5563;
  font-weight:500;
}
.tier-qty b{
  color:#1a1a2e;
  font-weight:700;
  font-size:14.5px;
}
.tier-price-num{
  font-size:15px;
  font-weight:800;
  color:#4f46e5;
  letter-spacing:-.3px;
  white-space:nowrap;
}
.tier-price-num span{
  font-size:12px;
  font-weight:600;
  opacity:.7;
}
.tier-row-new.best .tier-price-num{
  color:#4338ca;
}

/* ========== ОТДЕЛЬНЫЕ ЦЕНЫ (ДРОП И РОЗНИЦА) ========== */
.modal-card-special{
  background:#fafbfc;
}
.special-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.special-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px;
  border-radius:10px;
  font-size:13.5px;
}
.special-item.drop{
  background:#fff7ed;
  border-left:3px solid #f59e0b;
}
.special-item.retail{
  background:#f0f9ff;
  border-left:3px solid #0ea5e9;
}
.special-item .si-label{
  color:#4b5563;
  font-weight:500;
}
.special-item .si-price{
  font-weight:800;
  font-size:14.5px;
  color:#1a1a2e;
  letter-spacing:-.2px;
}

/* ========== ВИДЕО-ОБЗОР ========== */
.video-link{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:14px 18px;
  background:linear-gradient(135deg,#fef2f2,#fee2e2);
  color:#dc2626;
  border-radius:12px;
  text-decoration:none;
  font-size:14px;
  font-weight:700;
  margin-bottom:12px;
  border:1.5px solid #fecaca;
  transition:transform .15s,box-shadow .2s;
}
.video-link:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 20px rgba(220,38,38,.15);
}
.video-link:active{transform:scale(.98)}
.video-icon{
  width:28px;
  height:28px;
  background:#dc2626;
  color:#fff;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  padding-left:2px;
  flex-shrink:0;
}

/* ========== ПРИМЕЧАНИЕ ========== */
.modal-note-block{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px 14px;
  border-radius:12px;
  margin-bottom:12px;
  font-size:13.5px;
  line-height:1.4;
  font-weight:500;
}
.modal-note-block.warn{
  background:#fef3c7;
  color:#78350f;
  border-left:3px solid #f59e0b;
}
.modal-note-block.hot{
  background:#fee2e2;
  color:#991b1b;
  border-left:3px solid #ef4444;
}
.modal-note-block.hit{
  background:#d1fae5;
  color:#065f46;
  border-left:3px solid #10b981;
}
.modal-note-block.new{
  background:#ede9fe;
  color:#5b21b6;
  border-left:3px solid #8b5cf6;
}
.modal-note-block .note-icon{
  font-size:16px;
  flex-shrink:0;
  line-height:1;
  margin-top:1px;
}
.modal-note-block .note-text{
  flex:1;
  min-width:0;
  word-break:break-word;
}

/* ========== ОПИСАНИЕ ========== */
.modal-desc-body{
  font-size:14px;
  line-height:1.55;
  color:#374151;
  white-space:pre-wrap;
  word-break:break-word;
}

/* Адаптив для узких экранов */
@media(max-width:400px){
  .tier-highlight{padding:12px 14px}
  .tier-highlight-price{font-size:20px}
  .tier-price-num{font-size:14px}
  .modal-prod-title{font-size:20px !important}
}

/* ========== НОВАЯ КОРЗИНА ========== */
.cart-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.cart-item{
  display:flex;
  gap:12px;
  background:#fff;
  border-radius:14px;
  padding:12px;
  box-shadow:0 1px 3px rgba(15,23,42,.06);
  align-items:flex-start;
  animation:cardIn .3s var(--ease) both;
}

.cart-item img{
  width:76px;
  height:76px;
  object-fit:cover;
  border-radius:10px;
  background:#eef2ff;
  flex-shrink:0;
}


.ci-name{
  font-size:14px;
  font-weight:600;
  line-height:1.3;
  color:var(--text);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.ci-sku{
  font-size:11px;
  color:var(--text-mute);
  font-weight:600;
  letter-spacing:.2px;
}





.ci-sum{
  font-size:15px;
  font-weight:800;
  color:var(--primary);
  letter-spacing:-.3px;
  white-space:nowrap;
}

/* ========== КОРЗИНА: ФИНАЛЬНАЯ ВЁРСТКА ========== */
.cart-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:14px;
}

.cart-item{
  display:flex;
  gap:12px;
  background:#fff;
  border-radius:14px;
  padding:12px;
  box-shadow:0 1px 3px rgba(15,23,42,.06);
  animation:cardIn .3s var(--ease) both;
}

.cart-item > img{
  width:72px;
  height:72px;
  object-fit:cover;
  border-radius:10px;
  background:#eef2ff;
  flex-shrink:0;
  display:block;
}

.ci-body{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:8px;
}

.ci-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
}

.ci-titles{flex:1;min-width:0}

.ci-name{
  font-size:14px;
  font-weight:600;
  line-height:1.3;
  color:var(--text);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  margin-bottom:2px;
}

.ci-sku{
  font-size:11px;
  color:var(--text-mute);
  font-weight:600;
  letter-spacing:.2px;
}

.ci-remove{
  flex-shrink:0;
  width:28px;
  height:28px;
  border:none;
  background:#fee2e2;
  color:#dc2626;
  border-radius:8px;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .15s, transform .15s;
  font-family:inherit;
  padding:0;
}
.ci-remove:hover{background:#fecaca}
.ci-remove:active{transform:scale(.9)}

.ci-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.ci-footer input{
  width:70px;
  padding:8px 10px;
  text-align:center;
  border:1.5px solid var(--border);
  border-radius:8px;
  font-size:14px;
  font-weight:600;
  background:#f9fafb;
  font-family:inherit;
  transition:border-color .15s, background .15s;
}
.ci-footer input:focus{
  outline:none;
  border-color:var(--primary);
  background:#fff;
}

.ci-sum{
  font-size:16px;
  font-weight:800;
  color:var(--primary);
  letter-spacing:-.3px;
  white-space:nowrap;
}

.cart-total{
  text-align:right;
  font-weight:800;
  font-size:20px;
  padding:14px 4px;
  color:var(--primary);
  letter-spacing:-.4px;
}

/* ========== БЕЙДЖ ПРИМЕЧАНИЯ В МОДАЛКЕ (ПОВЕРХ ФОТО) ========== */
.prod-gallery-main{
  position:relative;
}

.prod-gallery-main .p-img-badge.modal-badge{
  position:absolute;
  left:12px;
  bottom:12px;
  right:12px;
  max-width:fit-content;
  font-size:12px;
  padding:7px 12px;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  z-index:2;
}
.prod-gallery-main .p-img-badge.modal-badge .bi-icon{
  font-size:13px;
}
.prod-gallery-main .p-img-badge.modal-badge .bi-text{
  -webkit-line-clamp:3;
  line-height:1.3;
}

/* ========== INFINITE SCROLL — ИНДИКАТОРЫ ========== */
.cat-load-more-sentinel{
  padding:24px 16px;
  text-align:center;
  min-height:80px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.cat-loading-spinner{
  display:inline-flex;
  gap:6px;
  align-items:center;
}
.cat-loading-spinner span{
  width:10px;
  height:10px;
  background:var(--primary);
  border-radius:50%;
  display:inline-block;
  animation:catBounce 1.2s infinite ease-in-out both;
}
.cat-loading-spinner span:nth-child(1){animation-delay:0s}
.cat-loading-spinner span:nth-child(2){animation-delay:.2s}
.cat-loading-spinner span:nth-child(3){animation-delay:.4s}
@keyframes catBounce{
  0%,80%,100%{transform:scale(0.4);opacity:.4}
  40%{transform:scale(1);opacity:1}
}

.cat-loading-text{
  font-size:12.5px;
  color:var(--text-mute);
  font-weight:600;
  letter-spacing:.2px;
}

.cat-all-loaded{
  font-size:12px;
  color:#9ca3af;
  font-weight:500;
  padding:8px 0;
  position:relative;
}
.cat-all-loaded::before,
.cat-all-loaded::after{
  content:'';
  display:inline-block;
  width:36px;
  height:1px;
  background:#e5e7eb;
  vertical-align:middle;
  margin:0 10px;
}

/* Плавное появление новых карточек */
.products .p-card{
  animation:cardIn .35s var(--ease) both;
}

/* ========== КНОПКА «НОВИНКИ» РЯДОМ С ПОИСКОМ ========== */
.topbar-row{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
}
.topbar-row .search-wrap{
  flex:1;
  min-width:0;
}

/* ========== КНОПКА «НОВИНКИ» — КРУПНАЯ, ЗЕЛЁНАЯ ========== */
.new-arrivals-btn{
  flex-shrink:0;
  height:46px;
  padding:0 18px;
  border:none;
  background:linear-gradient(135deg,#10b981,#059669);
  color:#fff;
  border-radius:12px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:inherit;
  font-size:14px;
  font-weight:700;
  letter-spacing:.2px;
  box-shadow:0 4px 12px rgba(16,185,129,.3);
  transition:transform .15s var(--ease), box-shadow .2s var(--ease);
  position:relative;
  white-space:nowrap;
}
.new-arrivals-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 18px rgba(16,185,129,.4);
}
.new-arrivals-btn:active{
  transform:scale(.96);
}

/* Тонкий жёлтый индикатор — «новое» */
.new-arrivals-btn::after{
  content:'';
  position:absolute;
  top:6px;
  right:6px;
  width:8px;
  height:8px;
  background:#fbbf24;
  border-radius:50%;
  box-shadow:0 0 0 2px #fff;
}

/* На мобильном — компактнее */
@media(max-width:420px){
  .new-arrivals-btn{
    height:44px;
    padding:0 12px;
    font-size:12.5px;
  }
}

/* ========== БЕЙДЖ «ПАЧКА» ========== */
.p-pack-badge{
  position:absolute;
  left:8px;
  bottom:8px;
  background:linear-gradient(135deg,#f59e0b,#ea580c);
  color:#fff;
  padding:5px 10px;
  border-radius:8px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.2px;
  box-shadow:0 4px 10px rgba(234,88,12,.35);
  z-index:2;
}

/* ========== КОРЗИНА — КНОПКИ ± ПАЧКА ========== */
.ci-pack{
  font-size:11px;
  color:#92400e;
  font-weight:700;
  margin-top:2px;
}

.ci-qty-controls{
  display:flex;
  align-items:center;
  gap:4px;
  background:#f3f4f6;
  border-radius:10px;
  padding:3px;
}

.ci-qty-btn{
  background:#fff;
  border:none;
  border-radius:8px;
  min-width:38px;
  height:34px;
  padding:0 8px;
  font-size:12px;
  font-weight:700;
  color:#4f46e5;
  cursor:pointer;
  font-family:inherit;
  transition:background .15s, transform .1s;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}
.ci-qty-btn:hover{background:#eef2ff}
.ci-qty-btn:active{transform:scale(.92)}

.ci-qty-controls input{
  width:52px;
  height:34px;
  text-align:center;
  border:none;
  background:transparent;
  font-size:14px;
  font-weight:700;
  color:#1a1a2e;
  font-family:inherit;
  outline:none;
  -moz-appearance:textfield;
}
.ci-qty-controls input::-webkit-outer-spin-button,
.ci-qty-controls input::-webkit-inner-spin-button{
  -webkit-appearance:none;margin:0;
}

/* ========== КОРЗИНА — ФИНАЛЬНАЯ ВЁРСТКА (с количеством) ========== */
.cart-list{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:16px;
}

.cart-item{
  display:flex;
  gap:12px;
  background:#fff;
  border-radius:16px;
  padding:14px;
  box-shadow:0 1px 3px rgba(15,23,42,.06);
  animation:cardIn .3s var(--ease) both;
}

.cart-item > img{
  width:80px;
  height:80px;
  object-fit:cover;
  border-radius:12px;
  background:#eef2ff;
  flex-shrink:0;
  display:block;
}

.ci-body{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ci-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}

.ci-titles{flex:1;min-width:0}

.ci-name{
  font-size:15px;
  font-weight:600;
  line-height:1.3;
  color:#1a1a2e;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  margin-bottom:4px;
}

.ci-sku{
  font-size:11.5px;
  color:#6b7280;
  font-weight:600;
  letter-spacing:.2px;
  margin-bottom:3px;
}

.ci-unit-price{
  font-size:12.5px;
  color:#4f46e5;
  font-weight:600;
  margin-bottom:4px;
}

.ci-pack-badge{
  display:inline-block;
  font-size:11px;
  font-weight:700;
  color:#92400e;
  background:#fef3c7;
  padding:3px 8px;
  border-radius:6px;
  margin-top:2px;
}

.ci-remove{
  flex-shrink:0;
  width:30px;
  height:30px;
  border:none;
  background:#fee2e2;
  color:#dc2626;
  border-radius:9px;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .15s, transform .15s;
  font-family:inherit;
  padding:0;
}
.ci-remove:hover{background:#fecaca}
.ci-remove:active{transform:scale(.9)}

.ci-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.ci-qty-controls{
  display:flex;
  align-items:center;
  gap:6px;
  background:#f3f4f6;
  border-radius:12px;
  padding:4px;
}

.ci-qty-btn{
  width:36px;
  height:36px;
  border:none;
  background:#fff;
  border-radius:9px;
  font-size:18px;
  font-weight:700;
  color:#4f46e5;
  cursor:pointer;
  font-family:inherit;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .15s, transform .1s;
  padding:0;
  line-height:1;
  user-select:none;
}
.ci-qty-btn:hover{background:#eef2ff}
.ci-qty-btn:active{transform:scale(.9)}

.ci-qty-value{
  display:flex;
  align-items:center;
  gap:2px;
  padding:0 4px;
  min-width:60px;
  justify-content:center;
}

.ci-qty-value input{
  width:44px;
  height:36px;
  text-align:center;
  border:none;
  background:transparent;
  font-size:16px;
  font-weight:800;
  color:#1a1a2e;
  font-family:inherit;
  outline:none;
  -moz-appearance:textfield;
  padding:0;
}
.ci-qty-value input::-webkit-outer-spin-button,
.ci-qty-value input::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

.ci-qty-label{
  font-size:12px;
  color:#6b7280;
  font-weight:600;
}

.ci-sum{
  display:flex;
  align-items:baseline;
  gap:3px;
  white-space:nowrap;
}

.ci-sum-value{
  font-size:18px;
  font-weight:800;
  color:#4f46e5;
  letter-spacing:-.4px;
}

.ci-sum-currency{
  font-size:14px;
  font-weight:700;
  color:#4f46e5;
  opacity:.7;
}

/* ========== ИТОГОВЫЙ БЛОК КОРЗИНЫ ========== */
.cart-total-block{
  background:#f9fafb;
  border-radius:14px;
  padding:14px 16px;
  margin-bottom:14px;
  border:1px solid #eef0f4;
}

.cart-total-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  padding:5px 0;
  font-size:13.5px;
  color:#6b7280;
}
.cart-total-row b{
  color:#1a1a2e;
  font-weight:700;
  font-size:14px;
}

.cart-total-row.grand{
  border-top:1px solid #e5e7eb;
  margin-top:8px;
  padding-top:12px;
  font-size:15px;
  color:#1a1a2e;
  font-weight:600;
}
.cart-total-row.grand b{
  color:#4f46e5;
  font-size:22px;
  font-weight:800;
  letter-spacing:-.5px;
}

/* Старые стили .cart-total (если где-то остались) */
.cart-total{
  display:none;
}

/* ========== КОМПАКТНЫЙ ИТОГ В ДЕТАЛЯХ ЗАКАЗА ========== */
.order-summary{
  background:#f9fafb;
  border-radius:12px;
  padding:12px 14px;
  margin:12px 0;
  border:1px solid #eef0f4;
}

.order-summary-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  padding:4px 0;
  font-size:13px;
  color:#6b7280;
}
.order-summary-row b{
  color:#1a1a2e;
  font-weight:700;
  font-size:13.5px;
}

.order-summary-row.grand{
  border-top:1px solid #e5e7eb;
  margin-top:6px;
  padding-top:10px;
  font-size:14px;
  color:#1a1a2e;
  font-weight:600;
}
.order-summary-row.grand b{
  color:#4f46e5;
  font-size:19px;
  font-weight:800;
  letter-spacing:-.4px;
}

/* ============================================================
   УЛУЧШЕННОЕ ЗАКРЫТИЕ МОДАЛКИ
   ============================================================ */

/* 1) ПОЛОСКА-ИНДИКАТОР СВЕРХУ (как в iOS bottom-sheet) */
.modal-box::before {
  content: '';
  position: sticky;
  top: 0;
  display: block;
  width: 44px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: -8px auto 8px;
  z-index: 10;
}

/* 2) КРУПНЫЙ КРЕСТИК — ВСЕГДА ВИДЕН ПРИ СКРОЛЛЕ */
.modal-close {
  position: sticky !important;
  top: 0 !important;
  float: right !important;
  width: 40px !important;
  height: 40px !important;
  background: #fff !important;
  border: 1.5px solid #e5e7eb !important;
  border-radius: 50% !important;
  font-size: 20px !important;
  line-height: 1 !important;
  color: #4b5563 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: -8px -6px 0 0 !important;
  z-index: 20 !important;
  box-shadow: 0 4px 12px rgba(15,23,42,.08) !important;
  transition: background .15s, transform .15s, box-shadow .15s !important;
  -webkit-tap-highlight-color: transparent;
}
.modal-close:hover {
  background: #f3f4f6 !important;
  box-shadow: 0 6px 16px rgba(15,23,42,.12) !important;
}
.modal-close:active {
  transform: scale(.9) !important;
  background: #e5e7eb !important;
}

/* 3) КНОПКА «ЗАКРЫТЬ» ВНИЗУ МОДАЛКИ */
.modal-close-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  margin: 16px 0 0;
  background: #f3f4f6;
  border: none;
  border-radius: 12px;
  color: #4b5563;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.modal-close-bottom:hover {
  background: #e5e7eb;
}
.modal-close-bottom:active {
  transform: scale(.98);
}
.modal-close-bottom .mcb-icon {
  font-size: 13px;
  font-weight: 900;
  color: #9ca3af;
}

/* 4) СВАЙП — убираем лишнее выделение */
.modal-box {
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.modal-box input,
.modal-box textarea,
.modal-box select,
.modal-box button {
  -webkit-user-select: auto;
  user-select: auto;
}

/* 5) ПОДСКАЗКА СВАЙПА — только на мобильном и только 1 раз */
@media(max-width:600px){
  .modal-box::before {
    width: 52px;
    height: 5px;
    background: #c7d2fe;
  }
}

/* 6) На десктопе — спрятать полоску и кнопку внизу */
@media(min-width:700px){
  .modal-box::before { display: none; }
  .modal-close-bottom { display: none; }
}

/* ============================================================
   ФОН НЕ СКРОЛЛИТСЯ, КОГДА ОТКРЫТА МОДАЛКА
   ============================================================ */
body.modal-open {
  overflow: hidden !important;
}

/* Контент внутри модалки скроллится нормально */
.modal-box {
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ========== БЕЙДЖ SUM-СКИДКИ В КАРТОЧКЕ ========== */
.p-sum-badge{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-top:4px;
  padding:4px 10px;
  background:linear-gradient(135deg,#10b981,#059669);
  color:#fff;
  font-size:11px;
  font-weight:700;
  border-radius:100px;
  letter-spacing:.2px;
  box-shadow:0 2px 6px rgba(16,185,129,.3);
  align-self:flex-start;
}

/* ========== БАННЕР SUM-СКИДКИ В КОРЗИНЕ ========== */
.cart-sum-banner{
  display:flex;
  align-items:center;
  gap:12px;
  background:linear-gradient(135deg,#d1fae5,#a7f3d0);
  border-left:4px solid #059669;
  padding:12px 14px;
  border-radius:12px;
  margin-bottom:12px;
  animation:cardIn .4s var(--ease-spring) both;
}
.csb-icon{
  font-size:26px;
  flex-shrink:0;
}
.csb-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.csb-text b{
  font-size:14px;
  color:#065f46;
  font-weight:800;
}
.csb-text span{
  font-size:12px;
  color:#047857;
  line-height:1.3;
}

.cart-total-row.discount{
  color:#059669;
}
.cart-total-row.discount b{
  color:#059669;
  font-weight:800;
  font-size:15px;
}

/* ========== БАЗОВАЯ ЦЕНА В МОДАЛКЕ (SUM-РЕЖИМ) ========== */
.p-price-base{
  background:#fff;
  border:1.5px solid #e5e7eb;
  border-radius:12px;
  padding:12px 16px;
  margin:12px 0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.ppb-label{
  font-size:12px;
  color:#6b7280;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.3px;
}
.ppb-value{
  font-size:22px;
  font-weight:800;
  color:#1a1a2e;
  letter-spacing:-.4px;
  white-space:nowrap;
}
.ppb-unit{
  font-size:13px;
  color:#9ca3af;
  font-weight:600;
  margin-left:4px;
}

/* Доработка tier-highlight для отображения цены */
.tier-highlight-label{
  font-size:12px;
  opacity:.9;
  font-weight:500;
  letter-spacing:.2px;
}
.tier-highlight-price{
  font-size:22px;
  font-weight:800;
  letter-spacing:-.5px;
}

/* Скрываем старую плашку базовой цены — теперь price_site показывается как обычная цена */
.p-price-base{
  display:none !important;
}

/* ========== КРУПНАЯ ЦЕНА В МОДАЛКЕ ========== */
.p-price-lg{
  font-size:30px;
  font-weight:800;
  color:#4f46e5;
  letter-spacing:-1px;
  margin:10px 0 14px;
  line-height:1.1;
}

/* ========== КОМПАКТНАЯ КНОПКА СКИДОК ========== */
.sum-discounts-btn{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:12px 14px;background:#fff;
  border:1.5px solid #e5e7eb;border-radius:12px;
  font-family:inherit;font-size:13.5px;font-weight:600;
  color:#1a1a2e;cursor:pointer;text-align:left;
  transition:border-color .15s, background .15s, transform .1s;
  margin-bottom:6px;
}
.sum-discounts-btn:hover{border-color:#a78bfa;background:#faf5ff}
.sum-discounts-btn:active{transform:scale(.98)}
.sum-discounts-btn.open{
  border-color:#7c3aed;background:#f5f3ff;
  border-bottom-left-radius:0;border-bottom-right-radius:0;margin-bottom:0;
}
.sum-discounts-btn .sdb-icon{font-size:18px;flex-shrink:0}
.sum-discounts-btn .sdb-label{flex:1;min-width:0}
.sum-discounts-btn .sdb-badge{
  background:linear-gradient(135deg,#10b981,#059669);color:#fff;
  font-size:11px;font-weight:700;padding:3px 8px;border-radius:100px;
  white-space:nowrap;flex-shrink:0;
}
.sum-discounts-btn .sdb-arrow{
  color:#9ca3af;font-size:12px;transition:transform .2s;flex-shrink:0;
}
.sum-discounts-btn.open .sdb-arrow{transform:rotate(180deg)}

.sum-discounts-body{
  background:#faf5ff;border:1.5px solid #7c3aed;border-top:none;
  border-radius:0 0 12px 12px;padding:12px 14px;margin-bottom:14px;
  animation:slideDown .25s cubic-bezier(.4,0,.2,1);
}
@keyframes slideDown{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.sdb-header{
  font-size:12px;color:#6b7280;text-transform:uppercase;
  letter-spacing:.3px;font-weight:700;margin-bottom:10px;
}
.sdb-row{
  display:flex;justify-content:space-between;align-items:center;
  padding:8px 10px;background:#fff;border-radius:8px;margin-bottom:6px;font-size:13.5px;
}
.sdb-row:last-of-type{margin-bottom:0}
.sdb-row.best{background:#eef2ff;border:1.5px solid #c7d2fe}
.sdb-sum{color:#6b7280}
.sdb-row.best .sdb-sum{color:#4f46e5;font-weight:600}
.sdb-price{color:#4f46e5;font-weight:800;font-size:15px;white-space:nowrap}
.sdb-row.best .sdb-price{color:#4338ca}
.sdb-footer{margin-top:10px;font-size:11.5px;color:#9ca3af;line-height:1.4;text-align:center}

/* ========== ЦЕНА + ПЛАШКА СКИДОК В ОДНУ СТРОКУ ========== */
.price-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}
.price-row .p-price-lg{
  margin: 0;
  flex-shrink: 0;
}

/* Кнопка скидок внутри строки — компактнее */
.price-row .sum-discounts-btn{
  width: auto;
  margin-bottom: 0;
  padding: 10px 14px;
  font-size: 13px;
}
.price-row .sum-discounts-btn .sdb-label{
  display: none;  /* на узких экранах скрываем текст */
}
@media(min-width:420px){
  .price-row .sum-discounts-btn .sdb-label{
    display: inline;
  }
}
.price-row .sum-discounts-btn .sdb-badge{
  font-size: 11px;
  padding: 3px 7px;
}

/* Раскрытая таблица скидок — под строкой, на всю ширину */
.price-row .sum-discounts-body{
  width: 100%;
  margin-top: 8px;
  border-top: 1.5px solid #7c3aed;
  border-radius: 12px;
}

/* На очень узких экранах — переносим в столбик */
@media(max-width:360px){
  .price-row{
    justify-content: flex-start;
  }
  .price-row .sum-discounts-btn{
    width: 100%;
  }
}

/* ========== ЦЕНА + БЕЙДЖ СКИДКИ В ОДНУ СТРОКУ (КАРТОЧКА) ========== */
.price-row-card{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 2px;
}
.price-row-card .p-price{
  margin: 0;
  flex-shrink: 0;
}

/* Компактный бейдж */
.price-row-card .p-sum-badge{
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  letter-spacing: .2px;
  box-shadow: 0 2px 6px rgba(16,185,129,.3);
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
}

/* ========== БЕЙДЖ QTY-РЕЖИМА (от N шт) — ОРАНЖЕВЫЙ ========== */
.p-sum-badge.p-qty-badge{
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  box-shadow: 0 2px 6px rgba(234,88,12,.35);
}

/* ========== QTY-РЕЖИМ: ЦВЕТА КНОПКИ ========== */
.sum-discounts-btn.qty-tiers-btn .sdb-badge{
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  box-shadow: 0 2px 6px rgba(234,88,12,.3);
}
.sum-discounts-btn.qty-tiers-btn:hover{
  border-color: #f59e0b;
  background: #fffbeb;
}
.sum-discounts-btn.qty-tiers-btn.open{
  border-color: #f59e0b;
  background: #fffbeb;
}
.sum-discounts-btn.qty-tiers-btn .sdb-icon{
  color: #ea580c;
}
.qty-tiers-body{
  background: #fffbeb;
  border-color: #f59e0b;
}
.qty-tiers-body .sdb-row.best{
  background: #fef3c7;
  border-color: #fcd34d;
}
.qty-tiers-body .sdb-row.best .sdb-sum{
  color: #92400e;
}
.qty-tiers-body .sdb-row.best .sdb-price{
  color: #92400e;
}

/* ========== БАННЕР QTY-СКИДОК В КОРЗИНЕ ========== */
.cart-sum-banner.cart-qty-banner{
  background:linear-gradient(135deg,#fffbeb,#fef3c7);
  border-left-color:#f59e0b;
}
.cart-sum-banner.cart-qty-banner .csb-text b{color:#92400e}
.cart-sum-banner.cart-qty-banner .csb-text span{color:#a16207}

/* Бейдж «опт от N шт» в позиции */
.ci-qty-discount{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-top:4px;
  padding:3px 8px;
  background:linear-gradient(135deg,#f59e0b,#ea580c);
  color:#fff;
  font-size:10.5px;
  font-weight:700;
  border-radius:100px;
  letter-spacing:.2px;
  box-shadow:0 2px 6px rgba(234,88,12,.3);
  align-self:flex-start;
}
.ci-old-price{
  font-size:11px;
  color:#9ca3af;
  text-decoration:line-through;
  margin-left:4px;
  font-weight:500;
}

/* Строка скидки в итоговом блоке */
.cart-total-row.discount.qty{
  color:#ea580c;
}
.cart-total-row.discount.qty b{
  color:#ea580c;
  font-weight:800;
}

/* ========== БЕЙДЖ РОЗНИЦЫ (карточка товара) ========== */
.p-sum-badge.p-retail-badge{
  background: linear-gradient(135deg, #ec4899, #db2777);
  box-shadow: 0 2px 6px rgba(219,39,119,.35);
}

/* ============================================================
   ФИКС ВЁРСТКИ: РОЗНИЦА + СКИДКИ В КАРТОЧКЕ И МОДАЛКЕ
   Перебиваем все старые правила через !important
   ============================================================ */

/* ---------- КАРТОЧКА: цена + бейджи в один ряд ---------- */
.price-row-card{
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin: 6px 0 4px !important;
}
.price-row-card .p-price{
  margin: 0 !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  font-size: 17px !important;
  line-height: 1 !important;
}

/* Все бейджи в карточке — одинаково компактные, без сдвига */
.price-row-card .p-sum-badge{
  margin: 0 !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  padding: 3px 8px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  height: auto !important;
  align-self: center !important;
}

/* Розовый бейдж — вторичный, не как «вторая цена» */
.price-row-card .p-retail-badge{
  background: #fce7f3 !important;
  color: #be185d !important;
  box-shadow: none !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border: 1px solid #fbcfe8 !important;
}

/* ---------- МОДАЛКА: цена + кнопка скидок без разъезда ---------- */
.price-row{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  margin: 12px 0 14px !important;
}
.price-row .p-price-lg{
  margin: 0 !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  font-size: 28px !important;
  line-height: 1.1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.price-row .sum-discounts-btn{
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 0 1 auto !important;
  margin-bottom: 0 !important;
  padding: 10px 14px !important;
  font-size: 12.5px !important;
}
.price-row .sum-discounts-btn .sdb-label{
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* На очень узких экранах — кнопка под ценой */
@media (max-width: 380px){
  .price-row{ justify-content: flex-start !important; }
  .price-row .sum-discounts-btn{ width: 100% !important; }
}

/* ============================================================
   ОТДЕЛЬНЫЕ ЦЕНЫ — ПЛИТКИ
   ============================================================ */
.modal-card-special .special-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.special-tile{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.special-tile::before{
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

/* Иконка в кружке */
.special-tile .st-icon{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 20px;
  flex-shrink: 0;
}

.special-tile .st-text{
  flex: 1 1 auto;
  min-width: 0;
}
.special-tile .st-title{
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.2;
}
.special-tile .st-sub{
  font-size: 11.5px;
  color: #6b7280;
  font-weight: 500;
  margin-top: 2px;
  line-height: 1.2;
}

.special-tile .st-price{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}
.special-tile .st-price small{
  font-size: 13px;
  font-weight: 700;
  opacity: 0.7;
  margin-left: 2px;
}

/* ---------- Розница: розовая тема ---------- */
.special-tile-retail{
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}
.special-tile-retail::before{
  background: linear-gradient(180deg, #ec4899, #be185d);
}
.special-tile-retail .st-icon{
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: #fff;
  box-shadow: 0 3px 8px rgba(219, 39, 119, .25);
}
.special-tile-retail .st-price{
  color: #be185d;
}

/* ---------- Дроп: голубая тема ---------- */
.special-tile-drop{
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.special-tile-drop::before{
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}
.special-tile-drop .st-icon{
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, .25);
}
.special-tile-drop .st-price{
  color: #1d4ed8;
}

/* На узких экранах — цена на второй строке */
@media (max-width: 400px){
  .special-tile{
    flex-wrap: wrap;
  }
  .special-tile .st-price{
    width: 100%;
    text-align: right;
    margin-top: 4px;
  }
}

/* ========== SVG-ИКОНКИ В НИЖНЕЙ НАВИГАЦИИ ========== */
#bottomNav button{
  position: relative;
  transition: color .2s ease;
}
#bottomNav .icon{
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0;               /* убираем влияние font-size на SVG */
  margin-bottom: 2px;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
#bottomNav .icon svg{
  width: 22px;
  height: 22px;
  display: block;
  stroke-width: 2;
  transition: stroke .2s ease, filter .2s ease;
}
#bottomNav button.active .icon{
  transform: translateY(-2px);
}
#bottomNav button.active .icon svg{
  stroke: #4f46e5;
  filter: drop-shadow(0 2px 4px rgba(79,70,229,.25));
}
#bottomNav button:not(.active) .icon svg{
  stroke: #9ca3af;
}
#bottomNav button:active .icon{
  transform: scale(.86);
  transition: transform .1s ease;
}

/* Индикатор активного таба — маленькая точка под иконкой */
#bottomNav button.active::after{
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4f46e5;
  animation: navDotIn .3s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes navDotIn{
  from{ transform: translateX(-50%) scale(0); opacity: 0 }
  to  { transform: translateX(-50%) scale(1); opacity: 1 }
}

/* Пульс корзины при добавлении товара — вешаем класс .pulse при addToCart */
#bottomNav button[data-tab="cart"].pulse .icon{
  animation: cartPulse .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cartPulse{
  0%  { transform: scale(1) }
  40% { transform: scale(1.35) rotate(-8deg) }
  70% { transform: scale(.94) rotate(4deg) }
  100%{ transform: scale(1) }
}

/* Бейджи (счётчики) поверх иконок */
#bottomNav .badge{
  position: absolute;
  top: 6px;
  right: 50%;
  margin-right: -18px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
  animation: badgeIn .3s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes badgeIn{
  from{ transform: scale(0); opacity: 0 }
  to  { transform: scale(1); opacity: 1 }
}

/* На очень узких экранах — компактнее */
@media (max-width: 360px){
  #bottomNav .icon svg{ width: 20px; height: 20px; }
  #bottomNav .label{ font-size: 10px; }
}

/* ========== SVG-ИКОНКИ В ШАПКЕ ========== */
.search-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.search-icon svg{
  width: 18px;
  height: 18px;
  display: block;
  stroke: #9ca3af;
  transition: stroke .2s ease;
}
.search-wrap:focus-within .search-icon svg{
  stroke: #4f46e5;
}

.search-clear{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s ease;
}
.search-clear svg{
  width: 12px;
  height: 12px;
  stroke: #9ca3af;
  transition: stroke .2s ease;
}
.search-clear:hover{ background: #eef0f4; }
.search-clear:hover svg{ stroke: #4b5563; }

/* Иконка в кнопке "Новинки" */
.new-arrivals-btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.new-arrivals-btn .nai{
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.new-arrivals-btn:hover .nai{
  transform: rotate(-12deg) scale(1.1);
}

/* ========== ФИКС: крестик удаления в корзине ========== */
.ci-remove{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #f3f4f6;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #6b7280;
  transition: background .15s ease, color .15s ease;
}
.ci-remove:hover{
  background: #fee2e2;
  color: #dc2626;
}
.ci-remove:active{
  transform: scale(.9);
}
.ci-remove svg{
  width: 14px !important;
  height: 14px !important;
  stroke: currentColor !important;
  stroke-width: 2.5 !important;
  display: block;
}

@media (max-width: 480px){
  .ci-remove{
    width: 32px;
    height: 32px;
  }
  .ci-remove svg{
    width: 16px !important;
    height: 16px !important;
  }
}

/* ========== ИКОНКА В ЗАГОЛОВКЕ КАРТОЧКИ (Описание) ========== */
.modal-card-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-card-icon svg{
  width: 16px;
  height: 16px;
  stroke: currentColor;
  display: block;
}
