nav.ad-mobile-tabbar {
  display: none;
}

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    background: #f4f5f7;
  }

  img,
  svg,
  video,
  iframe,
  canvas {
    max-width: 100%;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
    font-size: 16px !important;
  }

  /* ===== Нижнее меню ===== */
  nav.ad-mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100050;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 6px 4px env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid #e6e8eb;
    box-shadow: 0 -8px 28px rgba(17, 18, 19, 0.08);
  }

  .ad-mobile-tabbar a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #8a9299;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--ad-font, Manrope, sans-serif);
    min-height: 48px;
  }

  .ad-mobile-tabbar a i {
    font-size: 18px;
    line-height: 1;
  }

  .ad-mobile-tabbar a.is-active {
    color: var(--ad-accent, #ff5722);
  }

  .ad-mobile-tabbar__badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e30613;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
  }

  .ad-mobile-tabbar__badge:empty,
  .ad-mobile-tabbar__badge[data-counter="0"] {
    display: none;
  }

  body.ad-vin-modal-open .ad-mobile-tabbar {
    display: none;
  }

  /* ===== Шапка ===== */
  .elementor-location-header {
    position: sticky;
    top: 0;
    z-index: 100040;
    background: #fff !important;
    box-shadow: 0 2px 16px rgba(17, 18, 19, 0.08);
    padding-top: env(safe-area-inset-top, 0px);
  }

  .elementor-element-84be048 > .elementor-container,
  .elementor-element-999868c > .elementor-container {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 8px 10px !important;
    padding: 8px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .elementor-element-d4ed366 {
    grid-column: 1;
    grid-row: 1;
    width: auto !important;
  }

  .elementor-element-f098ce1 {
    grid-column: 2;
    grid-row: 1;
    width: auto !important;
    justify-self: end;
  }

  .elementor-element-735e9cb {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100% !important;
    order: 10;
  }

  .elementor-element-a247102,
  .elementor-element-9031b59,
  .elementor-element-13fe07b,
  .elementor-element-0e3918e,
  .elementor-element-0e3918e .elementor-nav-menu--main,
  .elementor-menu-toggle,
  .elementor-element-91e1df1 {
    display: none !important;
  }

  .elementor-hidden-mobile.elementor-element-6c62a5c,
  .elementor-element-6c62a5c.elementor-hidden-mobile,
  .elementor-element-6c62a5c {
    display: block !important;
    width: 100% !important;
  }

  .elementor-element-fed8296 img {
    max-height: 32px !important;
    width: auto !important;
    max-width: 150px !important;
  }

  .elementor-search-form,
  .elementor-search-form__container {
    width: 100% !important;
    max-width: 100% !important;
  }

  .elementor-search-form__input {
    font-size: 16px !important;
    min-height: 44px;
    border-radius: 12px !important;
    width: 100% !important;
  }

  .elementor-menu-cart__toggle_button .elementor-button-text {
    display: none !important;
  }

  /* ===== Главная ===== */
  .elementor-38 .elementor-element.elementor-element-647fdcb {
    display: none !important;
  }

  .elementor-element-a1e441c .elementor-heading-title {
    font-size: 1.4rem !important;
    line-height: 1.25 !important;
  }

  .elementor-element-94898ff {
    font-size: 14px !important;
  }

  .elementor-element-89138b3 > .elementor-container,
  .elementor-element-57cb028 .elementor-form-fields-wrapper,
  .elementor-element-ad5a20f > .elementor-widget-wrap,
  .elementor-element-49440e2 > .elementor-container,
  .elementor-element-dbbf8c5 .elementor-container,
  .elementor-element-de73dd7 > .elementor-container,
  .elementor-element-9d8ac76 > .elementor-container {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }

  .elementor-element-89138b3 {
    margin: 12px !important;
    border-radius: 18px;
    overflow: hidden;
  }

  .elementor-38 .elementor-element.elementor-element-a0b137b {
    padding: 1rem 12px 0.25rem !important;
  }

  .elementor-column {
    width: 100% !important;
    max-width: 100% !important;
  }

  .elementor-38 .elementor-section .elementor-container {
    flex-wrap: wrap !important;
    gap: 12px;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .elementor-cta,
  .elementor-cta__bg-wrapper,
  .elementor-cta__bg {
    min-height: 180px !important;
  }

  .elementor-countdown-wrapper {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* ===== VIN / каталог разделов ===== */
  .ad-vin-section {
    padding: 1rem 12px 1.25rem !important;
  }

  .ad-vin-grid,
  .ad-vin-form {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
  }

  .ad-vin-card {
    padding: 18px !important;
    border-radius: 18px !important;
  }

  .ad-vin-form button,
  .ad-vin-expert-btn {
    width: 100%;
    justify-content: center;
  }

  .ad-catalog-section {
    padding: 1rem 12px 1.5rem !important;
  }

  .ad-catalog-panel {
    padding: 18px 14px !important;
    border-radius: 18px !important;
  }

  .ad-catalog-panel h2 {
    font-size: 1.2rem !important;
    line-height: 1.3;
  }

  .ad-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .ad-catalog-card {
    border-radius: 16px;
    padding: 16px 10px !important;
  }

  .ad-catalog-card__icon {
    width: 56px !important;
    height: 56px !important;
  }

  .ad-catalog-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ad-catalog-actions a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* ===== Сетки товаров ===== */
  .elementor-products-grid .products,
  .woocommerce.columns-4 .products,
  .woocommerce ul.products,
  .ad-page-section .woocommerce ul.products,
  .ad-vin-modal__products .products,
  .ad-sp-related .products,
  .ad-products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    align-items: start !important;
    gap: 12px !important;
  }

  .woocommerce ul.products li.product,
  .elementor-products-grid .product {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    float: none !important;
    align-self: start !important;
    justify-content: flex-start !important;
    background: #fff;
    border-radius: 16px;
    padding: 10px 8px 12px !important;
    box-shadow: 0 4px 16px rgba(17, 18, 19, 0.05);
    overflow: hidden;
    box-sizing: border-box !important;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__link {
    flex: 0 0 auto !important;
    min-height: 0;
  }

  .woocommerce-loop-product__title {
    font-size: 12px !important;
    -webkit-line-clamp: 2 !important;
    min-height: 0 !important;
    margin: 6px 0 8px !important;
  }

  .woocommerce ul.products li.product .ad-stars {
    font-size: 10px;
    margin: 0 0 8px !important;
  }

  .woocommerce ul.products li.product .price,
  .woocommerce ul.products li.product .ad-add-by-price {
    margin: 0 !important;
    margin-top: auto !important;
  }

  .ad-add-by-price__label,
  .woocommerce ul.products li.product .price ins {
    min-height: 34px !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
  }

  .ad-product-brand {
    margin: 6px 0 0 !important;
    font-size: 10px !important;
  }

  .ad-product-photo__car {
    font-size: 10px;
    padding: 4px 6px;
  }

  /* ===== Внутренние страницы ===== */
  .ad-page-section {
    padding: 0.85rem 12px 1.5rem !important;
  }

  .ad-page-inner {
    padding: 0 !important;
    width: 100%;
  }

  .ad-page-title {
    font-size: 1.35rem !important;
    line-height: 1.25;
  }

  .ad-category-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .ad-vehicle-panel,
  .ad-panel,
  .ad-empty-panel {
    border-radius: 16px !important;
    padding: 16px !important;
  }

  .ad-btn,
  .ad-btn--block,
  .elementor-button {
    min-height: 46px;
    width: auto;
    max-width: 100%;
  }

  .ad-btn--block {
    width: 100%;
  }

  /* ===== Карточка товара ===== */
  .ad-sp {
    grid-template-columns: 1fr !important;
    padding: 14px !important;
    border-radius: 18px !important;
    gap: 16px !important;
  }

  .ad-sp__gallery {
    position: static !important;
  }

  .ad-sp__media {
    border-radius: 14px !important;
    aspect-ratio: 1;
  }

  .ad-sp__title {
    font-size: 1.2rem !important;
    line-height: 1.3;
  }

  .ad-sp__codes,
  .ad-sp__top,
  .ad-sp__perks {
    flex-wrap: wrap;
  }

  .ad-sp__price {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .ad-sp__buy {
    position: sticky;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    gap: 8px;
    margin: 0 -14px -14px !important;
    padding: 10px 14px 12px;
    background: #fff;
    box-shadow: 0 -10px 24px rgba(17, 18, 19, 0.08);
  }

  .ad-sp__vin-btn {
    grid-column: 1 / -1;
  }

  .ad-sp__cart-btn,
  .ad-sp__vin-btn,
  .ad-sp__qty {
    height: 46px !important;
  }

  .ad-sp-panel {
    border-radius: 16px !important;
    padding: 16px !important;
  }

  .ad-sp-panels {
    grid-template-columns: 1fr !important;
  }

  .ad-sp-bc .ad-bc__current {
    max-width: 18ch;
  }

  /* ===== Корзина ===== */
  .ad-cart-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ad-cart-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    grid-template-areas:
      "img name remove"
      "img meta meta";
    gap: 8px 12px;
    align-items: start;
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(17, 18, 19, 0.05);
  }

  .ad-cart-item__img {
    grid-area: img;
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #f6f6f6;
    border-radius: 10px;
  }

  .ad-cart-item__main {
    grid-area: name;
    min-width: 0;
  }

  .ad-cart-item__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.35;
    color: inherit;
    text-decoration: none;
  }

  .ad-cart-item__meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }

  .ad-cart-item__remove {
    grid-area: remove;
    border: 0;
    background: #f2f3f5;
    color: #5b636a;
    border-radius: 10px;
    min-width: 36px;
    min-height: 36px;
    font-weight: 800;
    cursor: pointer;
  }

  .ad-qty {
    width: 72px;
    min-height: 40px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
  }

  .ad-cart-total {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
    margin-top: 16px !important;
    position: sticky;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    padding: 14px;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(17, 18, 19, 0.1);
  }

  .ad-cart-total .ad-btn {
    width: 100%;
  }

  .ad-table {
    display: block;
  }

  .ad-table thead {
    display: none;
  }

  .ad-table tbody,
  .ad-table tr,
  .ad-table td {
    display: block;
    width: 100%;
  }

  .ad-table tr {
    background: #fff;
    border-radius: 14px;
    margin-bottom: 10px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(17, 18, 19, 0.05);
  }

  .ad-table td {
    padding: 6px 0 !important;
    border: 0 !important;
  }

  .ad-order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ad-order-card {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(17, 18, 19, 0.05);
    display: grid;
    gap: 8px;
  }

  .ad-order-card__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
  }

  .ad-order-card__row span {
    color: #707980;
  }

  .ad-account-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px !important;
  }

  .ad-account-actions .ad-btn {
    width: 100%;
    justify-content: center;
    margin: 0 !important;
  }

  /* ===== Контакты / формы ===== */
  .ad-contact-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .ad-reviews-grid {
    grid-template-columns: 1fr !important;
  }

  .ad-reviews__card {
    min-width: 0 !important;
    width: 100%;
  }

  /* ===== Футер ===== */
  .elementor-location-footer {
    padding-bottom: 16px !important;
  }

  .elementor-location-footer .elementor-container,
  .elementor-location-footer .elementor-section .elementor-container {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }

  .elementor-location-footer .elementor-column {
    width: 100% !important;
  }

  /* ===== Модалки / чат / тосты ===== */
  .ad-vin-modal {
    padding: 0 !important;
    align-items: stretch !important;
    z-index: 100060;
  }

  .ad-vin-modal__dialog {
    width: 100% !important;
    max-height: 100% !important;
    height: 100%;
    border-radius: 0 !important;
    padding: 16px 14px 24px !important;
  }

  .ad-chat-fab {
    right: 12px !important;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .ad-chat-panel {
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    bottom: calc(144px + env(safe-area-inset-bottom, 0px)) !important;
    height: min(520px, calc(100dvh - 220px)) !important;
  }

  .ad-cart-toasts {
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    bottom: calc(148px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 380px) {
  .ad-catalog-grid,
  .elementor-products-grid .products,
  .woocommerce.columns-4 .products,
  .woocommerce ul.products,
  .ad-products-grid {
    grid-template-columns: 1fr !important;
  }

  .ad-account-actions {
    grid-template-columns: 1fr;
  }

  .ad-add-by-price__label {
    font-size: 14px !important;
  }
}

@media (min-width: 901px) {
  .ad-cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1.6fr) 120px 110px 90px auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 16px;
  }

  .ad-cart-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ad-cart-item__img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #f6f6f6;
    border-radius: 10px;
  }

  .ad-cart-item__name {
    font-weight: 700;
    color: inherit;
    text-decoration: none;
  }

  .ad-cart-item__meta {
    display: contents;
  }

  .ad-cart-item__remove {
    border: 0;
    background: #f2f3f5;
    color: #5b636a;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .ad-order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ad-order-card {
    display: grid;
    grid-template-columns: 70px 1.2fr 1fr 1fr 1.4fr auto;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px;
  }

  .ad-order-card__row span {
    display: none;
  }

  .ad-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .ad-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
}
