/* Mobile refinements for the existing storefront. Loaded after ui.css. */
/* Astra's rendered mobile header includes 922px on this pinned release. */
@media (max-width:922px) {
  body.drku-system #ast-mobile-header .main-header-menu .menu-link {
    display:flex; align-items:center; min-height:48px; padding:12px 20px;
    font-size:15px; line-height:1.5; letter-spacing:normal; text-transform:none;
  }
  body.drku-system #ast-mobile-header .ast-mobile-header-content {
    max-height:calc(var(--drku-viewport-height,100dvh) - var(--drku-menu-top,120px) - 8px);
    overflow-y:auto; overscroll-behavior:contain; padding-bottom:env(safe-area-inset-bottom);
  }
  body.drku-system #ast-mobile-header button.menu-toggle { min-width:48px; min-height:48px; }
}
@media (max-width:921px) {
  body.drku-system :is(input[type=text],input[type=email],input[type=password],input[type=search],input[type=number],input[type=tel],textarea,select) {
    font-size:16px!important; min-height:48px;
  }
  body.drku-system :is(.drki-toc a,.drki-more,.drkh-text-link,.drki-dock-picker) {
    display:inline-flex; align-items:center; min-height:44px;
  }
  body.drku-system .drkm input[type=range] { height:44px; touch-action:pan-y; }
  body.drku-system .drkm input[type=range]::-webkit-slider-thumb { width:24px; height:24px; margin-top:-9.5px; }
  body.drku-system .drkm input[type=range]::-moz-range-thumb { width:18px; height:18px; }
  body.drku-system .drkm .drkm-channel-source>a { min-height:44px; align-items:center; }
  body.drku-system .drkm .drkm-channel-source small { font-size:12px; line-height:1.5; }
  body.drku-system .drkm .drkm-channel-state { font-size:12px; line-height:1.5; }
  body.drku-system .drkm :is(.drkm-mixer-heading p,.drkm-mixer-help,.drkm-mixer-footer) { font-size:12px; line-height:1.6; }
  body.drku-system .drkm .drkm-scene-badge { font-size:10px; }
  /* Use one scrollable surface with a reachable close control, including when
     the software keyboard reduces the visible viewport. */
  body.drku-system .drkm .drkm-catalog-dialog {
    max-height:calc(var(--drku-viewport-height,100dvh) - 24px);
    top:calc(var(--drku-viewport-top,0px) + 12px); bottom:auto; margin-block:0;
    padding:16px; overflow-y:auto; overscroll-behavior:contain;
    scroll-padding-top:140px; scrollbar-gutter:stable;
  }
  body.drku-system .drkm .drkm-catalog-dialog[open] { display:block; height:auto; }
  body.drku-system .drkm .drkm-catalog-dialog>header {
    position:sticky; top:-16px; z-index:2; padding-block:12px;
    margin-top:-12px; margin-bottom:12px; background:var(--paper);
    border-bottom:1px solid var(--line);
  }
  body.drku-system .drkm .drkm-catalog-dialog>header button { flex-shrink:0; }
  body.drku-system .drkm .drkm-catalog-list { max-height:none; min-height:0; overflow:visible; }
  body.drku-system .drkm .drkm-catalog-tabs button { font-size:13px; min-height:48px; }
  body.drku-system .drkm .drkm-catalog-tabs small { font-size:12px; }
  body.drku-system .drkm .drkm-sound-pick strong { font-size:14px; }
  body.drku-system .drkm .drkm-sound-pick small { font-size:12px; }
  body.drku-system:has(.drka-banner:not([hidden])) :is(.drki-dock,.drkc-mobile-buy,.drkn-sticky),
  body.drku-system.drku-keyboard-open :is(.drki-dock,.drkc-mobile-buy,.drkn-sticky) { visibility:hidden; }
}
@media (max-width:700px) {
  /* The former 36px columns collided with the actual 44px controls. */
  body.drku-system .drkm .drkm-channel-heading { grid-template-columns:28px minmax(0,1fr) 44px 44px; gap:2px 6px; }
  body.drku-system .drkm .drkm-channel-heading:not(:has(.drkm-layer-alone)) { grid-template-columns:28px minmax(0,1fr) 44px; }
  body.drku-system .drkm .drkm-channel-heading:not(:has(.drkm-layer-alone)) .drkm-remove-layer { grid-column:3; }
  body.drku-system .drkm .drkm-channel-heading:not(:has(.drkm-layer-alone,.drkm-remove-layer)) { grid-template-columns:28px minmax(0,1fr); }
  body.drku-system .drkm :is(.drkm-channel-source>a,button.drkm-layer-name) { font-size:14px; }
  body.drku-system .drkm .drkm-channel-volume output { font-size:13px; }
  body.drku-system .drkm .drkm-transport { gap:12px; }
  body.drku-system .drkm button.drkm-play { min-width:0; flex:1; max-width:210px; }
}
@media (max-width:600px) {
  body.drku-system.drks-shop #content>.ast-container { padding-inline:16px!important; }
  body.drku-system .drkc-loop-toolbar { flex-direction:column; align-items:stretch; gap:8px; }
  body.drku-system.drkc-catalog .drkc-loop-toolbar .woocommerce-ordering { flex:none; width:100%; }
  body.drku-system.drkc-catalog .drkc-loop-toolbar .woocommerce-result-count { font-size:14px; }
  body.drku-system.drkc-catalog .drkc-loop-toolbar select { width:100%; padding:10px 34px 10px 12px; }
  body.drku-system .drkc-tools-foot { flex-direction:column; gap:0; padding-bottom:12px; }
  body.drku-system .drkc-topic-picker { width:100%; }
  body.drku-system .drkc-tools-foot>a { width:100%; }
  body.drku-system .drka-banner {
    bottom:0; left:0; width:100%; max-height:70dvh;
    padding:16px max(16px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
    border-radius:16px 16px 0 0; overflow-y:auto; overscroll-behavior:contain;
  }
  body.drku-system .drka-banner p { margin:8px 0 12px; line-height:1.5; }
  body.drku-system .drka-actions button { min-height:48px!important; padding:10px 8px!important; font-size:13px!important; }
  /* Astra's :not() selector includes a second ID; keep a usable text column. */
  body.drku-system.drkco-checkout :is(#order_review,#order_review_heading) { padding-left:16px!important; padding-right:16px!important; }
  body.drku-system.drkco-checkout #order_review .shop_table :is(th,td) { padding-inline:0; }
  body.drku-system.drkco-checkout #order_review .shop_table :is(.product-total,td:last-child) { padding-left:12px; }
  body.drku-system.drkco-checkout #order_review .product-name { overflow-wrap:break-word; }
  body.drku-system.drkco-checkout #payment .woocommerce-info { padding:16px; }
  body.drku-system.drkco-checkout #payment .woocommerce-info::before { position:static; margin-right:8px; }
  body.drku-system.woocommerce-cart .woocommerce-cart-form tr.cart_item { grid-template-columns:64px minmax(0,1fr); gap:12px; padding:16px; }
  body.drku-system.woocommerce-cart .woocommerce-cart-form tr.cart_item td.product-thumbnail img { width:64px; height:64px; }
  body.drku-system.woocommerce-cart .woocommerce-cart-form tr.cart_item td.product-name { padding-right:24px; }
}
/* On short screens, reading and the main product form remain unobstructed. */
@media (max-width:921px) and (max-height:520px) {
  body.drku-system .drki-dock { position:static; }
  body.drku-system.drki-page { padding-bottom:0!important; }
  body.drku-system .drkc-mobile-buy { display:none; }
  body.drku-system.single-product { padding-bottom:0; }
  body.drku-system .drka-banner { max-height:80dvh; }
  body.drku-system .drkm .drkm-catalog-dialog>header .drkm-eyebrow { display:none; }
  body.drku-system .drkm .drkm-catalog-dialog>header { padding-block:8px; }
}
@media (forced-colors:active) {
  body.drku-system .drkm input[type=range] { appearance:auto; -webkit-appearance:auto; }
}
