/* Mitsoli v1.6.0 — mobile usability & accessibility */
@media (max-width: 991px) {
  html, body { max-width:100%; overflow-x:hidden; }

  /* Universal touch/focus */
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline:2px solid #2F1727!important;
    outline-offset:2px!important;
  }

  /* Header: keep core actions touchable without changing desktop */
  header .wishlist-info a,
  header #search button,
  header .navbar-toggle,
  header .dropdown-toggle {
    min-width:44px;
    min-height:44px;
  }

  /* Category tools */
  #product-category .mitsoli-catalog-tools {
    display:flex!important;
    align-items:stretch!important;
    gap:8px!important;
  }
  #product-category .mitsoli-catalog-search { min-width:0!important; }
  #product-category #mitsoli-catalog-query {
    min-height:44px!important;
    height:44px!important;
  }
  #product-category .mitsoli-query-clear,
  #product-category .mitsoli-filter-toggle,
  #product-category .mitsoli-filter-close {
    min-width:44px!important;
    min-height:44px!important;
  }

  /* Filter drawer */
  #product-category .mitsoli-filter-panel-head { min-height:58px!important; }
  #product-category .mitsoli-filter-option { min-height:44px!important; }
  #product-category .mitsoli-size-option span {
    min-width:48px!important;
    height:44px!important;
  }
  #product-category .mitsoli-filter-reset,
  #product-category .mitsoli-filter-apply {
    min-height:48px!important;
  }
  #product-category .mitsoli-filter-apply {
    background:#2F1727!important;
    border-color:#2F1727!important;
    color:#fff!important;
  }
  #product-category .mitsoli-filter-apply:hover,
  #product-category .mitsoli-filter-apply:focus {
    background:#402837!important;
    border-color:#402837!important;
  }
  #product-category .mitsoli-filter-option input:checked + .mitsoli-check-ui,
  #product-category .mitsoli-size-option input:checked + span {
    background:#2F1727!important;
    border-color:#2F1727!important;
  }

  /* Sorting/limit */
  #product-category .category_filter { margin:8px 0 16px!important; }
  #product-category .category_filter .pagination-right {
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:8px!important;
    flex-wrap:wrap!important;
  }
  #product-category .category_filter .sort-by-wrapper,
  #product-category .category_filter .show-wrapper {
    display:flex!important;
    align-items:center!important;
    width:auto!important;
  }
  #product-category .category_filter .sort-by,
  #product-category .category_filter .show {
    width:auto!important;
    padding:0 6px 0 0!important;
  }
  #product-category .category_filter .sort,
  #product-category .category_filter .limit {
    width:auto!important;
    padding:0!important;
  }
  #product-category .category_filter select.form-control {
    min-height:44px!important;
    height:44px!important;
  }

  /* Product detail options/variants */
  #product-product .mitsoli-product-variant {
    min-height:44px!important;
  }
  #product-product .mitsoli-v15-choice span,
  #product-product .mitsoli-v15-option .form-control {
    min-height:44px!important;
  }
}

