/* MAG 1.2.19: каталог, чат, стабильный первый кадр и UI-полировка. */

/* Лёгкий кант карточки: отделяет товар от фона, не превращая сетку в таблицу Excel. */
.product-card {
  position: relative;
  border: 1px solid rgba(255,255,255,.96) !important;
  box-shadow: 0 8px 24px rgba(25,35,60,.075), 0 0 0 1px rgba(58,74,110,.055) !important;
  overflow: hidden;
}
.product-card:hover {
  box-shadow: 0 13px 30px rgba(25,35,60,.11), 0 0 0 1px rgba(58,74,110,.075) !important;
}
.product-image { position: relative; overflow: hidden; }

/* Один статус Б/У: читаемая лента в ЛЕВОМ верхнем углу.
   Чёрно-жёлтые края не проходят через текст: в центре отдельная чистая жёлтая полоса. */
.gg-used-ribbon {
  position:absolute; z-index:7; top:18px; left:-54px; right:auto; width:190px; height:34px;
  display:flex; align-items:center; justify-content:center; transform:rotate(-45deg); transform-origin:center;
  color:#111; font-size:9px; line-height:1; font-weight:950; letter-spacing:.025em; text-transform:uppercase;
  background:linear-gradient(to bottom,
    #101010 0 6px, #ffd329 6px 10px,
    #ffd329 10px 24px,
    #ffd329 24px 28px, #101010 28px 34px);
  box-shadow:0 3px 10px rgba(0,0,0,.25); pointer-events:none; white-space:nowrap; overflow:hidden;
}
.gg-used-ribbon::before,.gg-used-ribbon::after{content:"";position:absolute;left:0;right:0;height:6px;
  background:repeating-linear-gradient(135deg,#101010 0 9px,#ffd329 9px 18px);}
.gg-used-ribbon::before{top:0}.gg-used-ribbon::after{bottom:0}.gg-used-ribbon{padding-top:0}
.product-used-note { display:none !important; }

/* Цвет платформы. JS дублирует определение класса, чтобы тема не терялась после динамического рендера. */
#category-page,
#catalog-template-page {
  --gg-platform-1: #4361ee;
  --gg-platform-2: #7b12d9;
  --gg-platform-soft: rgba(67,97,238,.10);
  --gg-platform-border: rgba(67,97,238,.24);
}
#category-page.gg-platform-xbox,
#catalog-template-page.gg-platform-xbox {
  --gg-platform-1: #168d3f;
  --gg-platform-2: #49c746;
  --gg-platform-soft: rgba(28,164,73,.10);
  --gg-platform-border: rgba(28,164,73,.25);
}
#category-page.gg-platform-nintendo,
#catalog-template-page.gg-platform-nintendo {
  --gg-platform-1: #df2626;
  --gg-platform-2: #ff5844;
  --gg-platform-soft: rgba(232,45,45,.10);
  --gg-platform-border: rgba(232,45,45,.24);
}
#category-page.gg-platform-playstation,
#catalog-template-page.gg-platform-playstation {
  --gg-platform-1: #2468db;
  --gg-platform-2: #5647dd;
  --gg-platform-soft: rgba(50,99,210,.10);
  --gg-platform-border: rgba(50,99,210,.24);
}
#category-page.gg-platform-playstation .category-hero,
#category-page.gg-platform-xbox .category-hero,
#category-page.gg-platform-nintendo .category-hero,
#catalog-template-page.gg-platform-playstation .category-hero,
#catalog-template-page.gg-platform-xbox .category-hero,
#catalog-template-page.gg-platform-nintendo .category-hero {
  background: radial-gradient(circle at 88% 20%, rgba(255,255,255,.17), transparent 29%),
              linear-gradient(125deg, var(--gg-platform-1) 0%, var(--gg-platform-2) 100%) !important;
}
.gg-category-type.is-active,
.catalog-filter-chip.is-active,
.catalog-filter-preset.active,
.catalog-filter-preset.is-active {
  background: linear-gradient(135deg, var(--gg-platform-1), var(--gg-platform-2)) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Desktop hero: мета справа в ТРИ РЯДА, одинаковая ширина и без обрезания текста. */
@media (min-width: 821px) {
  .category-hero { position:relative !important; padding-right:210px !important; min-height:136px; }
  .category-hero-meta {
    position:absolute !important; right:22px !important; top:50% !important; transform:translateY(-50%) !important;
    display:grid !important; grid-template-columns:1fr !important; grid-template-rows:repeat(3,auto) !important;
    width:170px !important; gap:7px !important; margin:0 !important;
  }
  .category-hero-chip {
    width:170px !important; min-width:170px !important; max-width:170px !important; box-sizing:border-box !important;
    min-height:30px !important; padding:6px 10px !important; display:flex !important; align-items:center !important; justify-content:center !important; gap:5px !important;
    overflow:visible !important; white-space:nowrap !important;
  }
  .category-hero-chip strong,.category-hero-chip span,.category-hero-chip b {
    overflow:visible !important; text-overflow:clip !important; white-space:nowrap !important; font-size:11px !important; line-height:1.15 !important;
  }

  /* Слева три пресета, справа две строки букв. Центруем буквенный блок по высоте пресетов. */
  .catalog-filter-alphabet {
    align-items: center !important;
    min-height: 94px;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
  .catalog-filter-presets {
    grid-row: 1 / span 3 !important;
    grid-template-rows: repeat(3, 28px) !important;
    gap: 4px !important;
    align-self: center !important;
  }
  .catalog-filter-alpha-en,
  .catalog-filter-alpha-ru {
    align-self: center !important;
    margin: 0 !important;
  }
  .catalog-filter-alpha-divider { align-self: center !important; margin: 0 !important; }
}

/* Избранное теперь выглядит как часть GamesGu, а не как случайный белый блок. */
#wishlist-page .wishlist-header,
.wishlist-page .wishlist-header {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 3vw, 30px) !important;
  border: 0 !important;
  border-radius: 20px !important;
  text-align: left !important;
  color: #fff !important;
  background: radial-gradient(circle at 88% 10%, rgba(255,255,255,.20), transparent 34%),
              linear-gradient(125deg, #4361ee 0%, #7b12d9 100%) !important;
  box-shadow: 0 14px 34px rgba(67,97,238,.18) !important;
}
#wishlist-page .wishlist-header h1,
.wishlist-page .wishlist-header h1 { color:#fff !important; margin:0 0 5px !important; }
#wishlist-page .wishlist-header p,
.wishlist-page .wishlist-header p { color:rgba(255,255,255,.82) !important; margin:0 !important; }
#wishlist-page .wishlist-count-badge,
.wishlist-page .wishlist-count-badge {
  display:inline-flex !important;
  margin-top:12px !important;
  color:#30416d !important;
  background:#fff !important;
  box-shadow:0 6px 16px rgba(17,30,66,.12) !important;
}

/* Главная: серверные подборки. */
.gg-home-live-section { margin: 26px 0 34px; }
.gg-home-live-section__head { display:flex; align-items:end; justify-content:space-between; gap:12px; margin:0 0 14px; }
.gg-home-live-section__head h2 { margin:0; font-size:clamp(22px,2.3vw,31px); color:#1d2944; }
.gg-home-live-section__head p { margin:4px 0 0; color:#72809a; font-size:13px; }
.gg-home-live-section__grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.gg-home-live-section__grid > .product-card { min-width:0; }

/* FAQ */
.gg-faq-shell { max-width:980px; margin:18px auto 70px; }
.gg-faq-crumbs { font-size:13px; color:#8290a7; margin-bottom:14px; }
.gg-faq-crumbs a { color:#4361ee; text-decoration:none; }
.gg-faq-head { display:flex; gap:15px; align-items:center; padding:22px; border-radius:20px; color:#fff; background:linear-gradient(125deg,#4361ee,#7b12d9); margin-bottom:16px; }
.gg-faq-head__icon { width:50px; height:50px; display:grid; place-items:center; flex:0 0 50px; border-radius:16px; background:rgba(255,255,255,.16); font-size:23px; }
.gg-faq-head h1 { margin:0 0 4px; color:#fff; font-size:clamp(24px,3vw,34px); }
.gg-faq-head p { margin:0; color:rgba(255,255,255,.84); }
.gg-faq-list { display:grid; gap:9px; }
.gg-faq-list details { border:1px solid #e1e7f0; border-radius:14px; background:#fff; box-shadow:0 5px 16px rgba(22,35,67,.04); }
.gg-faq-list summary { cursor:pointer; list-style:none; padding:16px 46px 16px 17px; position:relative; font-weight:800; color:#25324d; }
.gg-faq-list summary::-webkit-details-marker { display:none; }
.gg-faq-list summary::after { content:'+'; position:absolute; right:17px; top:50%; transform:translateY(-50%); font-size:24px; color:#4361ee; }
.gg-faq-list details[open] summary::after { content:'−'; }
.gg-faq-list details p { margin:0; padding:0 17px 17px; color:#5d6b83; line-height:1.55; }

/* Встроенный чат на базе существующего окна «Написать нам». */
#gg-contact-modal .gg-contact-quick { display:none !important; }
.gg-site-chat { margin:0 0 14px; border:1px solid #e3e9f3; border-radius:15px; overflow:hidden; background:#f7f9fc; }
.gg-site-chat__messages { max-height:260px; min-height:90px; overflow:auto; padding:12px; display:grid; gap:8px; }
.gg-site-chat__empty { color:#7a879d; font-size:13px; text-align:center; padding:22px 8px; }
.gg-site-chat__bubble { max-width:86%; padding:9px 11px; border-radius:13px; font-size:13px; line-height:1.4; white-space:pre-wrap; word-break:break-word; }
.gg-site-chat__bubble--customer { justify-self:end; color:#fff; background:linear-gradient(135deg,#4361ee,#711ee0); border-bottom-right-radius:4px; }
.gg-site-chat__bubble--admin { justify-self:start; color:#29354c; background:#fff; border:1px solid #dfe5ef; border-bottom-left-radius:4px; }
.gg-site-chat__bubble small { display:block; margin-top:4px; opacity:.7; font-size:10px; }
.gg-site-chat__status { padding:8px 11px; border-top:1px solid #e3e9f3; color:#7b8798; font-size:11px; }

@media (max-width: 820px) {
  .gg-used-ribbon { top:15px; left:-58px; right:auto; width:190px; height:32px; font-size:8px; }
  .gg-home-live-section { margin:20px 0 26px; }
  .gg-home-live-section__grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .gg-home-live-section__head { align-items:flex-start; }
  .gg-home-live-section__head h2 { font-size:21px; }
  .gg-faq-shell { margin-top:10px; padding-bottom:70px; }
  .gg-faq-head { padding:17px; border-radius:16px; align-items:flex-start; }
  .gg-faq-head__icon { width:42px; height:42px; flex-basis:42px; border-radius:13px; }
  #wishlist-page .wishlist-header,
  .wishlist-page .wishlist-header { padding:18px !important; border-radius:16px !important; }
}


/* ===== Chat v2 ===== */
.gg-site-chat__toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 11px;border-top:1px solid #e3e9f3;background:#fff}
.gg-site-chat__attach{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-size:12px;font-weight:800;color:#40516f}
.gg-site-chat__attach input{display:none}.gg-site-chat__files{font-size:11px;color:#6e7b90;max-width:62%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gg-site-chat__attachment{display:flex;align-items:center;gap:7px;margin-top:6px;padding:7px 8px;border-radius:9px;background:rgba(255,255,255,.16);color:inherit;text-decoration:none;font-size:11px}
.gg-site-chat__bubble--admin .gg-site-chat__attachment{background:#f3f6fb;color:#33415c}
.gg-site-chat__ticks{float:right;margin-left:8px;font-weight:800;letter-spacing:-2px}.gg-site-chat__ticks.is-read{color:#49d1ff}.gg-site-chat__blocked{color:#b42318;font-weight:800}
.gg-chat-launcher{position:fixed;right:18px;bottom:24px;z-index:10040;width:54px;height:54px;border:0;border-radius:50%;display:none;place-items:center;background:linear-gradient(135deg,#4361ee,#7b12d9);color:#fff;box-shadow:0 12px 30px rgba(55,62,140,.28);font-size:21px;cursor:pointer}
.gg-chat-launcher.is-hidden{display:none!important}
.gg-chat-launcher__badge{position:absolute;right:-3px;top:-4px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#ef4444;color:#fff;font:800 11px/20px Arial;text-align:center;box-shadow:0 0 0 2px #fff}
.gg-chat-launcher__badge[hidden]{display:none!important}
@media(max-width:820px){
  .gg-chat-launcher{display:grid;bottom:calc(82px + env(safe-area-inset-bottom,0px));right:14px}
  #gg-contact-modal .gg-ui-modal__dialog--contact{max-height:calc(100dvh - 92px);overflow:auto;margin-bottom:72px}
  .gg-site-chat__messages{max-height:34vh;min-height:120px}
}

/* ===== MAG 1.1.78: chat v3 / home groups / recommendations ===== */

/* Б/У в корзине. В самой карточке товара остаётся штатный компактный badge, без диагональной ленты. */
.cart-item-image,.mag-cart-thumb{position:relative}
.gg-cart-used-badge{
  position:absolute;left:5px;top:5px;z-index:4;display:inline-flex;align-items:center;justify-content:center;
  min-width:38px;height:22px;padding:0 8px;border-radius:7px;background:#ffd329;color:#121212;
  border:2px solid #171717;font-size:10px;font-weight:950;line-height:1;letter-spacing:.04em;box-shadow:0 3px 9px rgba(0,0,0,.18)
}

/* Крупные входы по платформам на главной. */
.gg-home-category-showcase{margin:26px 0 34px}
.gg-home-category-showcase__head{margin-bottom:14px}
.gg-home-category-showcase__head h2{margin:0;font-size:clamp(22px,2.3vw,31px);color:#1d2944}
.gg-home-category-showcase__head p{margin:4px 0 0;color:#72809a;font-size:13px}
.gg-home-category-showcase__grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.gg-home-category-card{
  position:relative;display:block;aspect-ratio:1/1;overflow:hidden;border-radius:18px;background:#eef2f8;
  border:1px solid rgba(44,63,103,.10);box-shadow:0 9px 25px rgba(25,35,60,.08);text-decoration:none!important;
  transition:transform .18s ease,box-shadow .18s ease
}
.gg-home-category-card:hover{transform:translateY(-3px);box-shadow:0 15px 32px rgba(25,35,60,.14)}
.gg-home-category-card img{width:100%;height:100%;display:block;object-fit:cover;transition:transform .25s ease}
.gg-home-category-card:hover img{transform:scale(1.025)}
.gg-home-category-card::after{content:"";position:absolute;left:0;right:0;bottom:0;height:48%;background:linear-gradient(to top,rgba(12,19,34,.84),rgba(12,19,34,0));pointer-events:none}
.gg-home-category-card>span{position:absolute;z-index:2;left:15px;right:15px;bottom:14px;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.26)}
.gg-home-category-card strong{display:block;font-size:17px;line-height:1.15;font-weight:900}
.gg-home-category-card small{display:block;margin-top:4px;font-size:11px;line-height:1.25;color:rgba(255,255,255,.84)}

/* Чат v3: темы внутри одной переписки. */
.gg-site-chat__casebar{display:flex;align-items:end;gap:8px;padding:9px 10px;border-bottom:1px solid #e3e9f3;background:#fff}
.gg-site-chat__casebar label{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;gap:3px;margin:0}
.gg-site-chat__casebar label>span{font-size:10px;font-weight:800;color:#7a879d;text-transform:uppercase;letter-spacing:.035em}
.gg-site-chat__casebar select{width:100%;min-height:34px;padding:5px 28px 5px 8px;border:1px solid #dce3ee;border-radius:8px;background:#fff;color:#33415c;font-size:12px}
.gg-site-chat__casebar button{flex:0 0 auto;min-height:34px;padding:5px 10px;border:1px solid #d8e0ec;border-radius:8px;background:#f7f9fc;color:#40516f;font-size:11px;font-weight:850;cursor:pointer}
.gg-site-chat__casebar button:hover{background:#eef2f8}

/* На ПК чат виден всегда справа. На телефоне остаётся компактной круглой кнопкой. */
.gg-chat-launcher{
  display:flex!important;align-items:center;justify-content:center;gap:8px;width:auto!important;min-width:148px;height:50px!important;
  padding:0 17px!important;border-radius:25px!important;font-size:17px!important;font-weight:850;line-height:1;white-space:nowrap
}
.gg-chat-launcher__label{font-size:13px;font-weight:850;letter-spacing:.01em}
.gg-chat-launcher.is-hidden{display:none!important}
.gg-chat-launcher.gg-has-unread{box-shadow:0 13px 34px rgba(55,62,140,.34),0 0 0 4px rgba(67,97,238,.10)}

/* Всплывающий ответ менеджера. */
.gg-chat-reply-toast{
  position:fixed;right:18px;bottom:86px;z-index:10045;display:grid;grid-template-columns:38px minmax(0,1fr) 12px;align-items:center;gap:10px;
  width:min(350px,calc(100vw - 36px));padding:11px 12px;border:1px solid #dde4ef;border-radius:14px;background:#fff;color:#25324d;
  box-shadow:0 16px 45px rgba(22,35,67,.20);text-align:left;cursor:pointer;opacity:0;transform:translateY(10px);transition:opacity .20s ease,transform .20s ease
}
.gg-chat-reply-toast.is-visible{opacity:1;transform:translateY(0)}
.gg-chat-reply-toast__icon{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,#4361ee,#7b12d9);color:#fff;font-size:17px}
.gg-chat-reply-toast strong{display:block;font-size:13px;line-height:1.2}
.gg-chat-reply-toast small{display:-webkit-box;margin-top:3px;color:#6a778c;font-size:11px;line-height:1.3;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.gg-chat-reply-toast>.fa-chevron-right{color:#9aa6b8;font-size:10px}

/* Нижняя лента рекомендаций. Цена недавних товаров намеренно не кэшируется. */
.gg-bottom-recs{max-width:1320px;margin:24px auto 38px;padding:0 18px}
.gg-bottom-recs__section{margin:22px 0}
.gg-bottom-recs__head{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:11px}
.gg-bottom-recs__head h2{margin:0;color:#1d2944;font-size:clamp(19px,2vw,25px)}
.gg-bottom-recs__head p{margin:3px 0 0;color:#7b8798;font-size:11px}
.gg-bottom-recs__rail{
  display:grid;grid-auto-flow:column;grid-auto-columns:minmax(185px,215px);grid-template-rows:1fr;gap:11px;overflow-x:auto;overflow-y:hidden;
  padding:2px 2px 10px;scroll-snap-type:x proximity;scrollbar-width:thin;overscroll-behavior-inline:contain
}
.gg-bottom-recs__rail>.product-card,.gg-bottom-recs__rail>.gg-recent-card{scroll-snap-align:start;min-width:0}
.gg-recent-card{display:grid;grid-template-rows:126px auto;overflow:hidden;border:1px solid #e3e8f0;border-radius:13px;background:#fff;color:#26334d;text-decoration:none!important;box-shadow:0 5px 16px rgba(25,35,60,.055)}
.gg-recent-card img,.gg-recent-card__placeholder{width:100%;height:126px;display:grid;place-items:center;object-fit:contain;background:#f7f9fc;color:#9ca8ba;font-size:31px}
.gg-recent-card>span:last-child{padding:9px 10px;display:-webkit-box;min-height:49px;font-size:11px;line-height:1.35;font-weight:750;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}

@media(max-width:980px){
  .gg-home-category-showcase__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:820px){
  .gg-home-category-showcase{margin:20px 0 26px}
  .gg-home-category-showcase__grid{gap:9px}
  .gg-home-category-card{border-radius:14px}
  .gg-home-category-card>span{left:11px;right:11px;bottom:10px}
  .gg-home-category-card strong{font-size:14px}.gg-home-category-card small{font-size:9px}
  .gg-site-chat__casebar{align-items:stretch;flex-wrap:wrap}.gg-site-chat__casebar label{flex-basis:100%}.gg-site-chat__casebar button{margin-left:auto}
  .gg-chat-launcher{display:grid!important;width:54px!important;min-width:54px!important;height:54px!important;padding:0!important;border-radius:50%!important;bottom:calc(82px + env(safe-area-inset-bottom,0px));right:14px}
  .gg-chat-launcher__label{display:none}
  .gg-chat-reply-toast{right:12px;bottom:calc(146px + env(safe-area-inset-bottom,0px));width:calc(100vw - 24px)}
  .gg-bottom-recs{margin:18px auto 94px;padding:0 12px}
  .gg-bottom-recs__rail{grid-auto-columns:minmax(154px,174px);gap:8px}
  .gg-bottom-recs__head h2{font-size:19px}
  .gg-recent-card{grid-template-rows:105px auto}.gg-recent-card img,.gg-recent-card__placeholder{height:105px}
}

/* MAG 1.1.78: прозрачность автоматических подборок и управление локальной историей. */
.gg-recommendation-disclosure{flex-basis:100%;font-size:11px;color:#8b95a7}
.gg-recommendation-disclosure a,.gg-bottom-recs__disclosure a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.gg-bottom-recs__clear{padding:6px 9px;border:1px solid #dce3ef;border-radius:9px;background:#fff;color:#66758d;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap}
.gg-bottom-recs__clear:hover{border-color:#b7c5e0;color:#3655d6;background:#f7f9ff}
.gg-bottom-recs__disclosure{margin:7px 0 0;color:#8792a4;font-size:10px;line-height:1.45;text-align:right}
@media(max-width:820px){.gg-bottom-recs__head{align-items:flex-start}.gg-bottom-recs__clear{margin-top:1px}.gg-bottom-recs__disclosure{text-align:left}}


/* ===== MAG 1.1.79: донастройка подборок, корзины и большой витрины ===== */
.gg-home-category-showcase{margin:28px 0 36px}
.gg-home-category-showcase__grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.gg-home-category-card{aspect-ratio:4/5}
.gg-home-category-card strong{font-size:16px}
.gg-home-category-card small{font-size:11px}
@media(max-width:1240px){.gg-home-category-showcase__grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:980px){.gg-home-category-showcase__grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){.gg-home-category-showcase__grid{grid-template-columns:repeat(2,minmax(0,1fr))}.gg-home-category-card{aspect-ratio:1/1.06}}

.gg-bottom-recs{max-width:min(1780px,calc(100vw - 22px));margin:26px auto 40px;padding:0 16px}
.gg-bottom-recs__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 22px;align-items:start}
.gg-bottom-recs__section{margin:0;padding:16px 16px 12px;border:1px solid #e2e8f2;border-radius:18px;background:#fff;box-shadow:0 8px 22px rgba(25,35,60,.06)}
.gg-bottom-recs__section--full{grid-column:1/-1}
.gg-bottom-recs__head{margin-bottom:12px}
.gg-bottom-recs__titlebox{min-width:0}
.gg-bottom-recs__head-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.gg-bottom-recs__nav{display:flex;align-items:center;gap:6px}
.gg-bottom-recs__nav-btn{width:34px;height:34px;border:1px solid #d7deea;border-radius:50%;background:#fff;color:#33415c;font-size:22px;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:0 4px 12px rgba(25,35,60,.06)}
.gg-bottom-recs__nav-btn:hover:not(:disabled){border-color:#b9c7e3;color:#2e52df;background:#f7f9ff}
.gg-bottom-recs__nav-btn:disabled{opacity:.42;cursor:default}
.gg-bottom-recs__rail{grid-auto-columns:minmax(178px,220px)}
.gg-bottom-recs__section--products .gg-bottom-recs__rail{grid-auto-columns:minmax(210px,260px)}
.gg-recent-card{grid-template-rows:auto auto;min-height:100%}
.gg-recent-card__media{position:relative;display:block}
.gg-recent-card img,.gg-recent-card__placeholder{height:136px}
.gg-recent-card__title{padding:10px 11px 12px;display:-webkit-box;min-height:63px;font-size:12px;line-height:1.38;font-weight:760;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.gg-recent-card__used{position:absolute;left:6px;top:6px;z-index:2;display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:22px;padding:0 8px;border-radius:7px;background:#ffd329;color:#121212;border:2px solid #171717;font-size:10px;font-weight:950;line-height:1;letter-spacing:.04em;box-shadow:0 3px 9px rgba(0,0,0,.18)}
.gg-bottom-recs .product-card h3,
.gg-bottom-recs .product-card .product-title,
.gg-bottom-recs .product-card .product-name,
.gg-bottom-recs .product-card .product-card-title,
.gg-bottom-recs .product-card .product-card-name{display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden;white-space:normal!important;min-height:4.9em;line-height:1.25}
.gg-bottom-recs__disclosure{margin:10px 4px 0;color:#8792a4;font-size:10px;line-height:1.45;text-align:right}

#mag-cart-page .gg-cart-one-click-hidden{display:none!important}
#mag-cart-page .mag-cart-checkout,
#mag-cart-page .mag-cart-actions,
#mag-cart-page .mag-cart-summary-actions,
#mag-cart-page .cart-page__actions,
#mag-cart-page .cart-footer-actions{display:flex;flex-wrap:wrap;gap:10px}
#mag-cart-page .mag-cart-checkout>*,
#mag-cart-page .mag-cart-actions>*,
#mag-cart-page .mag-cart-summary-actions>*,
#mag-cart-page .cart-page__actions>*,
#mag-cart-page .cart-footer-actions>*{flex:1 1 220px;min-width:0}
#mag-cart-page .mag-cart-item-title,
#mag-cart-page .mag-cart-title,
#mag-cart-page .mag-cart-name,
#mag-cart-page .cart-item-title,
#mag-cart-page .cart-item-name,
#mag-cart-page .cart-item-info a,
#mag-cart-page .cart-item-info strong{display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden;white-space:normal!important;line-height:1.35;max-height:none}

@media(max-width:980px){
  .gg-bottom-recs__grid{grid-template-columns:minmax(0,1fr)}
  .gg-bottom-recs__section--full{grid-column:auto}
}
@media(max-width:820px){
  .gg-bottom-recs{margin:18px auto 96px;padding:0 10px}
  .gg-bottom-recs__section{padding:14px 12px 10px;border-radius:16px}
  .gg-bottom-recs__head{align-items:center;justify-content:center;text-align:center;flex-direction:column}
  .gg-bottom-recs__head p{margin-top:4px}
  .gg-bottom-recs__head-tools{justify-content:center}
  .gg-bottom-recs__rail{grid-auto-columns:minmax(160px,176px)}
  .gg-bottom-recs__section--products .gg-bottom-recs__rail{grid-auto-columns:minmax(182px,198px)}
  .gg-bottom-recs__nav-btn{width:32px;height:32px;font-size:20px}
  .gg-bottom-recs__disclosure{text-align:left}
  .gg-recent-card img,.gg-recent-card__placeholder{height:112px}
  .gg-recent-card__title{min-height:58px}
}


/* ===== MAG 1.1.80: выравнивание подборок, главной и пустых кнопок категорий ===== */
.gg-bottom-recs__grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
.gg-bottom-recs__section{height:100%}
.gg-bottom-recs__head{position:relative;justify-content:center;text-align:center;min-height:54px}
.gg-bottom-recs__titlebox{margin:0 auto;text-align:center}
.gg-bottom-recs__head-tools{position:absolute;right:0;top:0;justify-content:flex-end}
.gg-bottom-recs__head h2,.gg-bottom-recs__head p{text-align:center}
.gg-bottom-recs__section--recent .gg-bottom-recs__rail{grid-auto-columns:minmax(176px,205px)}
.gg-bottom-recs__section--products .gg-bottom-recs__rail{grid-auto-columns:minmax(205px,240px)}
.gg-bottom-recs__section--full{grid-column:1/-1}
.gg-bottom-recs__grid>.gg-bottom-recs__section:only-child{grid-column:1/-1}

.gg-home-category-showcase__head,
.gg-home-live-section__head{display:flex;justify-content:center;align-items:center;text-align:center;padding:18px 20px;border-radius:18px;background:linear-gradient(135deg,#2d5eff 0%,#5a63e8 52%,#7766f2 100%);box-shadow:0 10px 28px rgba(43,79,220,.18);margin-bottom:16px}
.gg-home-category-showcase__head h2,
.gg-home-live-section__head h2{margin:0;color:#fff;font-size:clamp(24px,2.4vw,34px)}
.gg-home-category-showcase__head p,
.gg-home-live-section__head p{margin:8px 0 0;color:rgba(255,255,255,.92);font-size:15px;font-weight:600}
.gg-home-category-showcase__grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px}
.gg-home-category-card{aspect-ratio:1/1.03}
.gg-home-category-card span{text-align:center}

.gg-category-type.is-empty{background:#f1f3f7!important;border-color:#d8dde7!important;color:#9aa4b6!important;box-shadow:none!important;pointer-events:none;cursor:not-allowed;filter:saturate(.15)}
.gg-category-type.is-empty .gg-category-type-hint,
.gg-category-type.is-empty i,
.gg-category-type.is-empty .gg-category-type-label{color:#9aa4b6!important}

@media(max-width:1120px){
  .gg-bottom-recs__head{padding-right:90px}
}
@media(max-width:980px){
  .gg-bottom-recs__grid{grid-template-columns:minmax(0,1fr)}
  .gg-bottom-recs__head-tools{position:static;justify-content:center;margin-top:8px}
  .gg-home-category-showcase__grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:820px){
  .gg-bottom-recs__head{min-height:auto;padding-right:0}
  .gg-home-category-showcase__head,
  .gg-home-live-section__head{padding:16px 14px;border-radius:16px}
  .gg-home-category-showcase__head p,
  .gg-home-live-section__head p{font-size:14px}
}


/* ===== MAG 1.1.84: одинаковые карточки, мобильная читаемость и возврат ===== */
/* «Недавно смотрели» теперь использует серверные product-card, как и «Похожие товары». */
.gg-bottom-recs__section--recent .gg-bottom-recs__rail,
.gg-bottom-recs__section--products .gg-bottom-recs__rail{
  grid-auto-columns:minmax(220px,248px);
}
.gg-bottom-recs .product-card{
  display:flex!important;
  flex-direction:column;
  height:430px!important;
  min-height:430px!important;
  overflow:hidden;
}
.gg-bottom-recs .product-card .product-image{
  flex:0 0 235px;
  height:235px!important;
  min-height:235px;
  overflow:hidden;
}
.gg-bottom-recs .product-card .product-image img{
  width:100%;height:100%;object-fit:contain;
}
.gg-bottom-recs .product-card .product-content{
  display:flex!important;
  flex:1 1 auto;
  min-height:0;
  flex-direction:column;
  padding:12px 13px 13px!important;
}
.gg-bottom-recs .product-card .product-title{
  min-height:82px!important;
  max-height:none!important;
  overflow:visible!important;
  margin:0 0 8px!important;
}
.gg-bottom-recs .product-card .product-title a,
.gg-bottom-recs .product-card h3,
.gg-bottom-recs .product-card .product-name,
.gg-bottom-recs .product-card .product-card-title,
.gg-bottom-recs .product-card .product-card-name{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:5!important;
  white-space:normal!important;
  overflow:hidden!important;
  min-height:0!important;
  line-height:1.28!important;
}
.gg-bottom-recs .product-card .product-price{margin-top:auto!important}

/* Резервная карточка истории на случай временной недоступности карточного API. */
.gg-recent-card{
  display:flex!important;flex-direction:column;height:430px!important;min-height:430px!important;
  border:1px solid #e3e8f0;border-radius:13px;background:#fff;overflow:hidden;
}
.gg-recent-card__media{flex:0 0 235px;height:235px!important;display:block;position:relative;background:#f7f9fc}
.gg-recent-card__media img,.gg-recent-card__placeholder{height:235px!important;width:100%;object-fit:contain}
.gg-recent-card__title{padding:12px 13px!important;font-size:13px!important;line-height:1.32!important;-webkit-line-clamp:5!important;min-height:0!important}

/* Заголовок основного блока наличия на главной в том же визуальном языке, что и остальные секции. */
.gg-home-stock-heading{
  display:flex!important;flex-direction:column;justify-content:center;align-items:center;text-align:center;
  margin:28px 0 16px!important;padding:18px 20px!important;border-radius:18px;
  background:linear-gradient(135deg,#2d5eff 0%,#5a63e8 52%,#7766f2 100%);
  color:#fff!important;box-shadow:0 10px 28px rgba(43,79,220,.18);
  font-size:clamp(24px,2.4vw,34px)!important;line-height:1.15!important;
}
.gg-home-stock-heading small{display:block;margin-top:8px;color:rgba(255,255,255,.92);font-size:15px;font-weight:600;line-height:1.3}

/* Удаляем кнопку «Купить в 1 клик» во всех вариантах корзины. */
.gg-cart-one-click-hidden{display:none!important}

/* Явная кнопка возврата в карточке товара. */
.gg-product-backbar{width:100%;display:flex;justify-content:flex-start;margin:0 0 14px;padding:0 2px}
.gg-product-back{
  display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:8px 14px;border:1px solid #d8e1ef;border-radius:11px;
  background:#fff;color:#33415c;font-size:13px;font-weight:800;cursor:pointer;box-shadow:0 5px 15px rgba(25,35,60,.06);
}
.gg-product-back:hover{border-color:#b9c8e6;background:#f6f8ff;color:#3155d8}

@media(max-width:820px){
  .gg-bottom-recs__section--recent .gg-bottom-recs__rail,
  .gg-bottom-recs__section--products .gg-bottom-recs__rail{grid-auto-columns:minmax(205px,220px)}
  .gg-bottom-recs .product-card,.gg-recent-card{height:390px!important;min-height:390px!important}
  .gg-bottom-recs .product-card .product-image,.gg-recent-card__media{flex-basis:190px;height:190px!important;min-height:190px}
  .gg-bottom-recs .product-card .product-image img,.gg-recent-card__media img,.gg-recent-card__placeholder{height:190px!important}
  .gg-bottom-recs .product-card .product-content{padding:11px 11px 12px!important}
  .gg-bottom-recs .product-card .product-title{min-height:92px!important}
  .gg-bottom-recs .product-card .product-title a{font-size:12px!important;-webkit-line-clamp:6!important;line-height:1.3!important}
  .gg-recent-card__title{font-size:12px!important;-webkit-line-clamp:6!important}
  .gg-home-stock-heading{margin:20px 0 13px!important;padding:16px 14px!important;border-radius:16px;font-size:23px!important}
  .gg-home-stock-heading small{font-size:14px}
  .gg-product-backbar{position:relative;z-index:4;margin-bottom:10px;padding:0}
  .gg-product-back{min-height:42px;padding:9px 14px;font-size:14px;border-radius:12px}
}


/* ===== MAG 1.1.85: mobile cart quick-click hotfix ===== */
/*
   В старой модальной корзине:
   - .checkout-btn.primary = «Оформить заказ»;
   - .checkout-btn.secondary без data-mag-cart-open = «Купить в 1 клик»;
   - .checkout-btn.secondary[data-mag-cart-open] = «Открыть всю корзину».
   Убираем только быстрый клик, не затрагивая переход в полную корзину.
*/
#cart-modal .cart-summary .checkout-buttons > .checkout-btn.secondary:not([data-mag-cart-open]){
  display:none!important;
}

@media(max-width:820px){
  /* После удаления лишней кнопки две полезные кнопки помещаются в одну строку. */
  #cart-modal .cart-summary .checkout-buttons{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:8px!important;
    width:100%!important;
    margin:0!important;
  }
  #cart-modal .cart-summary .checkout-buttons > .checkout-btn{
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    margin:0!important;
    padding:9px 8px!important;
    font-size:11px!important;
    line-height:1.15!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    white-space:normal!important;
  }

  /* Нижнее мобильное меню фиксированное, поэтому оставляем под кнопками реальное место. */
  #cart-modal .cart-summary{
    padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))!important;
  }
  #cart-modal .cart-body{
    padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))!important;
  }
}

@media(max-width:380px){
  /* На совсем узких экранах две полезные кнопки лучше ставить друг под другом. */
  #cart-modal .cart-summary .checkout-buttons{
    grid-template-columns:1fr!important;
  }
  #cart-modal .cart-summary{
    padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))!important;
  }
}

/* ===== MAG 1.2.05: резервная модалка внутреннего чата для legacy-страниц ===== */
.gg-chat-created-modal{
  position:fixed;inset:0;z-index:12000;display:none;align-items:center;justify-content:center;padding:18px;
  background:rgba(10,16,30,.67);backdrop-filter:blur(6px)
}
.gg-chat-created-modal.is-open,.gg-chat-created-modal.active{display:flex}
.gg-chat-created-modal .gg-ui-modal__dialog{
  position:relative;width:min(100%,610px);max-height:calc(100dvh - 36px);overflow-y:auto;padding:24px;
  border:1px solid #e2e7f0;border-radius:20px;background:#fff;box-shadow:0 26px 70px rgba(5,15,40,.29)
}
.gg-chat-created-modal .gg-ui-modal__close{
  position:absolute;right:14px;top:13px;width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:50%;
  color:#5b6475;background:#f1f4f8;font-size:22px;cursor:pointer
}
.gg-chat-created-modal .gg-ui-modal__head{display:flex;align-items:center;gap:12px;padding-right:36px;margin-bottom:20px}
.gg-chat-created-modal .gg-ui-modal__head h3{margin:0 0 3px;color:#172033;font-size:22px;font-weight:850}
.gg-chat-created-modal .gg-ui-modal__head p{margin:0;color:#7b8597;font-size:12px}
.gg-chat-created-modal .gg-ui-modal__icon{
  flex:0 0 46px;width:46px;height:46px;display:grid;place-items:center;border-radius:13px;color:#fff;
  background:linear-gradient(135deg,#20c76b,#10a957);box-shadow:0 8px 17px rgba(20,175,91,.18);font-size:18px
}
.gg-chat-created-modal .gg-ui-form{display:flex;flex-direction:column;gap:12px}
.gg-chat-created-modal .gg-ui-form__grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.gg-chat-created-modal .gg-ui-form label{display:flex;flex-direction:column;gap:6px;color:#4c5870;font-size:12px;font-weight:700}
.gg-chat-created-modal .gg-ui-form input,
.gg-chat-created-modal .gg-ui-form select,
.gg-chat-created-modal .gg-ui-form textarea{
  width:100%;min-height:43px;padding:10px 12px;border:1px solid #dce3ee;border-radius:10px;outline:none;
  color:#1f2937;background:#fbfcff;font:inherit;font-size:13px;box-sizing:border-box
}
.gg-chat-created-modal .gg-ui-form textarea{min-height:94px;resize:vertical}
.gg-chat-created-modal .gg-ui-form__submit{
  min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:10px;
  color:#fff;background:linear-gradient(135deg,#4361ee,#711bd2);font-size:13px;font-weight:800;cursor:pointer
}
.gg-chat-created-modal .gg-ui-form__status{
  display:none;padding:9px 11px;border-radius:9px;color:#657188;background:#f3f6fb;font-size:11px;line-height:1.45
}
.gg-chat-created-modal .gg-ui-form__status.is-visible{display:block}
@media(max-width:820px){
  .gg-chat-created-modal{align-items:flex-end;padding:10px 10px calc(82px + env(safe-area-inset-bottom,0px))}
  .gg-chat-created-modal .gg-ui-modal__dialog{max-height:calc(100dvh - 104px);padding:18px;border-radius:18px}
  .gg-chat-created-modal .gg-ui-form__grid{grid-template-columns:1fr}
}


/* MAG 1.2.06: после появления переписки оставляем компактный composer, а не повторяем анкету клиента. */
#gg-contact-form.gg-site-chat--conversation .gg-site-chat__identity-grid,
#gg-contact-form.gg-site-chat--conversation .gg-site-chat__topic-field{display:none!important}
#gg-contact-form.gg-site-chat--new-case .gg-site-chat__identity-grid,
#gg-contact-form.gg-site-chat--new-case .gg-site-chat__topic-field{display:grid}
#gg-contact-form.gg-site-chat--conversation textarea[name="message"]{min-height:78px}
#gg-contact-form.gg-site-chat--conversation .gg-ui-form__submit{margin-top:0}
.gg-account-attention{display:inline-flex;align-items:center;justify-content:center;min-width:17px;height:17px;margin-left:5px;padding:0 4px;border-radius:999px;background:#ff3b30;color:#fff;font-size:10px;font-weight:900;line-height:1;vertical-align:middle}
.mag-order-ready-notice{display:flex;flex-direction:column;gap:3px;margin:0 0 14px;padding:12px 14px;border:1px solid #b7e4c7;border-radius:12px;background:#f0fff4;color:#176b3a}
.mag-shop-order-row.is-ready{border-color:#7bd89c!important;background:#f5fff8!important;box-shadow:0 0 0 2px rgba(34,197,94,.08)}

/* MAG 1.2.07: lifecycle заказа, гостевое подтверждение e-mail и безопасная выдача. */
.mag-orders-attention-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;margin-left:5px;padding:0 5px;border-radius:999px;background:#ff3b30;color:#fff;font-size:10px;font-weight:900;line-height:1;vertical-align:middle}
.mag-orders-attention-badge[hidden]{display:none!important}
.mag-guest-email-verify{margin:14px 0 0;padding:14px;border:1px solid #cfd8ff;border-radius:12px;background:#f7f9ff}
.mag-guest-email-verify p{margin:6px 0 10px;color:#59657a;font-size:13px}
.mag-guest-email-code-wrap{margin-top:12px;padding-top:12px;border-top:1px solid #dfe5f4}
.mag-guest-email-code-wrap.is-verified{border-color:#b7e4c7;background:#f5fff8;border-radius:10px;padding:12px}
.mag-guest-verify-actions,.mag-order-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}
.mag-guest-verify-status{margin-top:9px;font-size:13px;color:#176b3a;font-weight:700}
.mag-guest-verify-status.is-error{color:#b42318}
.mag-shop-btn-secondary{background:#eef2ff!important;color:#3346c8!important;border:1px solid #c9d2ff!important;box-shadow:none!important}
.mag-shop-link-btn{appearance:none;border:0;background:transparent;padding:7px 2px;color:#4056e8;font:inherit;font-weight:700;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.mag-shop-link-btn.is-danger{color:#b42318}
.mag-shop-link-btn:disabled,.mag-shop-btn:disabled{opacity:.55;cursor:not-allowed}
.mag-order-pickup{margin:14px 0;padding:14px;border:1px solid #dce3ef;border-radius:13px;background:#fbfcff}
.mag-order-pickup h3{margin:0 0 8px;font-size:17px}
.mag-order-pickup-deadline{margin:10px 0 0;padding:9px 10px;border-radius:9px;background:#fff6dd;color:#745400}
.mag-order-code{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin:12px 0;padding:13px 15px;border-radius:12px;background:#eefcf4;border:1px solid #b8e6c9}
.mag-order-code>span{font-size:12px;color:#56715e;text-transform:uppercase;letter-spacing:.04em;font-weight:800}
.mag-order-code>strong{font-size:30px;line-height:1;letter-spacing:.16em;color:#176b3a;font-variant-numeric:tabular-nums}
.mag-order-code>small{color:#56715e}
@media(max-width:640px){.mag-guest-verify-actions,.mag-order-actions{align-items:stretch;flex-direction:column}.mag-guest-verify-actions>* ,.mag-order-actions>*{width:100%;text-align:center}.mag-order-code>strong{font-size:27px}}

/* MAG 1.2.12: переход в корзину, непросмотренные события заказов и завершённые покупки. */
.gg-go-cart-link{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 12px;border:1px solid #cfd8ff;border-radius:9px;background:#f7f9ff;color:#3346c8!important;font-size:12px;font-weight:800;text-decoration:none!important;white-space:nowrap}
.gg-go-cart-link:hover{background:#eef2ff;color:#2439b8!important}
.product-card .product-actions{gap:8px;flex-wrap:wrap}
.product-card .product-actions .gg-go-cart-link{width:100%}
.gg-go-cart-link--detail{margin-left:8px;vertical-align:middle}
.mag-shop-agree.is-account-consent{align-items:flex-start;background:#f3fff7;border-color:#b7e4c7}
.mag-account-consent-note{display:block;margin-top:5px;color:#247044;font-size:12px;font-weight:700;line-height:1.35}
.mag-shop-order-row.is-closed{background:#f4f5f7!important;border-color:#e0e3e8!important;color:#737b88!important;box-shadow:none!important}
.mag-shop-order-row.is-closed strong,.mag-shop-order-row.is-closed small{color:inherit!important}
.mag-shop-order-row.is-action{border-color:#f0bf4c!important;background:#fff9e8!important;box-shadow:0 0 0 2px rgba(240,191,76,.11)}
.mag-shop-order-row.is-shipped{border-color:#82b4f8!important;background:#f2f7ff!important}
.mag-order-event-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;margin-left:7px;padding:0 5px;border-radius:999px;background:#ff3b30;color:#fff;font-size:10px;font-weight:900;line-height:1;vertical-align:middle}
.mag-order-closed-notice{margin:12px 0;padding:12px 14px;border:1px solid #d8dde6;border-radius:11px;background:#f5f6f8;color:#586171}
.mag-order-message,.mag-order-return{margin:14px 0;padding:14px;border:1px solid #dce3ef;border-radius:13px;background:#fbfcff}
.mag-order-message textarea,.mag-order-return textarea,.mag-order-return select{width:100%;box-sizing:border-box;margin-top:7px;padding:10px 12px;border:1px solid #cfd8e6;border-radius:9px;background:#fff;font:inherit}
.mag-order-message textarea,.mag-order-return textarea{min-height:82px;resize:vertical}
.mag-order-return__status{margin:8px 0;padding:10px 12px;border-radius:9px;background:#f0f5ff;color:#344663}
@media(max-width:640px){.gg-go-cart-link--detail{display:flex;margin:8px 0 0}.product-card .product-actions{display:flex}.mag-order-message,.mag-order-return{padding:12px}}

/* ===== MAG 1.2.13: гостевой заказ, корзина, избранное и переписка ===== */
/* Гостевой заказ показываем отдельной кнопкой. Доступ определяется receipt-token браузера, не IP. */
.gg-guest-order-link{
  display:inline-flex;align-items:center;gap:7px;position:relative;min-height:38px;padding:8px 12px;
  border:1px solid rgba(255,255,255,.28);border-radius:10px;color:#fff!important;text-decoration:none!important;
  font-weight:800;font-size:12px;background:rgba(255,255,255,.10)
}
.gg-guest-order-link:hover{background:rgba(255,255,255,.18)}
.gg-guest-order-link .gg-account-attention{position:absolute;right:-5px;top:-6px}

/* Избранное: заголовок по центру, счётчик не толкает текст вниз. */
#wishlist-page .wishlist-header,
.wishlist-page .wishlist-header{position:relative!important;text-align:center!important;padding-left:110px!important;padding-right:110px!important}
#wishlist-page .wishlist-header h1,
.wishlist-page .wishlist-header h1,
#wishlist-page .wishlist-header p,
.wishlist-page .wishlist-header p{text-align:center!important}
#wishlist-page .wishlist-count-badge,
.wishlist-page .wishlist-count-badge{
  position:absolute!important;right:24px!important;top:50%!important;transform:translateY(-50%)!important;
  margin:0!important;white-space:nowrap
}

/* Состояние «в корзине»: одна аккуратная строка вместо второй кнопки под первой. */
.product-actions.gg-in-cart-actions{display:grid!important;grid-template-columns:minmax(0,1.55fr) minmax(96px,.75fr)!important;gap:7px!important}
.product-actions.gg-in-cart-actions .gg-go-cart-link{
  display:flex!important;align-items:center;justify-content:center;min-height:46px;padding:9px 10px;border-radius:10px;
  background:linear-gradient(135deg,#4361ee,#3855d8);color:#fff!important;font-size:12px;font-weight:900;text-decoration:none!important
}
.product-actions.gg-in-cart-actions .add-to-cart{
  min-height:46px!important;margin:0!important;padding:8px 9px!important;border:1px solid #d7dfec!important;
  background:#fff!important;color:#59677f!important;box-shadow:none!important;font-size:11px!important
}
.product-actions.gg-in-cart-actions .add-to-cart:hover{border-color:#f2a6a6!important;color:#c83b3b!important;background:#fff7f7!important}
.gg-detail-in-cart-actions{display:grid!important;grid-template-columns:minmax(0,1.5fr) minmax(118px,.7fr)!important;gap:10px!important;align-items:stretch}
.gg-detail-in-cart-actions .gg-go-cart-link--detail{display:flex!important;align-items:center;justify-content:center;border-radius:11px;background:linear-gradient(135deg,#4361ee,#3855d8);color:#fff!important;font-weight:900;text-decoration:none!important}
.gg-detail-in-cart-actions #add-to-cart-detail{margin:0!important;background:#fff!important;color:#59677f!important;border:1px solid #d7dfec!important}

/* Один-два товара в модальной корзине не прилипают к потолку огромного окна. */
#cart-modal.gg-cart-few-items .cart-items{display:flex!important;flex-direction:column;justify-content:center;min-height:300px}
#cart-modal.gg-cart-one-item .cart-item{min-height:120px;padding-top:18px!important;padding-bottom:18px!important}
#cart-modal.gg-cart-one-item .cart-item-image{width:86px!important;height:86px!important;flex-basis:86px!important}

/* Полная корзина: кнопку оформления не прячем даже при унаследованных стилях. */
#mag-cart-page #mag-cart-checkout.mag-cart-primary{display:flex!important;align-items:center;justify-content:center;width:100%!important;min-height:46px!important;margin:14px 0 9px!important}
#mag-cart-page.gg-cart-few-items #mag-cart-lines{display:flex;flex-direction:column;justify-content:center;min-height:270px}

/* Переписка внутри заказа, одинаковая для аккаунта и защищённого гостевого заказа. */
.mag-order-message-history{display:grid;gap:7px;margin:10px 0 12px;max-height:250px;overflow:auto;padding:9px;border:1px solid #e4e9f2;border-radius:12px;background:#f7f9fc}
.mag-order-message-row{display:grid;gap:3px;max-width:86%;padding:8px 10px;border-radius:11px;background:#fff;border:1px solid #e1e6ef;color:#28344a}
.mag-order-message-row.is-customer{justify-self:end;background:#eef2ff;border-color:#d7e0ff}
.mag-order-message-row.is-admin{justify-self:start}
.mag-order-message-row strong{font-size:11px}.mag-order-message-row span{font-size:13px;line-height:1.4;white-space:pre-wrap;word-break:break-word}.mag-order-message-row small{font-size:10px;color:#8490a3}

@media(max-width:820px){
  #wishlist-page .wishlist-header,.wishlist-page .wishlist-header{padding:20px 18px 64px!important}
  #wishlist-page .wishlist-count-badge,.wishlist-page .wishlist-count-badge{right:50%!important;top:auto!important;bottom:17px!important;transform:translateX(50%)!important}
  .product-actions.gg-in-cart-actions,.gg-detail-in-cart-actions{grid-template-columns:minmax(0,1fr) minmax(88px,.55fr)!important}
  #cart-modal.gg-cart-few-items .cart-items{min-height:220px}
}

/* MAG 1.2.13: финальная доводка компактной корзины. */
#cart-modal .gg-cart-plus-unavailable{display:none!important}
#mag-cart-page.gg-cart-one-item .mag-cart-item{min-height:150px;padding-top:25px;padding-bottom:25px}
#mag-cart-page.gg-cart-one-item .mag-cart-thumb{width:108px;height:108px}
#mag-cart-page.gg-cart-one-item .mag-cart-item{grid-template-columns:108px minmax(0,1fr) auto}
@media(max-width:640px){
  #mag-cart-page.gg-cart-one-item .mag-cart-item{grid-template-columns:82px minmax(0,1fr);min-height:120px;padding-top:18px;padding-bottom:18px}
  #mag-cart-page.gg-cart-one-item .mag-cart-thumb{width:82px;height:82px}
}


/* MAG 1.2.14 — устойчивый cart/account UX. */
#mag-cart-page #mag-cart-checkout.mag-cart-primary{display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important}
#mag-cart-page #mag-cart-checkout.is-disabled,#mag-cart-page #mag-cart-checkout[aria-disabled="true"]{opacity:.52!important;cursor:not-allowed!important}
.mag-profile-card{max-width:760px;margin-inline:auto;width:100%}
.mag-shop-order-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:16px!important;align-items:start!important}
.mag-shop-order-title{min-width:0;overflow-wrap:anywhere}.mag-shop-order-price{white-space:nowrap;text-align:right}
.mag-shop-order-list{display:grid;gap:10px}.mag-shop-order-list>a,.mag-shop-order-list .mag-order-list-card{border:1px solid #e1e6ef;border-radius:13px;background:#fff!important;box-shadow:0 3px 12px rgba(31,48,82,.04);padding:14px 16px!important;text-decoration:none!important;color:inherit!important}.mag-shop-order-list .is-closed{background:#f6f7f9!important;color:#657082!important}.mag-order-list-main{display:flex;justify-content:space-between;gap:16px;align-items:center}.mag-order-list-number{font-weight:850;color:#263b6a}.mag-order-list-total{font-size:17px;font-weight:850;white-space:nowrap}.mag-order-list-meta{margin-top:5px;color:#748198;font-size:12px}.mag-order-list-arrow{display:none!important}
.product-actions.gg-in-cart-actions,.gg-detail-in-cart-actions{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:0!important;border-radius:10px;overflow:hidden;border:1px solid #4164ea;background:#4164ea}.product-actions.gg-in-cart-actions .gg-go-cart-link,.gg-detail-in-cart-actions .gg-go-cart-link{display:flex!important;align-items:center;justify-content:center!important;min-width:0!important;width:auto!important;margin:0!important;border:0!important;border-radius:0!important;background:#4164ea!important;color:#fff!important;font-weight:800!important;text-decoration:none!important}.product-actions.gg-in-cart-actions .add-to-cart,.gg-detail-in-cart-actions #add-to-cart-detail{width:46px!important;min-width:46px!important;max-width:46px!important;margin:0!important;padding:0!important;border:0!important;border-left:1px solid rgba(255,255,255,.35)!important;border-radius:0!important;background:#fff!important;color:#d64a3d!important}.gg-remove-cart-label{display:none!important}
.gg-bottom-recs__rail{cursor:grab;padding-bottom:10px!important}.gg-bottom-recs__rail.is-dragging{cursor:grabbing;scroll-behavior:auto!important;user-select:none}.gg-bottom-recs .product-card{overflow:visible!important}.gg-bottom-recs__section{overflow:hidden}.gg-bottom-recs__rail>.product-card{height:auto!important;min-height:430px!important}.gg-bottom-recs .product-card .product-actions{margin-top:auto!important;padding-bottom:4px!important}
@media(max-width:820px){.gg-bottom-recs__rail>.product-card{min-height:405px!important}.mag-shop-order-row{gap:10px!important}}

/* ===== MAG 1.2.15: стабильная корзина, hover-галерея и боковые подкатегории ===== */
/* Карточка товара: одно стабильное действие вместо split-кнопки. */
.product-actions.gg-in-cart-actions,
.gg-detail-in-cart-actions{
  display:block!important;border:0!important;background:transparent!important;overflow:visible!important;
}
.product-actions .gg-go-cart-link,
.gg-go-cart-link--detail{display:none!important}
.product-actions .add-to-cart.gg-cart-open-state,
#add-to-cart-detail.gg-cart-open-state,
.btn-add-to-cart-detail.gg-cart-open-state{
  width:100%!important;max-width:none!important;min-width:0!important;min-height:46px!important;margin:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;
  border:0!important;border-radius:10px!important;padding:10px 14px!important;
  color:#fff!important;background:linear-gradient(135deg,#4266ef 0%,#3156df 100%)!important;
  box-shadow:0 7px 18px rgba(49,86,223,.16)!important;font-size:13px!important;font-weight:850!important;
}
.product-actions .add-to-cart.gg-cart-open-state:hover,
#add-to-cart-detail.gg-cart-open-state:hover,
.btn-add-to-cart-detail.gg-cart-open-state:hover{
  transform:translateY(-1px)!important;background:linear-gradient(135deg,#365ce8 0%,#294dcc 100%)!important;
}
.gg-remove-cart-label{display:none!important}

/* Нижние подборки снова без drag-режима мышью: только стрелки/свайп/горизонтальный жест. */
.gg-bottom-recs__rail{cursor:default!important;user-select:auto!important}
.gg-bottom-recs__rail.is-dragging{cursor:default!important;user-select:auto!important}

/* Hover-галерея карточки товара. */
.product-image.gg-hover-gallery-active{position:relative}
.product-image.gg-hover-gallery-active img{transition:opacity .16s ease!important}
.product-image.gg-hover-gallery-active img.gg-hover-gallery-fade{opacity:.35!important}
.gg-hover-gallery-dots{
  position:absolute;left:8px;right:8px;bottom:7px;z-index:6;display:flex;justify-content:center;gap:4px;pointer-events:none;
}
.gg-hover-gallery-dots span{display:block;flex:1 1 0;max-width:34px;height:3px;border-radius:999px;background:rgba(255,255,255,.62);box-shadow:0 1px 4px rgba(0,0,0,.25)}
.gg-hover-gallery-dots span.is-active{background:#4361ee}
@media(hover:none),(pointer:coarse){.gg-hover-gallery-dots{display:none!important}}

/* Боковой каталог: активная платформа раскрывает реальные доступные типы товаров в потоке документа. */
#sidebar .catalog-item.gg-sidebar-category-active{height:auto!important;min-height:0!important}
#sidebar .gg-sidebar-subtypes{display:block;padding:0 10px 10px 38px;background:#fbfcff;border-top:1px solid #eef1f6}
#sidebar .gg-sidebar-subtypes__toggle{
  width:100%;min-height:30px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 4px;
  border:0;background:transparent;color:#7d8799;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;cursor:pointer;
}
#sidebar .gg-sidebar-subtypes__list{display:grid;gap:3px;padding:1px 0 2px}
#sidebar .gg-sidebar-subtypes__list[hidden]{display:none!important}
#sidebar .gg-sidebar-subtypes__list a{
  display:block;padding:6px 8px;border-radius:8px;color:#4f5d73;text-decoration:none;font-size:12px;line-height:1.25;transition:background .15s ease,color .15s ease;
}
#sidebar .gg-sidebar-subtypes__list a:hover{background:#eef3ff;color:#3155d8}
#sidebar .gg-sidebar-subtypes__list a.is-active{background:#e9efff;color:#294dcc;font-weight:850}

/* Модальная корзина: одно действие, без дублирующей кнопки и скачков геометрии. */
#cart-modal .cart-summary .checkout-buttons > .checkout-btn.secondary{display:none!important}
#cart-modal .cart-summary .checkout-buttons{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
#cart-modal .cart-item-info > .cart-item-price{display:none!important}
#cart-modal .cart-stock-note:not(.out){display:none!important}
#cart-modal .quantity-btn[data-action="plus"]:disabled{display:none!important}
#cart-modal .quantity-control:has(.quantity-btn[data-action="plus"]:disabled){grid-template-columns:28px 34px!important;width:62px!important}
#cart-modal.gg-cart-few-items .cart-items{display:flex!important;flex-direction:column!important;justify-content:center!important;min-height:180px!important;padding-top:18px!important;padding-bottom:18px!important}
#cart-modal.gg-cart-one-item .cart-item{min-height:0!important;padding-top:14px!important;padding-bottom:14px!important}
#cart-modal.gg-cart-one-item .cart-item-image{width:68px!important;height:82px!important;flex-basis:68px!important}
@media(min-width:821px){
  #cart-modal .cart-item{
    display:grid!important;grid-template-columns:68px minmax(0,1fr) auto!important;grid-template-areas:"cart-image cart-info cart-controls"!important;
    align-items:center!important;gap:12px!important;width:100%!important;padding:12px 2px!important;
  }
  #cart-modal .cart-item-image{grid-area:cart-image!important;width:68px!important;height:82px!important}
  #cart-modal .cart-item-info{grid-area:cart-info!important;min-width:0!important}
  #cart-modal .cart-item-controls{
    grid-area:cart-controls!important;display:grid!important;grid-template-columns:auto minmax(72px,auto) 30px!important;
    align-items:center!important;gap:8px!important;padding:0!important;min-width:0!important;
  }
  #cart-modal .cart-item-title{max-width:100%!important;overflow:hidden!important}
}
@media(max-width:820px){
  #cart-modal .cart-item{
    display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;grid-template-areas:"cart-image cart-info" "cart-controls cart-controls"!important;
    align-items:start!important;gap:8px 10px!important;
  }
  #cart-modal .cart-item-image{grid-area:cart-image!important}
  #cart-modal .cart-item-info{grid-area:cart-info!important}
  #cart-modal .cart-item-controls{grid-area:cart-controls!important;padding-left:74px!important;width:100%!important}
}

/* Полная корзина: интерфейс не меняет геометрию на каждом запросе к серверу. */
#mag-cart-page.is-updating .mag-cart-qty button,
#mag-cart-page.is-updating .mag-cart-delete,
#mag-cart-page.is-updating .mag-cart-clear{pointer-events:none!important;opacity:.55!important}
#mag-cart-page #mag-cart-checkout.mag-cart-primary{
  display:flex!important;visibility:visible!important;width:100%!important;min-height:46px!important;
  align-items:center!important;justify-content:center!important;border-radius:10px!important;
}
#mag-cart-page #mag-cart-checkout.mag-cart-primary:not(.is-disabled){opacity:1!important;pointer-events:auto!important;background:#4361ee!important;color:#fff!important;cursor:pointer!important}
#mag-cart-page #mag-cart-checkout.mag-cart-primary.is-disabled{opacity:.5!important;pointer-events:none!important}
#mag-cart-page.gg-cart-one-item #mag-cart-lines{min-height:0!important;justify-content:flex-start!important}
#mag-cart-page.gg-cart-one-item .mag-cart-item{min-height:0!important;padding-top:16px!important;padding-bottom:16px!important;grid-template-columns:88px minmax(0,1fr) auto!important}
#mag-cart-page.gg-cart-one-item .mag-cart-thumb{width:88px!important;height:88px!important}
@media(max-width:640px){
  #mag-cart-page.gg-cart-one-item .mag-cart-item{grid-template-columns:72px minmax(0,1fr)!important}
  #mag-cart-page.gg-cart-one-item .mag-cart-thumb{width:72px!important;height:72px!important}
}
/* Нативное состояние in-cart получает тот же размер/цвет ещё до JS-нормализации, поэтому переход не мигает оранжевым. */
.product-actions .add-to-cart.in-cart,
.product-actions .add-to-cart.remove-from-cart,
#add-to-cart-detail.in-cart,
#add-to-cart-detail.remove-from-cart,
.btn-add-to-cart-detail.in-cart,
.btn-add-to-cart-detail.remove-from-cart{
  width:100%!important;max-width:none!important;min-height:46px!important;margin:0!important;border:0!important;border-radius:10px!important;
  color:#fff!important;background:linear-gradient(135deg,#4266ef 0%,#3156df 100%)!important;box-shadow:0 7px 18px rgba(49,86,223,.16)!important;
}


/* ===== MAG 1.2.16: единая корзина аккаунта, компактные разделы и единый мессенджер ===== */
/* Состояние «уже в корзине» заметно, но геометрия кнопки не меняется. */
.product-actions .add-to-cart.gg-cart-open-state,
#add-to-cart-detail.gg-cart-open-state,
.btn-add-to-cart-detail.gg-cart-open-state{
  background:linear-gradient(135deg,#ff982f 0%,#ff7b12 100%)!important;
  box-shadow:0 7px 18px rgba(255,123,18,.18)!important;
}
.product-actions .add-to-cart.gg-cart-open-state:hover,
#add-to-cart-detail.gg-cart-open-state:hover,
.btn-add-to-cart-detail.gg-cart-open-state:hover{
  background:linear-gradient(135deg,#ff8a1e 0%,#f36c05 100%)!important;
}

/* Подкатегории живут в потоке: без заголовка «Разделы», только полезные пункты. */
#sidebar .gg-sidebar-subtypes{padding:5px 10px 10px 39px!important;background:#fbfcff!important;border-top:0!important}
#sidebar .gg-sidebar-subtypes__toggle{display:none!important}
#sidebar .gg-sidebar-subtypes__list{display:grid!important;gap:2px!important;padding:3px 0 2px!important;border-left:2px solid #e5eaf4}
#sidebar .gg-sidebar-subtypes__list a{position:relative;padding:6px 9px 6px 13px!important;border-radius:0 8px 8px 0!important;font-size:12px!important;color:#56647a!important}
#sidebar .gg-sidebar-subtypes__list a::before{content:"";position:absolute;left:-2px;top:50%;width:7px;height:2px;background:#e5eaf4}
#sidebar .gg-sidebar-subtypes__list a:hover{background:#f0f4ff!important;color:#3155d8!important}
#sidebar .gg-sidebar-subtypes__list a.is-active{background:#e9efff!important;color:#294dcc!important;font-weight:850!important}

/* Количество всегда занимает одинаковые три ячейки, поэтому цифры стоят строго колонкой. */
#mag-cart-page .mag-cart-qty{display:grid!important;grid-template-columns:30px 38px 30px!important;width:98px!important;align-items:center!important;justify-items:center!important}
#mag-cart-page .mag-cart-qty>button,#mag-cart-page .mag-cart-qty>.mag-cart-qty-spacer{width:30px!important;height:30px!important;box-sizing:border-box!important}
#mag-cart-page .mag-cart-qty>.mag-cart-qty-spacer{display:block!important;visibility:hidden!important}
#mag-cart-page .mag-cart-qty>span{width:38px!important;text-align:center!important;font-variant-numeric:tabular-nums}
#cart-modal .quantity-control{display:grid!important;grid-template-columns:30px 38px 30px!important;width:98px!important;align-items:center!important;justify-items:center!important}
#cart-modal .quantity-btn[data-action="plus"]:disabled{display:block!important;visibility:hidden!important;pointer-events:none!important}
#cart-modal .quantity-control:has(.quantity-btn[data-action="plus"]:disabled){grid-template-columns:30px 38px 30px!important;width:98px!important}

/* Красная отмена и лаконичная кнопка перехода в единый чат. */
.mag-shop-btn-danger{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid #dc3545!important;background:#dc3545!important;color:#fff!important;border-radius:10px;padding:10px 14px;font:inherit;font-weight:800;cursor:pointer;text-decoration:none!important}
.mag-shop-btn-danger:hover{background:#c92f3e!important;border-color:#c92f3e!important;color:#fff!important}
.mag-order-chat-entry{margin:14px 0;padding:13px 14px;border:1px solid #dce3ef;border-radius:13px;background:#fbfcff;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.mag-order-chat-entry p{margin:0;color:#6f7d92;font-size:12px}

/* Дата внутри единого клиентского чата. */
.gg-site-chat__day{grid-column:1/-1;display:flex;align-items:center;justify-content:center;margin:4px 0 1px}
.gg-site-chat__day span{padding:3px 8px;border-radius:999px;background:#e9edf5;color:#68758a;font-size:10px;font-weight:800}



/* MAG 1.2.19: отдельный boot-флаг не даёт старому pageshow показать промежуточную
   геометрию шапки до загрузки состояния аккаунта и счётчиков. */
html.gamesgu-polish-booting body{visibility:hidden!important}

/* ===== MAG 1.2.17: стабильная навигация, единая корзина и чат ===== */
html{scrollbar-gutter:stable}

/* Счётчики не меняют ширину кнопок и не дёргают шапку/вкладки после загрузки данных. */
.mag-shop-links a,.mag-shop-links button{position:relative;min-height:36px}
.mag-shop-links .mag-orders-attention-badge,
.mag-shop-links .mag-order-event-badge{position:absolute;right:-7px;top:-7px;margin:0!important}
.header-actions .cart-count,.header-actions .wishlist-count,.gg-account-attention{font-variant-numeric:tabular-nums}

/* Товар снова имеет одно штатное действие: добавить / удалить из корзины. */
.product-actions .add-to-cart,
#add-to-cart-detail,.btn-add-to-cart-detail{
  width:100%!important;max-width:none!important;min-height:46px!important;margin:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;
  border:0!important;border-radius:10px!important;padding:10px 14px!important;
  font-size:13px!important;font-weight:850!important;transition:background .14s ease,box-shadow .14s ease,transform .14s ease!important
}
.product-actions .add-to-cart:not(.in-cart):not(.remove-from-cart):not(.out-of-stock),
#add-to-cart-detail:not(.in-cart):not(.remove-from-cart):not(.out-of-stock),
.btn-add-to-cart-detail:not(.in-cart):not(.remove-from-cart):not(.out-of-stock){
  color:#fff!important;background:linear-gradient(135deg,#4266ef 0%,#3156df 100%)!important;
  box-shadow:0 7px 18px rgba(49,86,223,.16)!important
}
.product-actions .add-to-cart.in-cart,
.product-actions .add-to-cart.remove-from-cart,
#add-to-cart-detail.in-cart,#add-to-cart-detail.remove-from-cart,
.btn-add-to-cart-detail.in-cart,.btn-add-to-cart-detail.remove-from-cart{
  color:#fff!important;background:linear-gradient(135deg,#ff982f 0%,#ff7b12 100%)!important;
  box-shadow:0 7px 18px rgba(255,123,18,.18)!important
}
.product-actions .add-to-cart.in-cart:hover,
.product-actions .add-to-cart.remove-from-cart:hover,
#add-to-cart-detail.in-cart:hover,#add-to-cart-detail.remove-from-cart:hover{
  background:linear-gradient(135deg,#f88920 0%,#ef6e06 100%)!important
}

/* Плавающая корзина рядом с чатом: отдельная точка перехода, карточка товара больше не занимается навигацией. */
.gg-cart-launcher{
  position:fixed;right:18px;bottom:84px;z-index:10039;width:54px;height:54px;display:grid;place-items:center;
  border:0;border-radius:50%;background:linear-gradient(135deg,#4361ee,#7b12d9);color:#fff!important;text-decoration:none!important;
  box-shadow:0 12px 30px rgba(55,62,140,.28);font-size:19px;transition:transform .15s ease,box-shadow .15s ease
}
.gg-cart-launcher:hover{transform:translateY(-2px);box-shadow:0 15px 34px rgba(55,62,140,.34);color:#fff!important}
.gg-cart-launcher__badge{
  position:absolute;right:-4px;top:-5px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;
  background:#ef4444;color:#fff;font:800 11px/20px Arial;text-align:center;box-shadow:0 0 0 2px #fff
}
.gg-cart-launcher__badge[hidden]{display:none!important}
.gg-cart-launcher.gg-has-items{box-shadow:0 12px 30px rgba(55,62,140,.31),0 0 0 4px rgba(67,97,238,.08)}
@media(min-width:821px){
  .gg-chat-launcher{bottom:24px!important}
  .gg-cart-launcher{right:18px;bottom:86px}
}
@media(max-width:820px){
  .gg-cart-launcher{right:14px;bottom:calc(146px + env(safe-area-inset-bottom,0px))}
}

/* Подкатегории: только спокойный текст, без серых полос, соединителей и hover-перерисовок. */
#sidebar .gg-sidebar-subtypes{
  padding:2px 10px 7px 38px!important;background:transparent!important;border:0!important
}
#sidebar .gg-sidebar-subtypes__list{
  display:grid!important;gap:0!important;padding:0!important;border:0!important
}
#sidebar .gg-sidebar-subtypes__list a{
  display:block!important;padding:5px 6px!important;border:0!important;border-radius:6px!important;
  background:transparent!important;color:#657188!important;font-size:12px!important;line-height:1.25!important;
  text-decoration:none!important;transition:color .12s ease!important
}
#sidebar .gg-sidebar-subtypes__list a::before{display:none!important}
#sidebar .gg-sidebar-subtypes__list a:hover{background:transparent!important;color:#3155d8!important}
#sidebar .gg-sidebar-subtypes__list a.is-active{background:transparent!important;color:#294dcc!important;font-weight:850!important}

/* Количество и иконки корзины не меняют геометрию во время сетевого запроса. */
#mag-cart-page .mag-cart-qty-row{display:grid!important;grid-template-columns:98px 32px!important;gap:8px!important;align-items:center!important}
#mag-cart-page .mag-cart-delete{width:32px!important;min-width:32px!important;height:32px!important;margin:0!important;transform:none!important}
#mag-cart-page .mag-cart-clear{min-width:116px;text-align:center}
#mag-cart-page.is-updating .mag-cart-delete,
#mag-cart-page.is-updating .mag-cart-clear,
#mag-cart-page.is-updating .mag-cart-qty button{opacity:.72!important;transform:none!important}

/* Авторизованный клиент не заполняет имя/телефон повторно в чате. */
#gg-contact-form.gg-site-chat--registered .gg-site-chat__identity-grid{display:none!important}
#gg-contact-form.gg-site-chat--registered.gg-site-chat--order-case .gg-site-chat__topic-field{display:none!important}
.gg-site-chat__case-divider{
  grid-column:1/-1;display:flex;justify-content:center;margin:5px 0 2px
}
.gg-site-chat__case-divider span{
  display:inline-flex;padding:4px 9px;border-radius:999px;background:#edf2fa;color:#586982;font-size:10px;font-weight:850
}
.gg-site-chat__case-divider a{color:#3155d8;text-decoration:none}
.gg-site-chat__case-divider a:hover{text-decoration:underline}

/* Валидационные сообщения на checkout остаются видимыми даже если проблема выше текущего scroll. */
.mag-checkout-toast{
  position:fixed;right:18px;bottom:24px;z-index:10060;width:min(380px,calc(100vw - 36px));
  padding:12px 14px;border-radius:12px;background:#fff;color:#26334d;border:1px solid #dce3ef;
  box-shadow:0 16px 44px rgba(22,35,67,.22);font-size:13px;line-height:1.4
}
.mag-checkout-toast.is-error{border-color:#f1b8b4;background:#fff8f7;color:#9f2f28}

.header-actions a,.header-actions button{position:relative}
.header-actions .gg-account-attention{position:absolute;right:-6px;top:-7px;margin:0!important}

/* MAG 1.2.18: одинаковая геометрия кнопок товара в узких карточках. */
.product-card .product-actions .add-to-cart {
  box-sizing:border-box; width:100%; min-width:0; min-height:48px;
  display:flex; align-items:center; justify-content:center; gap:8px;
  white-space:nowrap; font-size:clamp(12px,1.3vw,16px);
}
.product-card .product-actions .add-to-cart span {white-space:nowrap;}

/* MAG 1.2.18: стабильная геометрия карточек и области навигации. */
html { scrollbar-gutter: stable; }
.product-card .product-actions .add-to-cart { box-sizing:border-box!important; width:100%!important; min-width:0!important; max-width:100%!important; min-height:48px!important; height:48px!important; padding:0 8px!important; font-size:clamp(12px,1.2vw,16px)!important; white-space:nowrap!important; display:flex!important; align-items:center!important; justify-content:center!important; gap:7px!important; }
.product-card .product-actions .add-to-cart span { min-width:0!important; white-space:nowrap!important; }
.gg-site-chat__bubble { white-space:pre-wrap!important; }
.gg-site-chat__bubble .gg-order-chat-link { color:inherit; text-decoration:underline; font-weight:700; }

/* Заявка на возврат одобрена: покупателю нужно отправить товар. */
.mag-order-list-card.is-return-awaiting {border:2px solid #d33b42!important; background:rgba(211,59,66,.06)!important;}

/* ===== MAG 1.2.20: trace-driven performance + responsive geometry ===== */
/* Размеры карточек не должны меняться при переключении «В корзину» / «Убрать». */
.product-card .product-actions .add-to-cart,
.product-card .product-actions .add-to-cart.in-cart,
.product-card .product-actions .add-to-cart.remove-from-cart,
.product-card .product-actions .add-to-cart.out-of-stock{
  box-sizing:border-box!important;
  block-size:48px!important;
  min-block-size:48px!important;
  max-block-size:48px!important;
  padding:0 8px!important;
  line-height:1!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease!important;
}
.product-card .product-price,
.product-card .price-new{min-block-size:44px}

/* Резерв под асинхронные рекомендации: футер больше не улетает после первого paint. */
.gg-bottom-recs.is-loading{min-height:430px!important;pointer-events:none}

/* Корзина сначала показывает loader, затем строки. Держим стабильную высоту сетки. */
#mag-cart-page .mag-cart-grid,
[data-mag-page="account-cart"] .mag-cart-grid{min-height:340px}
#mag-cart-page #mag-cart-lines .mag-cart-loading,
[data-mag-page="account-cart"] #mag-cart-lines .mag-cart-loading{min-height:230px;display:flex;align-items:center}

/* Универсальная защита от расползания длинных названий, артикулов и номеров заказов. */
.mag-shop-shell,.mag-shop-card,.mag-cart-shell,.mag-cart-card,.mag-order-list-main,
.mag-shop-order-title,.mag-cart-item>div,.gg-site-chat__bubble{min-width:0!important}
.mag-order-list-number,.mag-order-list-meta,.mag-cart-product-name,.mag-cart-product-id,
.mag-shop-order-title,.mag-shop-order-data,.gg-site-chat__bubble{
  overflow-wrap:anywhere;
  word-break:normal;
}
.mag-shop-hero h1{font-size:clamp(24px,2.35vw,32px)!important}
.mag-shop-hero p{max-width:100%;overflow-wrap:anywhere}

/* Ноутбуки и узкий desktop: sidebar не отъедает фиксированные 280 px у контента. */
@media (min-width:821px) and (max-width:1180px){
  #sidebar,.sidebar{width:clamp(210px,22vw,250px)!important;flex:0 0 clamp(210px,22vw,250px)!important}
  #content,.content-wrapper>main,.content-wrapper>.content{min-width:0!important}
  .mag-shop-shell,.mag-cart-shell{max-width:100%!important}
  .mag-shop-card{padding:clamp(18px,2.1vw,24px)!important}
}

/* Телефоны и планшеты: кабинет, заказы и корзина складываются предсказуемо. */
@media (max-width:820px){
  .mag-shop-shell,.mag-cart-shell{width:100%!important;max-width:100%!important;margin-top:8px!important;margin-bottom:40px!important}
  .mag-shop-links{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .mag-shop-links a{display:flex!important;align-items:center!important;justify-content:center!important;min-width:0!important;min-height:42px!important;padding:8px 10px!important;text-align:center!important;line-height:1.2!important}
  .mag-shop-card{padding:clamp(14px,4vw,18px)!important}
  .mag-order-list-main{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px 12px!important;align-items:start!important}
  .mag-order-list-total{font-size:15px!important;align-self:start!important}
  .mag-order-list-meta{line-height:1.35!important}
  #mag-cart-page .mag-cart-grid,[data-mag-page="account-cart"] .mag-cart-grid{min-height:360px}
  .gg-bottom-recs.is-loading{min-height:405px!important}
}

@media (max-width:520px){
  .mag-shop-crumbs,.mag-cart-crumbs{font-size:12px!important;line-height:1.35!important}
  .mag-shop-hero{margin-bottom:16px!important}
  .mag-shop-hero h1{font-size:clamp(23px,7vw,28px)!important;line-height:1.15!important}
  .mag-shop-links{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .mag-shop-order-list>a,.mag-shop-order-list .mag-order-list-card{padding:12px 13px!important}
  .mag-order-list-number{font-size:14px!important}
  .mag-order-list-total{font-size:14px!important}
  .mag-cart-list-top{align-items:flex-start!important;flex-wrap:wrap!important}
  .mag-cart-clear{margin-left:auto!important}
  .mag-cart-summary-row,.mag-cart-summary-total{min-width:0!important}
  .mag-cart-summary-row span,.mag-cart-summary-total span{min-width:0!important;overflow-wrap:anywhere}
}

@media (max-width:360px){
  .mag-shop-links{grid-template-columns:1fr!important}
  .mag-order-list-main{grid-template-columns:1fr!important}
  .mag-order-list-total{justify-self:end!important}
  .product-card .product-actions .add-to-cart,
  .product-card .product-actions .add-to-cart.in-cart,
  .product-card .product-actions .add-to-cart.remove-from-cart{font-size:11px!important;padding-inline:5px!important}
}


/* ===== MAG 1.2.21: mobile cart/chat polish ===== */
@media (max-width:820px){
  /* На телефоне действия уже есть в нижней навигации, поэтому плавающие дубли убираем. */
  .gg-chat-launcher,.gg-cart-launcher{display:none!important}

  /* На мобильной карточке вкладки идут после предупреждения об оформлении/состоянии. */
  #product-page .product-detail-tabs{
    width:100%!important;
    margin:14px 0 10px!important;
  }
  #product-page .product-detail-tab{min-width:0!important}

  /* Чат ограничивается реальным visual viewport, включая открытую экранную клавиатуру. */
  #gg-contact-modal{
    align-items:flex-end!important;
    justify-content:center!important;
    overflow:hidden!important;
    padding:6px 8px calc(8px + var(--gg-mobile-nav-height,70px) + env(safe-area-inset-bottom,0px))!important;
  }
  #gg-contact-modal .gg-ui-modal__dialog--contact{
    width:min(100%,610px)!important;
    height:calc(var(--gg-chat-viewport-height,100dvh) - var(--gg-mobile-nav-height,70px) - env(safe-area-inset-bottom,0px) - 16px)!important;
    max-height:calc(var(--gg-chat-viewport-height,100dvh) - var(--gg-mobile-nav-height,70px) - env(safe-area-inset-bottom,0px) - 16px)!important;
    min-height:0!important;
    margin:0 auto!important;
    padding:14px!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
    border-radius:18px 18px 12px 12px!important;
  }
  #gg-contact-modal .gg-ui-modal__head{
    flex:0 0 auto!important;
    margin-bottom:10px!important;
    padding-right:38px!important;
  }
  #gg-contact-modal .gg-ui-modal__head h3{font-size:19px!important}
  #gg-contact-form{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch;
    scroll-padding-bottom:92px;
  }
  #gg-contact-form .gg-site-chat{min-height:0!important;margin-bottom:8px!important}
  #gg-contact-form .gg-site-chat__messages{
    min-height:105px!important;
    max-height:min(28dvh,220px)!important;
    overscroll-behavior:contain!important;
  }
  #gg-contact-form textarea[name="message"]{
    min-height:72px!important;
    max-height:130px!important;
  }
  #gg-contact-form .gg-ui-form__submit{min-height:46px!important;flex:0 0 auto!important}
}

@media (max-width:380px){
  #gg-contact-modal{padding-left:5px!important;padding-right:5px!important}
  #gg-contact-modal .gg-ui-modal__dialog--contact{padding:12px!important}
  #gg-contact-form .gg-site-chat__messages{max-height:24dvh!important}
}

/* ===== MAG 1.2.22: category first paint + tablet/compact desktop cart ===== */
/* Цвет hero приходит с сервера уже готовым. Не анимируем фон между базовой и платформенной темой. */
#category-page .category-hero,
#catalog-template-page .category-hero{
  transition:none!important;
}

/* Название товара переносим по словам. Артикул по-прежнему может ломаться в любом месте. */
#mag-cart-page .mag-cart-product-name,
[data-mag-page="account-cart"] .mag-cart-product-name{
  min-width:0!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  hyphens:auto;
}

/*
 * iPad Pro / Surface / узкие desktop-окна: при 981–1180 px базовый mag-commerce
 * ещё держал две колонки (товары + 335 px итог), хотя рядом остаётся sidebar.
 * Из-за этого название товара могло схлопнуться почти до одного символа в строке.
 * На этом диапазоне итог переносим под список. Это desktop/tablet layout, не mobile UI.
 */
@media (min-width:821px) and (max-width:1180px){
  #mag-cart-page .mag-cart-grid,
  [data-mag-page="account-cart"] .mag-cart-grid{
    grid-template-columns:minmax(0,1fr)!important;
    gap:16px!important;
    min-width:0!important;
  }
  #mag-cart-page .mag-cart-aside,
  [data-mag-page="account-cart"] .mag-cart-aside{
    position:static!important;
    width:100%!important;
    min-width:0!important;
  }
  #mag-cart-page .mag-cart-item,
  [data-mag-page="account-cart"] .mag-cart-item{
    grid-template-columns:82px minmax(0,1fr) auto!important;
    gap:12px!important;
    min-width:0!important;
  }
  #mag-cart-page .mag-cart-thumb,
  [data-mag-page="account-cart"] .mag-cart-thumb{
    width:82px!important;
    height:82px!important;
  }
  #mag-cart-page .mag-cart-action-col,
  [data-mag-page="account-cart"] .mag-cart-action-col{
    min-width:118px!important;
  }
}

/* Совсем узкий desktop непосредственно перед мобильным breakpoint. */
@media (min-width:821px) and (max-width:900px){
  #mag-cart-page .mag-cart-item,
  [data-mag-page="account-cart"] .mag-cart-item{
    grid-template-columns:72px minmax(0,1fr)!important;
    align-items:start!important;
  }
  #mag-cart-page .mag-cart-thumb,
  [data-mag-page="account-cart"] .mag-cart-thumb{
    width:72px!important;
    height:72px!important;
  }
  #mag-cart-page .mag-cart-action-col,
  [data-mag-page="account-cart"] .mag-cart-action-col{
    grid-column:2!important;
    width:100%!important;
    min-width:0!important;
    flex-direction:row!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:flex-end!important;
  }
}
