/**
 * Responsive Custom Styles
 * All rules ONLY inside @media queries — desktop is untouched.
 *
 * Phase 0: Layout overrides (wrapper, sidebars)
 * Phase 1: Common elements (forms, buttons, inputs, modals)
 * Phase 2: Product page (bundle items, SKU, tabs, urgency, special-row)
 * Phase 3: Cart page (buttons, items list, totals)
 * Phase 4: Checkout (delivery boxes, map, address, inputs)
 * Phase 5: Catalog (categories, product cards)
 * Phase 6: Polish (touch targets, fonts, overflow)
 */

/* Hide mobile-only elements on desktop by default */
.mobile-only,
#mobile-header-bar {
  display: none;
}

/* ==========================================================================
   TABLET: max-width 959px
   ========================================================================== */
@media (max-width: 959px) {

  /* Prevent iOS zoom on input focus (requires font-size >= 16px) */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="url"],
  input[type="search"],
  textarea,
  select,
  /* Описание к прикреплённому файлу (поле создаётся в JS без type в разметке) */
  .control-group.pfiles input,
  .gapp.file-upload ul li input,
  /* Описание файла в формах Uniform (страницы товаров) */
  .gapp .pfiles li input {
    font-size: 16px !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* На мобильных: крестик рядом с именем файла, описание — в столбик на всю ширину */
  .control-group.pfiles .gapp ul li,
  .gapp .pfiles li,
  .gapp.pfiles ul li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-bottom: 8px;
  }
  .control-group.pfiles .gapp ul li .fa-remove,
  .control-group.pfiles .gapp ul li [data-cmd-delete],
  .gapp .pfiles li .fa-remove,
  .gapp .pfiles li [data-cmd-delete],
  .gapp.pfiles ul li .fa-remove,
  .gapp.pfiles ul li [data-cmd-delete] {
    flex-shrink: 0;
  }
  .control-group.pfiles .gapp ul li .filename,
  .gapp .pfiles li .filename,
  .gapp.pfiles ul li .filename {
    flex: 1;
    min-width: 0;
    margin: 0;
  }
  .control-group.pfiles .gapp ul li .input-large,
  .gapp .pfiles li .input-large,
  .gapp.pfiles ul li .input-large {
    flex: 1 1 100%;
    width: 100% !important;
    margin: 0;
  }

  /* --- Phase 0: Layout overrides (template generates fixed px) --- */
  body { min-width: 0 !important; }
  .wrapper {
    width: auto !important;
    max-width: 100% !important;
    padding: 0 15px;
    box-sizing: border-box;
  }
  #maininner,
  #sidebar-a,
  #sidebar-b {
    width: auto !important;
    float: none !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
  }
  #main .grid-block { display: block; }
  #main .grid-box { float: none; width: 100%; }

  /* ===== COMPACT MOBILE HEADER ===== */
  /* Hide the desktop headerbar (table-based logo) on mobile */
  #headerbar {
    display: none !important;
  }

  /* Show mobile header bar */
  #mobile-header-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #fff;
    min-height: 50px;
    box-sizing: border-box;
  }

  /* Mobile logo — centered, takes remaining space */
  #mobile-logo {
    flex: 1;
    text-align: center;
    padding: 0 8px;
    min-width: 0;
  }
  #mobile-logo img {
    height: 45px;
    width: auto;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
  }

  /* Mobile contacts — icons on the right */
  #mobile-contacts {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  #mobile-contacts a {
    display: block;
    line-height: 0;
  }
  #mobile-contacts img {
    width: 28px;
    height: 28px;
  }

  /* Mobile floating cart icon */
  #mobile-cart-icon {
    display: none;
    position: fixed;
    bottom: 120px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    background: #c1433f;
    border-radius: 50%;
    color: #fff;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-decoration: none;
  }
  #mobile-cart-icon svg {
    width: 24px;
    height: 24px;
  }
  #mobile-cart-icon #mobile-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff9800;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  #mobile-cart-icon.has-items {
    display: flex;
  }
  /* На страницах корзина и оформление заказа — скрыть плавающую иконку корзины и иконку рядом с «Корзина» (position: static в сайдбаре) */
  body.page-cart-or-order #mobile-cart-icon,
  body.page-cart-or-order #mobile-cart-icon.has-items {
    display: none !important;
  }
  body.page-cart-or-order .bundle-cart .fa,
  body.page-cart-or-order .bundle-cart .fa-shopping-cart,
  body.page-cart-or-order li.level1 .fa-shopping-cart {
    display: none !important;
  }

  /* Hide toolbar (date bar) on mobile */
  #toolbar {
    display: none !important;
  }

  /* ===== MOBILE HAMBURGER MENU ===== */
  /* Hide hamburger elements on desktop — they are only shown below 959px */
  .mobile-only { display: none; }

  /* Hide desktop menu, show hamburger */
  #menubar { display: none !important; }
  #mobile-menu-toggle { display: block !important; }
  #mobile-menu-overlay { display: none; }

  /* Hamburger button — flex child inside #mobile-header-bar */
  #mobile-menu-toggle {
    width: 44px;
    height: 44px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    z-index: 1101;
    margin: 0;
    background: #c1433f;
    border-radius: 5px;
    padding: 10px 8px;
    box-sizing: border-box;
    transition: all 0.3s ease;
  }
  #mobile-menu-toggle.open {
    position: fixed;
    top: 10px;
    left: 10px;
    margin: 0;
    z-index: 1102;
  }
  #mobile-menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    margin: 4px auto;
    transition: all 0.3s ease;
  }
  /* Animate to X when open */
  #mobile-menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  #mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  #mobile-menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Mobile menu panel (reuses #menubar) */
  #menubar.mobile-open {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 1100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    padding: 60px 0 20px;
    box-sizing: border-box;
    animation: slideInLeft 0.3s ease;
  }
  @keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
  }

  /* Overlay behind menu */
  #mobile-menu-overlay.show {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1099;
  }

  /* ===== Vertical menu inside panel ===== */
  /* Full reset of all desktop menu styling */
  #menubar.mobile-open,
  #menubar.mobile-open * {
    float: none !important;
    background-image: none !important;
  }
  #menubar.mobile-open #menu {
    display: block !important;
  }
  #menubar.mobile-open #menu ul,
  #menubar.mobile-open #menu > ul,
  #menubar.mobile-open .menu-dropdown {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  #menubar.mobile-open .menu-dropdown li,
  #menubar.mobile-open .menu-dropdown li.level1 {
    display: block !important;
    border-bottom: 1px solid #eee;
    position: relative;
    background: none !important;
    margin: 0;
    padding: 0;
    width: 100%;
    clear: both;
  }
  #menubar.mobile-open .menu-dropdown a.level1,
  #menubar.mobile-open .menu-dropdown span.separator.level1,
  #menubar.mobile-open .menu-dropdown span.level1 {
    display: block !important;
    background: none !important;
    text-decoration: none;
  }
  #menubar.mobile-open .menu-dropdown .level1 > span,
  #menubar.mobile-open .menu-dropdown a.level1 > span,
  #menubar.mobile-open .menu-dropdown span.level1 > span {
    display: block !important;
    float: none !important;
    padding: 14px 40px 14px 16px !important;
    font-size: 15px !important;
    height: auto !important;
    line-height: 1.4 !important;
    color: #333 !important;
    background: none !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  #menubar.mobile-open .menu-dropdown li.active a.level1 > span {
    color: #c1433f !important;
    font-weight: bold;
  }

  /* Parent arrow indicator */
  #menubar.mobile-open .menu-dropdown li.parent::after {
    content: "\25BE";
    position: absolute;
    right: 16px;
    top: 14px;
    font-size: 14px;
    color: #999;
    transition: transform 0.3s;
    pointer-events: none;
  }
  #menubar.mobile-open .menu-dropdown li.parent.accordion-open::after {
    transform: rotate(180deg);
  }

  /* Accordion: dropdown submenus — block desktop :hover behaviour */
  #menubar.mobile-open .menu-dropdown li:hover > .dropdown,
  #menubar.mobile-open .menu-dropdown li.remain > .dropdown,
  #menubar.mobile-open .menu-dropdown .dropdown {
    display: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    background: #f8f8f8 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #menubar.mobile-open .menu-dropdown li.accordion-open > .dropdown {
    display: block !important;
  }
  #menubar.mobile-open .dropdown .dropdown-bg,
  #menubar.mobile-open .dropdown .dropdown-bg > div,
  #menubar.mobile-open .dropdown .dropdown-bg > div > div,
  #menubar.mobile-open .dropdown > div,
  #menubar.mobile-open .dropdown > div > div,
  #menubar.mobile-open .dropdown > div > div > div {
    overflow: visible !important;
    width: auto !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #menubar.mobile-open .nav-child {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #menubar.mobile-open .nav-child li {
    border-bottom: 1px solid #eee;
    margin: 0;
    padding: 0;
    background: none !important;
  }
  #menubar.mobile-open .nav-child li:last-child {
    border-bottom: none;
  }
  #menubar.mobile-open .nav-child a {
    display: block !important;
    padding: 12px 16px 12px 32px !important;
    font-size: 14px !important;
    color: #555 !important;
    text-decoration: none !important;
    background: none !important;
    background-image: none !important;
  }
  #menubar.mobile-open .nav-child a:hover,
  #menubar.mobile-open .nav-child a:active {
    background-color: #f0f0f0 !important;
    color: #c1433f !important;
  }
  #menubar.mobile-open .nav-child a > span {
    display: inline !important;
    background: none !important;
    background-image: none !important;
    padding: 0 !important;
  }
  /* Hide menu icons */
  #menubar.mobile-open .nav-child .icon {
    display: none !important;
  }

  /* Cart section in mobile menu */
  #menubar.mobile-open .bundle-cart {
    padding: 12px 16px;
    border-top: 2px solid #c1433f;
    margin-top: 10px;
    background: none !important;
  }
  #menubar.mobile-open #bundle-cart-content {
    font-size: 14px;
    margin-bottom: 8px;
  }
  #menubar.mobile-open .bundle-cart .button {
    width: auto;
    display: inline-block;
    padding: 8px 14px;
    font-size: 13px;
    line-height: 1.3;
    background: #c1433f !important;
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
  }

  /* Hide search and menubar-r in mobile panel */
  #menubar.mobile-open #menubar-r,
  #menubar.mobile-open #search {
    display: none !important;
  }
  /* Hide cart form */
  #menubar.mobile-open #taskForm {
    display: none;
  }

  /* --- Phase 1: Common elements --- */
  /* Radio + label alignment */
  .form-check {
    display: flex !important;
    align-items: center;
    gap: 6px;
  }
  .form-check .form-check-input {
    margin: 0 !important;
    flex-shrink: 0;
  }
  .form-check .form-check-label {
    margin: 0 !important;
  }

  .gapp-win {
    left: 10px !important;
    right: 10px;
    top: 10px !important;
    width: auto !important;
    transform: none;
  }
  .gapp-win .gapp-win-wrapper {
    max-width: none !important;
    max-height: calc(100vh - 40px) !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow-y: auto;
  }
  .gapp-win .close-btn {
    top: 0 !important;
    right: 0 !important;
    z-index: 10;
    background: none !important;
    box-shadow: none !important;
    color: #000 !important;
    font-size: 24px;
    padding: 2px 2px;
  }
  .gapp-win .close-btn i {
    color: #000 !important;
  }

  /* --- Phase 2: Product page --- */
  /* Force all gapp containers to stay within viewport */
  .gapp,
  .gapp form,
  .gapp .formbox,
  .gapp .bndlitems,
  .gapp .bndlitems-ajax,
  .gapp .bndlitems .tbody,
  .gapp .bndlitems-ajax .tbody,
  .gapp .ttabs,
  .gapp .ttabs > div,
  .gapp .ttabs .show,
  .gapp .show {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Clip horizontal overflow only on item containers, NOT on search/form groups */
  .gapp .bndlitems,
  .gapp .bndlitems-ajax,
  .gapp .bndlitems .tbody,
  .gapp .bndlitems-ajax .tbody,
  .gapp .ttabs,
  .gapp .ttabs .show,
  .gapp .show {
    overflow-x: hidden !important;
  }
  /* All tab content containers must be constrained */
  .gapp .ttabs > div {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  /* Bundle items: use flex grid instead of float */
  .gapp .ttabs > div > .show,
  .gapp .ttabs > .show > .show,
  .gapp .show > .show,
  .gapp .ttabs .show {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px;
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    flex: 0 0 100% !important;
  }
  /* Exclude catdesc from flex (it's just a description, not an item grid) */
  .gapp .catdesc {
    display: block !important;
    width: 100% !important;
    flex: 0 0 100% !important;
  }
  .gapp .bndlitem {
    float: none !important;
    box-sizing: border-box !important;
  }
  /* Reset internal bndlitem elements for responsive */
  .gapp .bndlitem .bndlitem-wraper-top {
    display: block !important;
  }
  .gapp .bndlitem .bndlitem-img-wraper {
    float: none !important;
    width: 100% !important;
  }
  .gapp .bndlitem .bndlitem-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }
  .gapp .bndlitem .bndlitem-img img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  .gapp .bndlitem .bndlitem-info-wraper {
    width: 100% !important;
  }
  /* Graphic items (img-small etc): 3 per row on tablet */
  .gapp .bndlitem.img-small {
    width: calc(33.33% - 6px) !important;
    max-width: calc(33.33% - 6px) !important;
  }
  .gapp .bndlitem.img-midle,
  .gapp .bndlitem.img-medium {
    width: calc(33.33% - 6px) !important;
    max-width: calc(33.33% - 6px) !important;
  }
  .gapp .bndlitem.img-large {
    width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
  }
  .gapp .bndlitem.half,
  .gapp .bndlitem.full,
  .gapp .bndlitem.img-small-half,
  .gapp .bndlitem.img-small-full,
  .gapp .bndlitem.img-midle-half,
  .gapp .bndlitem.img-midle-full,
  .gapp .bndlitem.img-medium-half,
  .gapp .bndlitem.img-medium-full,
  .gapp .bndlitem.img-large-half,
  .gapp .bndlitem.img-large-full {
    width: 100% !important;
    max-width: 100%;
  }
  /* Non-graphic items (slide sections): adapt width */
  .gapp .bndlitems.slide .bndlitem:not([class*="img-"]) {
    width: calc(33.33% - 6px) !important;
    max-width: calc(33.33% - 6px) !important;
    box-sizing: border-box !important;
  }
  .gapp .bndlitems.slide .bndlitem img {
    max-width: 100% !important;
    height: auto !important;
  }
  .gapp .bndlitem .bndlitem-description {
    height: auto !important;
  }
  .gapp .bndlitem .bndlitem-description p {
    overflow: visible;
    text-overflow: clip;
  }
  /* Urgency label: override fixed 282px */
  .gapp fieldset.radio.urgency input[type="radio"] + label {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* SKU box position fix */
  .gapp .bndlitem .sku-box {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    text-align: center;
    max-height: none;
    overflow: hidden;
  }
  .gapp .bndlitem .sku-box .sku:nth-child(n+7) {
    display: none !important;
  }
  /* SKU panel */
  .sku-panel .sku-items {
    width: auto !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .sku-panel .sku-items .sku-item {
    float: none;
    flex: 0 0 auto;
  }
  /* Tabs: remove float, flex-wrap for mobile */
  .gapp .tcaps {
    overflow: visible !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0;
  }
  .gapp .tcaps > div {
    float: none !important;
    flex: 1 1 auto;
    text-align: center;
    padding: 6px 8px !important;
    font-size: 13px;
    border-radius: 5px 5px 0 0;
    min-width: 0;
    word-wrap: break-word;
  }
  /* Urgency radios — stack vertically */
  fieldset.radio.urgency .fieldset-data {
    flex-direction: column !important;
  }
  .gapp fieldset.radio.urgency input[type="radio"] + label {
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 0 5px 0 !important;
  }
  /* Special row (entrance, intercom, floor, apartment) — all in one row */
  .special-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px;
  }
  .special-row .special-col {
    flex: 1 1 0 !important;
    width: auto !important;
    box-sizing: border-box;
    margin-bottom: 5px;
  }
  .special-row .special-col label {
    display: block !important;
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
  }
  .special-row .special-col input,
  .special-row .special-col:nth-child(3) input,
  .special-row .special-col:nth-child(4) input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 4px !important;
    font-size: 13px;
  }

  /* --- Phase 3: Cart page --- */
  /* Мобильная: размер шрифта блока «Итого» как у «Стоимость» (fieldset-total) */
  .gapp.order .total.text-center {
    font-size: 2em !important;
  }
  .gapp.order .total.text-center span[data-cart-total] {
    font-size: 1em !important;
  }
  .gapp .controls.pull-right {
    float: none !important;
    margin-bottom: 10px;
    display: flex;
    gap: 5px;
  }
  .gapp .controls.pull-right .button {
    min-width: 0;
    flex: 1;
    text-align: center;
    font-size: 16px;
  }
  .border-card-info {
    margin-right: 0;
    border: 0 !important;
  }
  .gapp.order li img {
    float: none !important;
    display: block;
    margin: 0 auto 10px;
    max-width: 100%;
  }
  /* Cart items list: clean mobile layout */
  .gapp ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
  }
  .gapp ul li {
    list-style: none !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #eee;
    margin: 0 !important;
  }
  .gapp ul li:last-child {
    border-bottom: none;
  }
  .gapp ul li strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
  }
  .gapp ul li ul {
    padding-left: 0 !important;
  }
  .gapp ul li ul li {
    border-bottom: none;
    padding: 5px 0 !important;
  }
  .gapp ul li ul li img {
    float: none !important;
    display: block !important;
    margin: 0 auto 8px !important;
    width: 60px !important;
    height: auto !important;
  }

  /* --- Phase 4: Checkout --- */
  /* Order summary items — single row on mobile too */
  .order-items .order-item {
    flex-wrap: nowrap !important;
  }
  .order-items .order-item > .item-title {
    flex: 1 1 auto !important;
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .order-items .order-item > .item-price {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: bold;
  }
  .order-items .order-item.dlv-cost > .item-title {
    font-size: 12px;
    color: #666;
  }

  /* Delivery time boxes */
  .dlv-time-row .dlv-time-box {
    height: auto;
    min-height: 54px;
    flex-wrap: wrap;
    padding: 5px;
  }
  .dlv-time-row .dlv-time-icon {
    width: 40px;
    flex-shrink: 0;
  }
  .dlv-time-row .dlv-time-main-content {
    width: 0;
    flex: 1 1 0;
    margin-left: 5px;
  }
  .dlv-time-row .dlv-time-logo {
    display: none !important;
  }
  .dlv-time-info-icon {
    margin: 0 5px !important;
    width: 25px !important;
    min-width: 25px !important;
    height: 25px !important;
    flex-shrink: 0;
  }
  .dlv-time-row .dlv-time-cost {
    width: auto;
    min-width: 80px;
    flex-shrink: 0;
    font-size: 1.4em;
    line-height: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 0 3px 3px 0;
  }
  .dlv-time-info-text {
    width: calc(100vw - 80px) !important;
    right: auto !important;
    left: 0;
  }
  /* Address block */
  .checkout-wrapper .gapp.order .addr-check-block {
    flex-direction: column;
  }
  .checkout-wrapper .gapp.order .control-group .inputs-block {
    width: 100%;
  }
  .checkout-wrapper .gapp.order .control-group .addr-check {
    width: 100% !important;
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 0 !important;
    box-sizing: border-box;
    min-height: 44px;
    line-height: 44px;
  }
  .checkout-wrapper .gapp.order .btn-flat {
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center;
    white-space: nowrap;
    min-height: 44px;
    line-height: 44px;
  }
  .checkout-wrapper .gapp.order .btn-flat br {
    display: none;
  }
  /* Form inputs: all same width (except .inputs-block: address, entrance, intercom, floor, apartment) */
  .checkout-wrapper .gapp.order .control-group input[type=text],
  .checkout-wrapper .gapp.order .control-group input[type=email] {
    width: calc(100% - 50px) !important;
    box-sizing: border-box !important;
  }
  .checkout-wrapper .gapp.order .control-group .inputs-block input[type=text],
  .checkout-wrapper .gapp.order .control-group .inputs-block input[type=email] {
    width: 100% !important;
  }
  .checkout-wrapper .gapp.order .control-group label {
    width: auto;
    display: block;
    margin-bottom: 3px;
  }
  /* Phone field: input + plus + delete on one line */
  .checkout-wrapper .gapp.order .fakephone_group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .checkout-wrapper .gapp.order .fakephone_group > label {
    flex: 0 0 100%;
  }
  .checkout-wrapper .gapp.order .fakephone_group .fakephone {
    width: calc(100% - 50px) !important;
    min-width: 0;
    box-sizing: border-box !important;
  }
  .checkout-wrapper .gapp.order .fakephone_group .plusphone,
  .checkout-wrapper .gapp.order .fakephone_group .deletephone {
    flex-shrink: 0;
  }
  /* Delivery options buttons — в одну строчку, 2 колонки */
  .checkout-wrapper .gapp.order .delivery-select {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .checkout-wrapper .gapp.order .delivery-select .delivery-option {
    float: none;
    flex: 1 1 50%;
    width: auto;
    margin: 0;
  }
  /* Map */
  .checkout-wrapper .gapp.order #ymap {
    height: 280px;
  }
  /* Table layout (cco) */
  .ссo-table { display: block; }
  .ссo-row { display: block; margin-bottom: 10px; }
  .ссo-row > .ссo-cell:first-child { width: auto; }
  .ссo-cell { display: block; padding: 2px 0; }
  .ссo-cell > input { width: 100%; }
  /* Payment section */
  .gapp.order #payment { width: 100%; }
  fieldset#jform_payment_method_id {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline;
    gap: 0;
  }
  fieldset#jform_payment_method_id input[type="radio"].jpaycheck-order {
    flex: 0 0 22px !important;
    width: auto !important;
    margin: 0 6px 0 0 !important;
    position: static !important;
  }
  label.jpaycheck-order {
    flex: 1 1 calc(100% - 32px) !important;
    display: block !important;
    margin: 0 0 10px 0 !important;
    font-size: 14px;
    line-height: 1.4;
  }
  /* File upload block inside payment — full row */
  fieldset#jform_payment_method_id .gapp.file-upload {
    flex: 0 0 100% !important;
    margin: 0 0 10px 0;
  }

  /* --- Phase 5: Catalog --- */
  .gapp .bndlitems .bndlcat {
    overflow: visible;
  }
  .page .balloon {
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
    position: fixed;
    left: 10px;
    right: 10px;
    width: auto;
  }

  /* --- Phase 5 extra: Smart Slider and modules overflow fix --- */
  .n2-section-smartslider,
  [class*="n2-ss"],
  .grid-box,
  .module {
    max-width: 100% !important;
    overflow: hidden;
  }

  /* SmartSlider rows: force 1 column ONLY on homepage slider (#n2-ss-15) */
  #n2-ss-15 .n2-ss-layer-row-inner {
    flex-wrap: wrap !important;
  }
  #n2-ss-15 .n2-ss-layer-row-inner > .n2-ss-layer[data-sstype="col"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Other SmartSliders (pricing tables etc): just prevent overflow */
  .n2-ss-layer-row-inner {
    flex-wrap: wrap !important;
  }
  .n2-ss-slider:not(#n2-ss-15) .n2-ss-layer-row-inner > .n2-ss-layer[data-sstype="col"] {
    min-width: 0 !important;
  }

  /* SmartSlider #22: remove excessive padding on mobile */
  div#n2-ss-22 .n-uc-1d6b6ece1a11f-inner {
    padding: 10px !important;
  }

  /* Hide slidetoggle (Развернуть/Свернуть) on mobile */
  .gapp .slidetoggle {
    display: none !important;
  }

  /* Hide specific blocks on mobile */
  .hide-on-mobile {
    display: none !important;
  }

  /* --- Product form: fixed-width overrides --- */
  /* Hide floating total box on mobile */
  .gapp .total.floatbox {
    display: none !important;
  }
  /* Static total block: clean up for mobile */
  .gapp .total .fb-products {
    max-height: none !important;
    overflow: visible !important;
  }
  .gapp .total:not(.floatbox) {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px !important;
    border-radius: 10px;
    border: 2px solid #5f9fcb !important;
    font-size: 1em !important;
    margin: 15px 0;
  }
  .gapp .total:not(.floatbox) .total-header {
    flex-direction: column;
  }
  .gapp .total:not(.floatbox) .fb-urgency {
    width: 100% !important;
    padding: 0 !important;
    margin-bottom: 8px;
  }
  .gapp .total:not(.floatbox) .fb-urgency select {
    width: 100% !important;
    font-size: 13px;
    padding: 6px 4px;
    box-sizing: border-box;
  }
  /* Products table -> block layout on mobile */
  .gapp .total:not(.floatbox) table,
  .gapp .total:not(.floatbox) table tbody,
  .gapp .total:not(.floatbox) .fb-product-row {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
  }
  .gapp .total:not(.floatbox) .fb-product-row:last-child {
    border-bottom: none;
  }
  .gapp .total:not(.floatbox) .fb-product-title {
    flex: 1;
    min-width: 0;
    font-size: 12px !important;
    padding: 0 !important;
    font-weight: bold;
  }
  .gapp .total:not(.floatbox) .fb-product-quantity {
    flex-shrink: 0;
    width: auto !important;
    padding: 0 8px !important;
    font-size: 14px !important;
    text-align: center;
  }
  .gapp .total:not(.floatbox) .fb-product-price {
    flex-shrink: 0;
    width: auto !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: bold;
    color: #c1433f;
    white-space: nowrap;
  }
  .gapp .total:not(.floatbox) .fb-total {
    font-size: 1.2em;
    text-align: right;
    padding-top: 8px;
    border-top: 1px solid #ccc;
    margin-top: 8px;
  }
  .gapp .total:not(.floatbox) .fb-slide-box {
    display: none !important;
  }
  /* File upload label: 358px -> responsive */
  .gapp .fileLabel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .gapp.pfiles .controls .button.add {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  /* Form label/input layout: float -> stack */
  .control-group.text label,
  .control-group.textarea label,
  .control-group.list label,
  .control-group.files label {
    float: none !important;
    width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 5px;
  }
  .control-group.text input,
  .control-group textarea,
  .control-group select {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Itemsizesauto: row -> column */
  .control-group.itemsizesauto {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .control-group.itemsizesauto fieldset {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }
  .control-group.itemsizesauto .itemsizesauto-left {
    width: 100% !important;
    box-sizing: border-box;
    padding: 20px !important;
    margin-bottom: 0 !important;
    text-align: left !important;
  }
  .control-group.itemsizesauto .itemsizesauto-right {
    box-sizing: border-box;
    padding: 0 !important;
    padding-top: 10px !important;
    padding-bottom: 20px !important;
    border: none !important;
    border-top: 1px solid #ccc !important;
    margin: 0 20px !important;
    width: calc(100% - 40px) !important;
    box-shadow: none !important;
    text-align: left !important;
  }
  .itemsizesauto-text {
    width: 100% !important;
    display: block !important;
    margin-bottom: 6px;
    font-size: 13px;
    text-align: left !important;
  }
  .itemsizesauto-usersize,
  .itemsizesauto-autosize {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: 5px;
    width: 100% !important;
  }
  .itemsizesauto-usersize input[type="text"].itemsizesauto-input {
    width: 70px !important;
    flex-shrink: 0;
    box-sizing: border-box;
  }
  .itemsizesauto-label {
    padding: 0 5px !important;
  }
  .itemsizesauto-autosize select {
    width: 100% !important;
    box-sizing: border-box;
    margin-top: 5px;
  }
  .itemsizesauto-autosize .itemsizesauto-value {
    display: block !important;
    width: 100%;
  }
  /* Autocomplete / suggestions: allow visible overflow */
  .gapp .control-group.search {
    overflow: visible !important;
  }
  .suggestions-suggestions {
    max-width: calc(100vw - 20px) !important;
    left: 0 !important;
    width: 100% !important;
  }
  .suggestions-wrapper {
    position: relative;
    overflow: visible !important;
  }

  /* --- Thank you / order complete page --- */
  #system .item {
    text-align: left;
  }
  #system .item h1.title {
    font-size: 24px;
    text-align: center;
  }
  #system .item .content table {
    width: 100% !important;
    border-collapse: collapse;
  }
  #system .item .content table td {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 10px 5px !important;
    height: auto !important;
  }
  #system .item .content table td img {
    display: block;
    margin: 0 auto 10px;
  }
  #system .item .content table td p {
    margin: 0;
  }
  #system .item .content table td span {
    font-size: 22px !important;
  }

  /* --- Phase 6: Polish --- */
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden;
  }
  img {
    max-width: 100%;
    height: auto;
  }
  /* All tables responsive */
  table {
    max-width: 100%;
  }
  /* Content tables (articles): stack cells vertically */
  .content table,
  .moduletable table,
  #system table {
    width: 100% !important;
    table-layout: fixed !important;
  }
  .content table td,
  .moduletable table td,
  #system table td {
    box-sizing: border-box !important;
    word-wrap: break-word;
  }
  /* Forms: fieldsets and control-groups */
  fieldset,
  .control-group,
  .captionbox,
  .gapp fieldset {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Prevent wide hidden inputs from causing overflow */
  input[type="hidden"] {
    width: 0 !important;
    max-width: 0 !important;
  }
}

