/**
 * Mobile artboard chrome — MUST load after theme.css.
 * theme.css uses !important globally; this file restores prod mobile header,
 * bottom nav, and buttons without breaking catalog cqw cards in styles.css.
 */
@media (max-width: 720px) {
  body[data-layout="mobile"] {
    background: radial-gradient(ellipse at 20% 45%, #00132988, transparent 55%),
      #000 !important;
    color: #c7c8ca !important;
  }

  body[data-layout="mobile"] .m-topbar,
  body[data-layout="mobile"] .m-topbar.m-topbar-compact,
  body[data-layout="mobile"] #app > .m-topbar {
    display: flex !important;
    position: relative !important;
    z-index: 4 !important;
    visibility: visible !important;
    align-items: center !important;
    height: 54px !important;
    margin: 13px 13px 0 !important;
    padding: 0 20px !important;
    gap: 14px !important;
    border: 1px solid #477aaf !important;
    border-top-color: #b9d4e9 !important;
    border-radius: 19px !important;
    background: radial-gradient(ellipse at 100% 0, #14366b99, transparent 55%),
      linear-gradient(130deg, #081a35, #03070a 75%) !important;
    box-shadow: inset 0 2px 4px #7e9ebc55 !important;
  }

  body[data-layout="mobile"] .m-logo {
    flex-shrink: 0 !important;
    width: 72px !important;
    margin-right: auto !important;
    display: flex !important;
  }

  body[data-layout="mobile"] .m-logo img {
    width: 100% !important;
    height: 30px !important;
    object-fit: contain !important;
    filter: none !important;
  }

  body[data-layout="mobile"] .m-top-link {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 10px !important;
    color: #bfc1c5 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  body[data-layout="mobile"] .m-points {
    height: 32px !important;
    min-width: 54px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 0 9px !important;
    border: 1px solid #416083 !important;
    border-radius: 12px !important;
    background: radial-gradient(ellipse at 80% 100%, #132d5c, #020b1b) !important;
    box-shadow: inset 0 1px 3px #a8bace55 !important;
    font-size: 15px !important;
    color: #d5dcea !important;
  }

  /* Bottom dock → bottom-dock.css (footer tone + catalog hub) */

  body[data-layout="mobile"] .m-primary,
  body[data-layout="mobile"] .m-secondary,
  body[data-layout="mobile"] a.m-primary,
  body[data-layout="mobile"] button.m-primary {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 43px !important;
    border-radius: 17px !important;
    border: 1px solid #1679d2 !important;
    border-top-color: #c5dbef !important;
  }

  body[data-layout="mobile"] .m-primary,
  body[data-layout="mobile"] a.m-primary,
  body[data-layout="mobile"] button.m-primary {
    background: linear-gradient(115deg, #0b3774, #0b2b61) !important;
    color: #ccd5e5 !important;
    box-shadow: inset 0 2px 4px #a6cbed88 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
  }

  body[data-layout="mobile"] .m-secondary {
    background: linear-gradient(125deg, #091a29, #06101a) !important;
    border-color: #2075b2 !important;
    border-top-color: #d0d9e1 !important;
    border-bottom-color: #b4cbdf !important;
    margin-top: 9px !important;
  }

  body[data-layout="mobile"] .mp-dock .m-primary {
    border-radius: 17px !important;
    min-height: 43px !important;
  }

  body[data-mobile-dock="1"] #main.shell {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  body[data-mobile-dock="1"] .footer-links {
    padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  body[data-mobile-dock="1"] .support-launcher {
    bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  body[data-mobile-dock="1"] #toast {
    bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* —— Koszyk + Polecenia (desktop pages on narrow + bottom dock) —— */
  body[data-mobile-dock="1"] #main.shell > .breadcrumb {
    margin-inline: 0.15rem;
  }

  body[data-mobile-dock="1"] .filled-cart {
    padding: 0 0.35rem;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-heading h1 {
    font-size: clamp(1.65rem, 7vw, 2rem) !important;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.1rem !important;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-products,
  body[data-mobile-dock="1"] .filled-cart .summary-panel {
    padding: 1rem 0.9rem !important;
    border: 1px solid #1e5086 !important;
    border-radius: 1.25rem !important;
    background: rgba(2, 12, 28, 0.92) !important;
    box-shadow: none !important;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-products > .section-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0 0 1rem;
    margin: 0 0 0.5rem;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    padding: 1rem 0.5rem !important;
    min-height: 0 !important;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-product {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-product > img {
    width: 4.5rem !important;
    height: 4.5rem !important;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-cell {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }
  body[data-mobile-dock="1"] .filled-cart .cart-cell > strong {
    font-size: 1.35rem !important;
  }
  body[data-mobile-dock="1"] .cart-list-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }
  body[data-mobile-dock="1"] .filled-cart .smart-cart,
  body[data-mobile-dock="1"] .filled-cart .suggestion {
    padding-inline: 0.35rem !important;
  }

  body[data-mobile-dock="1"] .desktop-empty-cart {
    padding: 0 0.35rem 1.5rem;
  }
  body[data-mobile-dock="1"] .desktop-empty-cart .dec-heading {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
    min-height: 0 !important;
    padding-top: 0.5rem !important;
  }
  body[data-mobile-dock="1"] .desktop-empty-cart .dec-heading .delivery-banner,
  body[data-mobile-dock="1"] .desktop-referral-guest .dec-heading .delivery-banner {
    display: none !important;
  }
  body[data-mobile-dock="1"] .desktop-empty-cart .dec-frame {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem !important;
    margin: 0 !important;
    border: 1px solid #17438a !important;
    border-radius: 1.25rem !important;
    background: linear-gradient(#01050c, #000) !important;
  }
  body[data-mobile-dock="1"] .desktop-empty-cart .dec-visual {
    height: auto !important;
    min-height: 12rem !important;
    padding: 1rem !important;
    display: block !important;
  }
  body[data-mobile-dock="1"] .desktop-empty-cart .dec-art,
  body[data-mobile-dock="1"] .desktop-empty-cart .dec-art > img {
    position: static !important;
    width: min(16rem, 82vw) !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
  }
  body[data-mobile-dock="1"] .desktop-empty-cart .dec-continue {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0.5rem 0 0 !important;
    transform: none !important;
  }
  body[data-mobile-dock="1"] .desktop-empty-cart .dec-message {
    text-align: center !important;
    padding: 0.5rem 0 0 !important;
  }

  body[data-mobile-dock="1"] .referral-account .page {
    padding: 0 0.35rem 1rem;
  }
  body[data-mobile-dock="1"] .referral-account .page-head {
    margin-bottom: 1.25rem !important;
  }
  body[data-mobile-dock="1"] .referral-account-panel {
    padding: 0 0.15rem !important;
  }
  body[data-mobile-dock="1"] .referral-top {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
  }
  body[data-mobile-dock="1"] .referral-account .copy-box {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1rem !important;
    gap: 0.75rem !important;
    border-radius: 1.15rem !important;
  }
  body[data-mobile-dock="1"] .referral-account .copy-box input {
    width: 100% !important;
    font-size: 0.85rem !important;
    text-align: left !important;
  }
  body[data-mobile-dock="1"] .referral-account .copy-box button {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 2.85rem !important;
    font-size: 0.8rem !important;
  }
  body[data-mobile-dock="1"] .referral-account .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    padding: 0.85rem !important;
    margin-bottom: 1.5rem !important;
  }
  body[data-mobile-dock="1"] .referral-account .stat {
    padding: 0.85rem 0.75rem !important;
  }
  body[data-mobile-dock="1"] .referral-account .stat strong {
    font-size: 1.45rem !important;
  }
  body[data-mobile-dock="1"] .referral-account .friend-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin-top: 1.25rem !important;
  }
  body[data-mobile-dock="1"] .referral-account .friend {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  body[data-mobile-dock="1"] .referral-account .friend em {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 0.25rem;
  }

  body[data-mobile-dock="1"] .desktop-referral-guest {
    padding: 0 0.35rem 1rem !important;
  }
}