@media (max-width: 767px) {
  body { padding-bottom:0; }

  /* Header */
  #top { font-size:11px!important; }
  header .header-container { padding-top:6px!important; padding-bottom:6px!important; }
  header #logo img { max-height:46px!important; width:auto!important; }

  /* Category header/tools */
  #product-category .page-title {
    font-size:24px!important;
    margin-bottom:12px!important;
  }
  #product-category .mitsoli-wholesale-note {
    margin:10px 0 14px!important;
    padding:10px 11px!important;
  }
  #product-category .mitsoli-wholesale-note strong { font-size:12px!important; }
  #product-category .mitsoli-wholesale-note span { font-size:10.5px!important; }

  #product-category .mitsoli-catalog-tools {
    position:sticky!important;
    top:0!important;
    z-index:50!important;
    padding:6px 0!important;
    margin:6px 0 10px!important;
    background:#fff!important;
  }
  #product-category .mitsoli-filter-toggle {
    padding:0 11px!important;
    font-size:12px!important;
  }

  /* Keep 2-column cards readable */
  #product-category .mitsoli-v15-grid {
    margin-left:-5px!important;
    margin-right:-5px!important;
    row-gap:20px!important;
  }
  #product-category .mitsoli-v15-grid > .product-layout {
    width:50%!important;
    max-width:50%!important;
    flex:0 0 50%!important;
    padding-left:5px!important;
    padding-right:5px!important;
  }
  #product-category .mitsoli-v15-wishlist {
    width:44px!important;
    height:44px!important;
    top:7px!important;
    right:7px!important;
  }
  #product-category .mitsoli-v15-swatches-overlay {
    left:7px!important;
    bottom:7px!important;
    gap:5px!important;
    padding:5px 6px!important;
  }
  #product-category .mitsoli-v15-swatches .mitsoli-card-variant {
    width:28px!important;
    height:28px!important;
    flex-basis:28px!important;
  }
  #product-category .mitsoli-v15-card-body {
    padding-top:8px!important;
  }
  #product-category .mitsoli-v15-card.is-model-only .mitsoli-v15-card-title {
    font-size:14px!important;
    gap:5px!important;
  }
  #product-category .mitsoli-v15-card.has-product-name .mitsoli-v15-card-title {
    font-size:11.5px!important;
    line-height:1.3!important;
    max-height:30px!important;
  }
  #product-category .mitsoli-v15-card-title span {
    font-size:8px!important;
  }
  #product-category a.mitsoli-v15-contact.mitsoli-v158-cta,
  #product-category a.mitsoli-v15-contact.mitsoli-v158-cta:hover,
  #product-category a.mitsoli-v15-contact.mitsoli-v158-cta:focus {
    height:44px!important;
    min-height:44px!important;
    padding:0 30px 0 8px!important;
    font-size:8px!important;
    letter-spacing:.07em!important;
  }
  #product-category .mitsoli-v158-cta-arrow {
    right:9px!important;
    font-size:13px!important;
  }
  #product-category .mitsoli-load-more {
    min-height:48px!important;
    width:min(100%,320px)!important;
  }

  /* Drawer */
  #product-category .mitsoli-filter-panel {
    width:min(92vw,390px)!important;
  }
  #product-category .mitsoli-filter-panel-body {
    height:calc(100dvh - 126px)!important;
    padding-bottom:18px!important;
  }
  #product-category .mitsoli-filter-panel-foot {
    padding-bottom:calc(12px + env(safe-area-inset-bottom))!important;
  }

  /* Product detail: touch-first */
  #product-product .mitsoli-v15-product-hero {
    display:block!important;
    margin-bottom:24px!important;
  }
  #product-product .mitsoli-v15-gallery {
    display:block!important;
    width:100%!important;
  }
  #product-product .mitsoli-v15-main-media {
    width:100%!important;
    touch-action:pan-y!important;
  }
  #product-product .mitsoli-v15-main-media #tmzoom {
    width:100%!important;
    max-height:none!important;
    object-fit:contain!important;
  }
  #product-product .mitsoli-v15-detail-wishlist {
    width:44px!important;
    height:44px!important;
    top:10px!important;
    right:10px!important;
  }
  #product-product .mitsoli-v15-thumbs-wrap {
    margin-top:8px!important;
  }
  #product-product .mitsoli-v15-thumbs {
    display:flex!important;
    flex-direction:row!important;
    gap:7px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity!important;
    -webkit-overflow-scrolling:touch!important;
    padding:2px 1px 8px!important;
  }
  #product-product .mitsoli-v15-thumbs > a {
    flex:0 0 62px!important;
    width:62px!important;
    height:78px!important;
    scroll-snap-align:start!important;
  }

  #product-product .mitsoli-v15-product-panel {
    position:static!important;
    padding-top:18px!important;
  }
  #product-product .mitsoli-v15-product-title {
    font-size:25px!important;
    line-height:1.15!important;
  }
  #product-product .mitsoli-v15-wholesale-box {
    margin:15px 0!important;
    padding:11px!important;
  }
  #product-product .mitsoli-product-variant-list {
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:7px!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
    padding-bottom:5px!important;
  }
  #product-product .mitsoli-product-variant {
    flex:0 0 70px!important;
    width:70px!important;
    min-width:70px!important;
  }
  #product-product .mitsoli-product-variant img {
    height:80px!important;
  }

  /* Sticky CTA with safe-area support */
  #product-product .mitsoli-v15-actions {
    position:sticky!important;
    bottom:0!important;
    z-index:30!important;
    margin:18px -15px 0!important;
    padding:10px 15px calc(10px + env(safe-area-inset-bottom))!important;
    background:rgba(255,255,255,.97)!important;
    border-top:1px solid #e5dce2!important;
    box-shadow:0 -8px 20px rgba(47,23,39,.06)!important;
    backdrop-filter:blur(8px)!important;
  }
  #product-product .mitsoli-v15-detail-contact {
    min-height:50px!important;
    height:50px!important;
  }
  #product-product .mitsoli-v15-help { display:none!important; }

  /* Prevent accidental horizontal overflow */
  #product-category img,
  #product-product img { max-width:100%; }
}