/* ==========================================================================
   PHONE: max-width 767px
   ========================================================================== */
@media (max-width: 767px) {

  /* --- Phase 0 --- */
  .wrapper { padding: 0 10px; }

  /* Header: stack vertically on phone */
  #header table,
  #header table tbody,
  #header table tr,
  #header table td {
    display: block !important;
    width: 100% !important;
    height: auto !important;
  }
  #header table td {
    text-align: center !important;
    padding: 4px 0;
  }
  #header table td[rowspan] {
    padding-bottom: 8px;
  }
  #header table td img {
    max-width: 250px;
    height: auto !important;
  }
  /* Fix grid-block floats in header */
  #header .grid-block {
    display: block;
  }
  #header .float-left,
  #header .float-right {
    float: none;
    text-align: center;
  }

  /* Navigation is handled by hamburger from 959px breakpoint */

  /* --- Phase 1: Common elements --- */
  .gapp-win {
    left: 5px !important;
    right: 5px;
    top: 5px !important;
    transform: none;
  }
  .gapp-win .gapp-win-wrapper {
    padding: 8px 12px;
    max-height: calc(100vh - 20px);
  }

  /* SmartSlider: force all columns to stack vertically on phone */
  .n2-ss-layer-row-inner > .n2-ss-layer[data-sstype="col"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  /* SmartSlider #25: remove excessive padding on mobile */
  div#n2-ss-25 .n-uc-1vpoeBhxeq6z-inner {
    padding: 10px !important;
  }
  /* SmartSlider force-full-width: reset transform on mobile */
  ss3-force-full-width {
    transform: none !important;
    width: 100% !important;
  }

  /* --- Phase 2: Product page --- */
  /* On phone: 2 items per row for graphic items */
  .gapp .bndlitem.img-small {
    width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
  }
  .gapp .bndlitem.img-midle,
  .gapp .bndlitem.img-medium {
    width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
  }
  .gapp .bndlitem[class*="img-"][class*="-half"],
  .gapp .bndlitem[class*="img-"][class*="-full"] {
    width: 100% !important;
    max-width: 100% !important;
  }
  .gapp .bndlitem .bndlitem-img,
  .gapp .bndlitem .bndlitem-img img {
    width: 100% !important;
    max-width: 100% !important;
  }
  .gapp .bndlitem .bndlitem-img-wraper {
    float: none;
    width: 100%;
  }
  /* Non-graphic items (slide sections): 2 per row */
  .gapp .bndlitems.slide .bndlitem:not([class*="img-"]) {
    width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
  }
  /* Form page: ensure all containers don't overflow */
  .gapp fieldset,
  .gapp .control-group {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  /* But NOT on search control-group (autocomplete needs visible overflow) */
  .gapp .control-group.search {
    overflow: visible !important;
  }
  .gapp fieldset.radio label,
  .gapp fieldset.radio input[type="radio"] + label {
    width: 100% !important;
    box-sizing: border-box;
  }
  .gapp fieldset.radio input[type="radio"] {
    float: none !important;
    display: block;
  }
  /* Content tables: fully stacked on phone */
  .content table,
  .content table tbody,
  .content table tr,
  .content table td,
  .moduletable table,
  .moduletable table tbody,
  .moduletable table tr,
  .moduletable table td {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
  }
  .content table td[colspan],
  .moduletable table td[colspan] {
    text-align: center;
  }
  .content table td,
  .moduletable table td {
    padding: 6px 8px !important;
  }
  /* Tabs: full width, scroll */
  .gapp .tcaps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .gapp .tcaps > div {
    white-space: normal;
  }
  /* Bundle slides */
  .bundle-slides {
    max-width: 100% !important;
  }
  /* Urgency radio labels */
  .gapp fieldset.radio input[type="radio"] + label,
  .gapp fieldset.radio.urgency input[type="radio"] + label {
    width: 100% !important;
    box-sizing: border-box;
    font-size: 14px;
  }
  .gapp fieldset.radio input[type="radio"] {
    float: none !important;
  }
  /* Special row: keep single row on phone */
  .special-row {
    flex-wrap: nowrap !important;
  }

  /* --- Phase 3: Cart page --- */
  .gapp .controls.pull-right .button {
    font-size: 14px;
    padding: 8px 10px;
  }

  /* --- Phase 4: Checkout --- */
  .checkout-wrapper .gapp.order #ymap {
    height: 250px;
  }
  .dlv-time-row .dlv-time-header {
    white-space: normal !important;
    overflow: visible !important;
  }
  .dlv-time-row .dlv-time-header > h6 {
    font-size: 100%;
    display: block !important;
  }
  .dlv-time-row .dlv-time-header > span {
    display: block !important;
    margin-left: 0 !important;
    font-size: 12px;
  }
  .dlv-time-row .dlv-time-cost {
    font-size: 1.2em;
    min-width: 70px;
  }
  .dlv-time-unknown-cost {
    font-size: 11px;
  }
  /* Checkout total section */
  .checkout-wrapper .gapp.order .total {
    max-width: 100%;
  }
  .total-header {
    flex-direction: column;
  }
  .checkout-wrapper .gapp.order .total .forms td {
    font-size: 14px;
  }
  /* Navigation controls */
  .gapp.order .nav.controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .gapp.order .nav.controls .button.pull-left {
    position: static;
  }

  /* --- Phase 6: Polish --- */
  /* Touch targets */
  .gapp .controls .button,
  .checkout-wrapper .gapp.order .btn-flat,
  .bundle-cart .button {
    min-height: 44px;
    line-height: 44px;
    padding: 0 12px;
  }
  .dlv-time-row .dlv-time-box {
    min-height: 54px;
  }
  /* Readable font sizes */
  .dlv-time-row .dlv-time-range > span,
  .dlv-time-row .dlv-time-range > div > span {
    font-size: 12px;
  }
}

