/* DivyaKart v27: compact category view and unobstructed mobile checkout. */

@media (max-width: 800px) {
  /* A cart or checkout is a full-screen task. The fixed app navigation must
     not cover payment choices or the final action button. */
  body.cart-open,
  body.modal-open {
    overflow: hidden !important;
  }

  body.cart-open .app-bottom-nav,
  body.modal-open .app-bottom-nav {
    display: none !important;
    pointer-events: none !important;
  }

  .overlay {
    z-index: 790 !important;
  }

  .cart-drawer {
    z-index: 800 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(430px, 100vw) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
    -webkit-overflow-scrolling: touch;
  }

  .cart-header {
    position: sticky !important;
    z-index: 3 !important;
    top: 0 !important;
    min-height: 70px !important;
    flex: 0 0 auto !important;
    padding: max(17px, env(safe-area-inset-top)) 20px 15px !important;
    background: #fff !important;
  }

  .cart-header h2 {
    font-size: 27px !important;
  }

  .cart-items {
    overflow: visible !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    padding: 7px 18px !important;
  }

  .empty-cart {
    min-height: 92px !important;
    padding: 28px 8px !important;
    font-size: 13px !important;
  }

  .cart-summary {
    flex: 0 0 auto !important;
    padding: 15px 20px calc(28px + env(safe-area-inset-bottom)) !important;
    background: #fff !important;
  }

  .cart-summary .checkout,
  #checkoutButton,
  .checkout-form > .button[type="submit"] {
    display: block !important;
    width: 100% !important;
    min-height: 50px !important;
    margin: 14px 0 8px !important;
    padding: 14px 18px !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 2 !important;
  }

  .checkout-modal-panel {
    padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important;
    scroll-padding-bottom: 140px !important;
  }

  #orderForm {
    padding-bottom: calc(36px + env(safe-area-inset-bottom)) !important;
  }

  /* Category detail should replace the home hero, not appear below it. */
  body.category-detail-view #home {
    display: none !important;
  }

  body.category-detail-view .category-page {
    padding: 10px 12px calc(84px + env(safe-area-inset-bottom)) !important;
  }

  .category-back {
    margin: 0 0 8px !important;
    min-height: 34px !important;
  }

  .category-banner {
    display: block !important;
    overflow: hidden !important;
    min-height: 0 !important;
    border-radius: 10px !important;
    background: #fff !important;
  }

  .category-banner img,
  #categoryBannerImage {
    display: block !important;
    width: 100% !important;
    height: 108px !important;
    min-height: 108px !important;
    max-height: 108px !important;
    object-fit: cover !important;
    object-position: center 48% !important;
  }

  .category-banner > div {
    padding: 11px 13px 13px !important;
  }

  .category-banner h1 {
    font-size: 20px !important;
    line-height: 1.15 !important;
  }

  .category-banner p:not(.eyebrow) {
    display: -webkit-box !important;
    overflow: hidden !important;
    margin-top: 5px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .category-page-heading {
    margin: 16px 0 10px !important;
  }
}
