/* Opto Zero v3.85 — mobile cart + mobile list final layout.
   Mobile only. Desktop is intentionally untouched. */

@media (max-width: 767px) {
  /* ================================================================
     CART — compact, stable, no horizontal drift/overflow
     ================================================================ */
  #checkout-cart.oc-cart-page-v35,
  #checkout-cart.oc-cart-page-v35 * {
    box-sizing: border-box;
  }

  #checkout-cart.oc-cart-page-v35 {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table-wrap,
  #checkout-cart.oc-cart-page-v35 .table-responsive,
  #checkout-cart.oc-cart-page-v35 .oc-cart-table,
  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    grid-template-areas:
      "image name"
      "image price"
      "qty qty"
      "total total" !important;
    column-gap: 9px !important;
    row-gap: 3px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 0 8px !important;
    padding: 9px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 > td {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 > td:nth-child(1) {
    grid-area: image !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 > td:nth-child(2) {
    grid-area: name !important;
    padding-right: 0 !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 > td:nth-child(3) {
    display: none !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 > td:nth-child(4) {
    grid-area: qty !important;
    display: block !important;
    width: 100% !important;
    margin: 6px 0 0 !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 > td:nth-child(5) {
    grid-area: price !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 5px !important;
    width: auto !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 > td:nth-child(6) {
    position: static !important;
    grid-area: total !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 100% !important;
    margin: 3px 0 0 !important;
    padding: 6px 0 0 !important;
    border-top: 1px solid #edf2f7 !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table > tbody > tr.oc-cart-line-v383 > td:nth-child(6)::before {
    content: "Итого" !important;
    margin-right: auto !important;
    color: #8b99aa !important;
    font-size: 10px !important;
    font-weight: 700 !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-table .img-thumbnail {
    display: block !important;
    width: 62px !important;
    height: 62px !important;
    padding: 4px !important;
    border-radius: 11px !important;
    object-fit: contain !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-product-name {
    display: -webkit-box !important;
    margin: 0 0 2px !important;
    overflow: hidden !important;
    font-size: 12.5px !important;
    line-height: 1.22 !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }

  #checkout-cart .oc-cart-sale-mode-v383 {
    max-width: 100% !important;
    margin-top: 3px !important;
    padding: 3px 7px !important;
    font-size: 8.5px !important;
    line-height: 1.15 !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-price {
    font-size: 10.5px !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-line-total {
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  /* Smaller +/-; noticeably wider numeric input. */
  #checkout-cart .oc-cart-line-actions-v383 {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 38px !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #checkout-cart .oc-cart-stepper-v383 {
    display: grid !important;
    grid-template-columns: 34px minmax(88px, 1fr) 34px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 11px !important;
  }

  #checkout-cart .oc-cart-step-v383,
  #checkout-cart .oc-cart-line-qty-v383 {
    height: 38px !important;
    min-height: 38px !important;
  }

  #checkout-cart .oc-cart-step-v383 {
    width: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    font-size: 19px !important;
  }

  #checkout-cart .oc-cart-line-qty-v383 {
    width: 100% !important;
    min-width: 78px !important;
    max-width: none !important;
    padding: 0 8px !important;
    font-size: 16px !important;
    line-height: 38px !important;
  }

  #checkout-cart .oc-cart-remove-v383 {
    width: 38px !important;
    min-width: 38px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-bottom {
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-totals-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 11px !important;
    border-radius: 14px !important;
  }

  #checkout-cart.oc-cart-page-v35 .oc-cart-page-actions {
    width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
  }
}

/* ================================================================
   v3.86 — MOBILE LIST: keep the previous v3.73/v3.82 card design.
   ONLY the quantity control proportions are changed:
   smaller +/- buttons, wider manual quantity field.
   ================================================================ */
@media (max-width: 767px) {
  .oc-products-grid.oc-list-view .oc-product-card.oc-product-card .oc-qty-control,
  .oc-home-products.oc-list-view .oc-product-card.oc-product-card .oc-qty-control,
  .search-grid-fix.oc-list-view .oc-product-card.oc-product-card .oc-qty-control {
    display: grid !important;
    grid-template-columns: 32px minmax(86px, 1fr) 32px !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
  }

  .oc-products-grid.oc-list-view .oc-product-card.oc-product-card .oc-qty-btn,
  .oc-home-products.oc-list-view .oc-product-card.oc-product-card .oc-qty-btn,
  .search-grid-fix.oc-list-view .oc-product-card.oc-product-card .oc-qty-btn {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    font-size: 19px !important;
  }

  .oc-products-grid.oc-list-view .oc-product-card.oc-product-card .oc-qty-input,
  .oc-home-products.oc-list-view .oc-product-card.oc-product-card .oc-qty-input,
  .search-grid-fix.oc-list-view .oc-product-card.oc-product-card .oc-qty-input {
    width: 100% !important;
    min-width: 86px !important;
    max-width: none !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 9px !important;
    font-size: 16px !important;
    line-height: 42px !important;
    text-align: center !important;
  }
}

@media (max-width: 370px) {
  .oc-products-grid.oc-list-view .oc-product-card.oc-product-card .oc-qty-control,
  .oc-home-products.oc-list-view .oc-product-card.oc-product-card .oc-qty-control,
  .search-grid-fix.oc-list-view .oc-product-card.oc-product-card .oc-qty-control {
    grid-template-columns: 30px minmax(78px, 1fr) 30px !important;
  }

  .oc-products-grid.oc-list-view .oc-product-card.oc-product-card .oc-qty-btn,
  .oc-home-products.oc-list-view .oc-product-card.oc-product-card .oc-qty-btn,
  .search-grid-fix.oc-list-view .oc-product-card.oc-product-card .oc-qty-btn {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
  }
}