/* ==========================================================================
   SMALL PHONE: max-width 479px
   ========================================================================== */
@media (max-width: 479px) {

  /* --- Phase 0 --- */
  .wrapper { padding: 0 0px; }

  /* --- Phase 2: Product page --- */
  /* 2 columns for graphic items on small phone */
  .gapp .bndlitem.img-small,
  .gapp .bndlitem.img-midle,
  .gapp .bndlitem.img-medium,
  .gapp .bndlitem[class*="img-"],
  .gapp .bndlitems.slide .bndlitem:not([class*="img-"]) {
    width: calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
  }
  /* Full-width items stay single column */
  .gapp .bndlitem.half,
  .gapp .bndlitem.full,
  .gapp .bndlitem[class*="-half"],
  .gapp .bndlitem[class*="-full"] {
    width: 100% !important;
    max-width: 100% !important;
  }
  /* Special row: keep single row on small phones */
  .special-row {
    flex-wrap: nowrap !important;
  }

  /* --- Phase 4: Checkout --- */
  /* Delivery time boxes: simplified layout */
  .dlv-time-row .dlv-time-box {
    flex-wrap: wrap;
    height: auto;
    padding: 8px;
  }
  .dlv-time-row .dlv-time-icon {
    width: 30px;
    font-size: 22px;
    line-height: 36px;
  }
  .dlv-time-row .dlv-time-logo {
    display: none !important;
  }
  .dlv-time-row .dlv-time-main-content {
    flex: 1 1 0;
    min-width: 0;
  }
  .dlv-time-row .dlv-time-cost {
    flex: 0 0 100% !important;
    width: 100% !important;
    border-radius: 0 0 3px 3px;
    min-width: 0;
    font-size: 1.2em;
    line-height: 32px;
    box-sizing: border-box;
    text-align: center;
    margin-top: 5px;
  }
  .dlv-time-row .dlv-time-text {
    width: 100%;
  }
  .dlv-time-info-text {
    width: calc(100vw - 40px) !important;
  }
  .checkout-wrapper .gapp.order #ymap {
    height: 200px;
  }

  /* --- Phase 5: Catalog --- */
  .page .balloon .balloon-wrapper {
    padding: 25px;
    font-size: 18px;
  }

  form.box fieldset {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  /* --- Phase 6: Polish --- */
  .checkout-wrapper .gapp.order .total div.order-cost > span {
    font-size: 14px;
    padding: 8px 10px;
  }
  .checkout-wrapper .gapp.order .total .forms td {
    font-size: 13px;
  }
}