@media (max-width: 390px) {
  #product-category .mitsoli-filter-toggle .fa { display:none!important; }
  #product-category .mitsoli-filter-toggle { font-size:11px!important; padding:0 9px!important; }
  #product-category .mitsoli-v15-card.is-model-only .mitsoli-v15-card-title { font-size:13px!important; }
  #product-category a.mitsoli-v15-contact.mitsoli-v158-cta { font-size:7.5px!important; }
}

@media (max-width: 360px) {
  #product-category .mitsoli-catalog-tools { gap:5px!important; }
  #product-category .mitsoli-v15-grid { margin-left:-4px!important; margin-right:-4px!important; }
  #product-category .mitsoli-v15-grid > .product-layout { padding-left:4px!important; padding-right:4px!important; }
}


/* v1.7.0 mobile stabilization */
@media (max-width: 767px) {
  /* Mobile catalogue should start with content, not utility bars */
  #top { display:none!important; }
  #product-product > .breadcrumb { display:none!important; }
  .wrap-breadcrumb.parallax-breadcrumb { min-height:0!important; height:0!important; padding:0!important; margin:0!important; border:0!important; overflow:hidden!important; }

  /* Old demo hero is intentionally hidden on mobile */
  body.common-home .main-slider { display:none!important; }

  /* Product gallery: compact first viewport and clean stacking */
  #product-product .mitsoli-v15-gallery,
  #product-product .mitsoli-v15-main-media,
  #product-product .mitsoli-v15-thumbs-wrap,
  #product-product .mitsoli-v15-product-panel {
    float:none!important;
    clear:both!important;
    width:100%!important;
    max-width:100%!important;
  }
  #product-product .mitsoli-v15-main-media {
    height:58dvh!important;
    min-height:390px!important;
    max-height:520px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    background:#fff!important;
    overflow:hidden!important;
  }
  #product-product .mitsoli-v15-main-media #tmzoom {
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    object-position:center!important;
  }
  #product-product .mitsoli-v15-thumbs-wrap {
    display:block!important;
    margin:8px 0 0!important;
  }
  #product-product .mitsoli-v15-thumbs {
    width:100%!important;
    max-width:100%!important;
  }
  #product-product .mitsoli-v15-product-panel {
    display:block!important;
    padding-top:14px!important;
    margin:0!important;
  }
  #product-product .mitsoli-v15-kicker {
    margin-top:0!important;
  }
  #product-product .mitsoli-v15-product-title {
    margin-top:0!important;
  }

  /* Keep Safari bottom UI from covering the last product actions */
  body.common-home,
  body.product-category {
    padding-bottom:calc(28px + env(safe-area-inset-bottom))!important;
  }
}

@media (max-width: 390px) {
  #product-product .mitsoli-v15-main-media {
    height:56dvh!important;
    min-height:360px!important;
  }
}