/* таблица с ценами и сроками изготовления */
/* На ПК: блок 50% ширины и по центру */
@media (min-width: 992px){
  .table-wrap{
    width: 50%;
    margin: 0 auto;
  }
}

/* На узких экранах: при необходимости будет горизонтальная прокрутка */
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* сетка 3 колонки + скругление углов */
.price-grid{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  border: 1px solid #dcdcdc;
  border-radius: 5px;
  overflow: hidden;
}

/* ячейки */
.price-grid > .cell{
  float: none !important;
  width: auto !important;
  max-width: none !important;

  padding: 4px 12px;
  box-sizing: border-box;

  text-align: center;
  vertical-align: middle;

  border-right: 1px solid #dcdcdc;
  border-bottom: 1px solid #dcdcdc;
}

/* край 3-й колонки */
.price-grid > .cell:nth-child(3n){
  border-right: 0;
}

/* общий заголовок */
.price-grid > .cell.title{
  grid-column: 1 / -1;
  font-weight: 700;
  text-align: center;
  background: #fff;
  border-right: 0;
}

/* заголовки колонок */
.price-grid > .head{
  font-weight: 700;
  white-space: normal;
  color: #fff;
}

/* раскраска заголовков колонок (после title это элементы 2-4) */
.price-grid > .cell:nth-child(2){ background: #2e9e4d !important; } /* Стандарт */
.price-grid > .cell:nth-child(3){ background: #f39c12 !important; } /* Срочно */
.price-grid > .cell:nth-child(4){ background: #d63b3b !important; } /* Экспресс */

/* "(24 часа)" не переносим внутри */
.price-grid .th-sub{
  white-space: nowrap;
  display: inline-block;
}

/* ===== ЦЕНЫ: убрать ВСЕ вертикальные перегородки и задать размер шрифта ===== */
.price-grid > .cell.price{
  border-right: 0 !important;   /* убрать перегородки между колонками в строках с ценами */
  font-size: 14px;              /* <-- размер шрифта цен */
  padding-top: 4px;
  padding-bottom: 4px;
}

/* обычные цены */
.price-grid > .old{
  text-decoration: none;
  opacity: 1;
  color: #333;
  font-weight: 700; /* жирный для 400/700/1000 */
}

/* спец. цены — красным */
.price-grid > .new{
  color: #d63b3b;
  font-weight: 700;
}

/* ===== Примечания: одна ячейка на всю ширину ===== */
.price-grid > .cell.note{
  grid-column: 1 / -1 !important;
  text-align: left !important;

  border-right: 0 !important;
  border-bottom: 0 !important; /* низ таблицы без дополнительной линии */

  font-size: 0.9em;
  line-height: 1.35;
  color: #333;
  background: #fff;
}

/* отступ между строками внутри примечания */
.price-grid > .cell.note > div + div{
  margin-top: 6px;
}

/* красная строка примечания */
.price-grid .note-red{
  color: #d63b3b;
  font-weight: 100;
  text-align: center;
}





/* =========================
   Слайдер + таблица 50/50
   ========================= */
.slider-price-wrap {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.slider-block,
.price-block {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
}

.slider-block img,
.slider-block iframe,
.slider-block object,
.slider-block embed,
.slider-block .n2-ss-slider,
.slider-block .n2-section-smartslider,
.slider-block .nextend-smart-slider,
.slider-block .n2-ss-align {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  box-sizing: border-box;
}

/* =========================
   Новая таблица: 4 колонки
   ========================= */
.table-wrap-4 {
  width: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.price-grid-4 {
  display: grid !important;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  width: 100%;
  border: 1px solid #dcdcdc;
  border-radius: 5px;
  overflow: hidden;
  background: #dcdcdc;
  gap: 1px;
  box-sizing: border-box;
}

.price-grid-4 > .cell {
  padding: 4px 4px;
  box-sizing: border-box;
  background: #f2f2f2;
  color: #333;
  font-size: 16px;
  line-height: 1.3;
  text-align: center;

  display: flex;
  align-items: center;
  justify-content: center;
}

.price-grid-4 > .title {
  grid-column: 1 / -1;
  font-weight: 700;
  background: #fff;
  font-size: 14px;
}

.price-grid-4 > .head {
  font-weight: 700;
  color: #fff;
  flex-direction: column;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  padding: 6px 4px;
}

.price-grid-4 > .size-head {
  background: #7f7f7f;
}

.price-grid-4 > .std-head {
  background: #2e9e4d;
}

.price-grid-4 > .rush-head {
  background: #f39c12;
}

.price-grid-4 > .express-head {
  background: #d63b3b;
}

.price-grid-4 .th-sub {
  display: block;
  white-space: normal;
  font-size: 13px;
  line-height: 1.1;
}

.price-grid-4 > .price {
  font-weight: 700;
}

.price-grid-4 > .new {
  color: #d63b3b;
}

.price-grid-4 > .span-3 {
  grid-column: 2 / 5;
  font-weight: 700;
}

/* =========================
   Мобильная версия
   ========================= */
@media (max-width: 768px) {
  .slider-price-wrap {
    flex-direction: column;
  }

  .slider-block,
  .price-block {
    width: 100%;
    max-width: 100%;
  }

  .price-grid-4 {
    grid-template-columns: 1.15fr 1fr 1fr 1fr;
  }

  .price-grid-4 > .cell {
    padding: 7px 4px;
    font-size: 15px;
    line-height: 1.2;
  }

  .price-grid-4 > .title {
    font-size: 13px;
    padding: 6px 4px;
  }

  .price-grid-4 > .head {
    font-size: 13px;
    line-height: 1.1;
    padding: 7px 3px;
  }

  .price-grid-4 .th-sub {
    font-size: 13px;
    line-height: 1.1;
  }
}