/* Wild Ember mobile-only override layer
   Step 2: mobile header/navigation system
   Desktop remains untouched.
*/

:root {
  --we-mobile-breakpoint: 767px;
  --we-tablet-breakpoint: 991px;
  --we-ember: #8e431b;
  --we-ember-2: #a95d2d;
  --we-cream: #fff7f0;
  --we-ink: #2f2118;
  --we-panel: #f7f2eb;
  --we-border: #d9cbbb;
}

@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html[data-mobile-enhanced="true"] body.menu-open {
    overflow: hidden;
  }

  html[data-mobile-enhanced="true"] header .nav-wrap {
    display: grid !important;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
  }

  html[data-mobile-enhanced="true"] header .logo {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  html[data-mobile-enhanced="true"] header .logo img {
    max-width: 230px !important;
    width: 100%;
    height: auto;
  }

  html[data-mobile-enhanced="true"] header nav {
    display: none !important;
  }

  html[data-mobile-enhanced="true"] header .nav-right {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
  }

  html[data-mobile-enhanced="true"] header .nav-right .social-links {
    display: none !important;
  }

  html[data-mobile-enhanced="true"] [data-cart-link] {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--we-border);
    color: var(--we-ink) !important;
    text-decoration: none !important;
  }

  html[data-mobile-enhanced="true"] [data-cart-link] i {
    font-size: 1.2rem;
  }

  html[data-mobile-enhanced="true"] .mobile-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 1.5px solid var(--we-border);
    background: var(--we-panel);
    color: var(--we-ink);
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(47, 33, 24, 0.04);
    padding: 0;
  }

  html[data-mobile-enhanced="true"] .mobile-menu-toggle:hover {
    background: #efe5db;
    border-color: #cdb9a3;
  }

  html[data-mobile-enhanced="true"] .mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--we-ember-2);
    outline-offset: 2px;
  }

  html[data-mobile-enhanced="true"] .mobile-menu-toggle-icon,
  html[data-mobile-enhanced="true"] .mobile-menu-toggle-icon::before,
  html[data-mobile-enhanced="true"] .mobile-menu-toggle-icon::after {
    display: block;
    width: 22px;
    height: 2.5px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  html[data-mobile-enhanced="true"] .mobile-menu-toggle-icon {
    position: relative;
  }

  html[data-mobile-enhanced="true"] .mobile-menu-toggle-icon::before {
    position: absolute;
    top: -7px;
    left: 0;
  }

  html[data-mobile-enhanced="true"] .mobile-menu-toggle-icon::after {
    position: absolute;
    top: 7px;
    left: 0;
  }

  html[data-mobile-enhanced="true"] body.menu-open .mobile-menu-toggle-icon {
    background: transparent;
  }

  html[data-mobile-enhanced="true"] body.menu-open .mobile-menu-toggle-icon::before {
    transform: translateY(7px) rotate(45deg);
  }

  html[data-mobile-enhanced="true"] body.menu-open .mobile-menu-toggle-icon::after {
    transform: translateY(-7px) rotate(-45deg);
  }

  html[data-mobile-enhanced="true"] .mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 14, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 9998;
  }

  html[data-mobile-enhanced="true"] body.menu-open .mobile-nav-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(88vw, 360px);
    height: 100dvh;
    background: #fffdfb;
    border-left: 1px solid var(--we-border);
    box-shadow: -10px 0 30px rgba(25, 19, 16, 0.12);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
  }

  html[data-mobile-enhanced="true"] body.menu-open .mobile-nav-panel {
    transform: translateX(0);
  }

  html[data-mobile-enhanced="true"] .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid #eee2d5;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--we-ink);
    text-transform: uppercase;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--we-border);
    background: var(--we-panel);
    color: var(--we-ink);
    cursor: pointer;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-body {
    padding: 0.75rem 1rem 1.25rem;
    overflow-y: auto;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-list a {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: var(--we-panel);
    color: var(--we-ink);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid #eee2d5;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-list a:hover {
    background: #efe5db;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-meta {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee2d5;
    display: grid;
    gap: 0.65rem;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-meta a {
    color: var(--we-ember);
    text-decoration: none;
    font-weight: 700;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.35rem;
  }

  html[data-mobile-enhanced="true"] .mobile-nav-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: var(--we-panel);
    border: 1px solid #eee2d5;
    color: var(--we-ink);
    text-decoration: none;
  }

  html[data-mobile-enhanced="true"] .top-bar {
    font-size: 0.92rem !important;
    line-height: 1.35 !important;
    padding: 0.55rem 0.9rem !important;
  }
}

@media (max-width: 767px) {
  html[data-mobile-enhanced="true"] header .nav-wrap {
    grid-template-columns: 1fr auto auto;
    gap: 0.6rem;
  }

  html[data-mobile-enhanced="true"] header .logo img {
    max-width: 190px !important;
  }

  html[data-mobile-enhanced="true"] .top-bar {
    font-size: 0.88rem !important;
    padding: 0.5rem 0.75rem !important;
  }
}


/* Step 2 refinement: remove duplicate legacy menu control and tighten header */
@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] header .nav-wrap {
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
    gap: 0.5rem !important;
  }

  html[data-mobile-enhanced="true"] header .logo img {
    max-width: 200px !important;
  }

  html[data-mobile-enhanced="true"] .top-bar {
    padding: 0.45rem 0.75rem !important;
  }

  html[data-mobile-enhanced="true"] .mobile-menu-toggle {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
  }

  html[data-mobile-enhanced="true"] [data-cart-link] {
    width: 44px !important;
    height: 44px !important;
  }

  /* Hide common legacy/duplicate menu buttons on mobile,
     while preserving the new injected .mobile-menu-toggle */
  html[data-mobile-enhanced="true"] .menu-toggle:not(.mobile-menu-toggle),
  html[data-mobile-enhanced="true"] .hamburger:not(.mobile-menu-toggle),
  html[data-mobile-enhanced="true"] .mobile-menu-button:not(.mobile-menu-toggle),
  html[data-mobile-enhanced="true"] .nav-toggle:not(.mobile-menu-toggle),
  html[data-mobile-enhanced="true"] .toggle-menu:not(.mobile-menu-toggle),
  html[data-mobile-enhanced="true"] .menu-button:not(.mobile-menu-toggle),
  html[data-mobile-enhanced="true"] button[aria-label*="menu" i]:not(.mobile-menu-toggle),
  html[data-mobile-enhanced="true"] button[aria-label*="navigation" i]:not(.mobile-menu-toggle) {
    display: none !important;
  }
}

@media (max-width: 767px) {
  html[data-mobile-enhanced="true"] header .logo img {
    max-width: 170px !important;
  }

  html[data-mobile-enhanced="true"] header .nav-wrap {
    gap: 0.45rem !important;
  }
}


/* Step 3: mobile-only hero + spacing cleanup
   Goal: make pages feel intentionally mobile-sized without touching desktop.
*/

@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] main,
  html[data-mobile-enhanced="true"] section,
  html[data-mobile-enhanced="true"] .section,
  html[data-mobile-enhanced="true"] .content-section,
  html[data-mobile-enhanced="true"] .shop-section,
  html[data-mobile-enhanced="true"] .page-section {
    scroll-margin-top: 90px;
  }

  html[data-mobile-enhanced="true"] .hero,
  html[data-mobile-enhanced="true"] .hero-section,
  html[data-mobile-enhanced="true"] .page-hero,
  html[data-mobile-enhanced="true"] .shop-hero,
  html[data-mobile-enhanced="true"] .home-hero,
  html[data-mobile-enhanced="true"] .banner,
  html[data-mobile-enhanced="true"] .masthead {
    min-height: auto !important;
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }

  html[data-mobile-enhanced="true"] .hero-content,
  html[data-mobile-enhanced="true"] .hero-inner,
  html[data-mobile-enhanced="true"] .page-hero-content,
  html[data-mobile-enhanced="true"] .shop-hero-content {
    max-width: 100% !important;
  }

  html[data-mobile-enhanced="true"] .hero h1,
  html[data-mobile-enhanced="true"] .hero-section h1,
  html[data-mobile-enhanced="true"] .page-hero h1,
  html[data-mobile-enhanced="true"] .shop-hero h1,
  html[data-mobile-enhanced="true"] .home-hero h1,
  html[data-mobile-enhanced="true"] .banner h1,
  html[data-mobile-enhanced="true"] .masthead h1 {
    font-size: clamp(2.1rem, 7.2vw, 3.15rem) !important;
    line-height: 0.96 !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 0.9rem !important;
    max-width: 12ch;
  }

  html[data-mobile-enhanced="true"] .hero h2,
  html[data-mobile-enhanced="true"] .hero-section h2,
  html[data-mobile-enhanced="true"] .page-hero h2,
  html[data-mobile-enhanced="true"] .shop-hero h2,
  html[data-mobile-enhanced="true"] .home-hero h2,
  html[data-mobile-enhanced="true"] .banner h2,
  html[data-mobile-enhanced="true"] .masthead h2 {
    font-size: clamp(1.6rem, 5vw, 2.3rem) !important;
    line-height: 1.05 !important;
    margin-bottom: 0.8rem !important;
  }

  html[data-mobile-enhanced="true"] .hero p,
  html[data-mobile-enhanced="true"] .hero-section p,
  html[data-mobile-enhanced="true"] .page-hero p,
  html[data-mobile-enhanced="true"] .shop-hero p,
  html[data-mobile-enhanced="true"] .home-hero p,
  html[data-mobile-enhanced="true"] .banner p,
  html[data-mobile-enhanced="true"] .masthead p {
    font-size: 1.02rem !important;
    line-height: 1.55 !important;
    max-width: 38ch !important;
    margin-left: auto;
    margin-right: auto;
  }

  html[data-mobile-enhanced="true"] .hero .btn,
  html[data-mobile-enhanced="true"] .hero-section .btn,
  html[data-mobile-enhanced="true"] .page-hero .btn,
  html[data-mobile-enhanced="true"] .shop-hero .btn,
  html[data-mobile-enhanced="true"] .home-hero .btn,
  html[data-mobile-enhanced="true"] .banner .btn,
  html[data-mobile-enhanced="true"] .masthead .btn {
    width: 100%;
    max-width: 100%;
  }

  html[data-mobile-enhanced="true"] .hero .button-group,
  html[data-mobile-enhanced="true"] .hero .cta-group,
  html[data-mobile-enhanced="true"] .hero-section .button-group,
  html[data-mobile-enhanced="true"] .hero-section .cta-group,
  html[data-mobile-enhanced="true"] .page-hero .button-group,
  html[data-mobile-enhanced="true"] .page-hero .cta-group,
  html[data-mobile-enhanced="true"] .shop-hero .button-group,
  html[data-mobile-enhanced="true"] .shop-hero .cta-group {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    width: 100% !important;
  }

  html[data-mobile-enhanced="true"] .container,
  html[data-mobile-enhanced="true"] .section-inner,
  html[data-mobile-enhanced="true"] .content-wrap,
  html[data-mobile-enhanced="true"] .page-width,
  html[data-mobile-enhanced="true"] .wrapper {
    width: min(100% - 1.5rem, 100%) !important;
  }

  html[data-mobile-enhanced="true"] section,
  html[data-mobile-enhanced="true"] .section,
  html[data-mobile-enhanced="true"] .content-section,
  html[data-mobile-enhanced="true"] .page-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  html[data-mobile-enhanced="true"] .card,
  html[data-mobile-enhanced="true"] .panel,
  html[data-mobile-enhanced="true"] .content-card,
  html[data-mobile-enhanced="true"] .shop-card,
  html[data-mobile-enhanced="true"] .feature-card {
    border-radius: 24px !important;
  }

  html[data-mobile-enhanced="true"] .grid,
  html[data-mobile-enhanced="true"] .card-grid,
  html[data-mobile-enhanced="true"] .feature-grid,
  html[data-mobile-enhanced="true"] .materials-grid,
  html[data-mobile-enhanced="true"] .gallery-grid {
    gap: 1rem !important;
  }

  html[data-mobile-enhanced="true"] h1,
  html[data-mobile-enhanced="true"] .display-heading {
    font-size: clamp(2rem, 7vw, 3rem);
    line-height: 1;
  }

  html[data-mobile-enhanced="true"] h2 {
    font-size: clamp(1.7rem, 5.4vw, 2.2rem);
    line-height: 1.06;
  }

  html[data-mobile-enhanced="true"] h3 {
    font-size: clamp(1.28rem, 4.4vw, 1.55rem);
    line-height: 1.12;
  }
}

@media (max-width: 767px) {
  html[data-mobile-enhanced="true"] .hero,
  html[data-mobile-enhanced="true"] .hero-section,
  html[data-mobile-enhanced="true"] .page-hero,
  html[data-mobile-enhanced="true"] .shop-hero,
  html[data-mobile-enhanced="true"] .home-hero,
  html[data-mobile-enhanced="true"] .banner,
  html[data-mobile-enhanced="true"] .masthead {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  html[data-mobile-enhanced="true"] .hero h1,
  html[data-mobile-enhanced="true"] .hero-section h1,
  html[data-mobile-enhanced="true"] .page-hero h1,
  html[data-mobile-enhanced="true"] .shop-hero h1,
  html[data-mobile-enhanced="true"] .home-hero h1,
  html[data-mobile-enhanced="true"] .banner h1,
  html[data-mobile-enhanced="true"] .masthead h1 {
    font-size: clamp(1.85rem, 8.8vw, 2.75rem) !important;
    max-width: 10.5ch;
  }

  html[data-mobile-enhanced="true"] .hero p,
  html[data-mobile-enhanced="true"] .hero-section p,
  html[data-mobile-enhanced="true"] .page-hero p,
  html[data-mobile-enhanced="true"] .shop-hero p,
  html[data-mobile-enhanced="true"] .home-hero p,
  html[data-mobile-enhanced="true"] .banner p,
  html[data-mobile-enhanced="true"] .masthead p {
    font-size: 0.98rem !important;
    line-height: 1.5 !important;
  }

  html[data-mobile-enhanced="true"] section,
  html[data-mobile-enhanced="true"] .section,
  html[data-mobile-enhanced="true"] .content-section,
  html[data-mobile-enhanced="true"] .page-section {
    padding-top: 1.6rem !important;
    padding-bottom: 1.6rem !important;
  }

  html[data-mobile-enhanced="true"] .container,
  html[data-mobile-enhanced="true"] .section-inner,
  html[data-mobile-enhanced="true"] .content-wrap,
  html[data-mobile-enhanced="true"] .page-width,
  html[data-mobile-enhanced="true"] .wrapper {
    width: min(100% - 1rem, 100%) !important;
  }
}


/* Step 4: mobile shop + cart layout optimization
   Goal: improve mobile shopping flow without changing desktop.
*/

@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] .shop-intro,
  html[data-mobile-enhanced="true"] .shop-layout,
  html[data-mobile-enhanced="true"] .shop-shell,
  html[data-mobile-enhanced="true"] .shop-main,
  html[data-mobile-enhanced="true"] .shop-wrap {
    gap: 1rem !important;
  }

  html[data-mobile-enhanced="true"] .shop-layout,
  html[data-mobile-enhanced="true"] .shop-shell,
  html[data-mobile-enhanced="true"] .shop-main,
  html[data-mobile-enhanced="true"] .shop-wrap,
  html[data-mobile-enhanced="true"] .cart-layout,
  html[data-mobile-enhanced="true"] .cart-shell,
  html[data-mobile-enhanced="true"] .cart-main {
    display: block !important;
  }

  html[data-mobile-enhanced="true"] .shop-sidebar,
  html[data-mobile-enhanced="true"] .filter-panel,
  html[data-mobile-enhanced="true"] .filter-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem !important;
  }

  html[data-mobile-enhanced="true"] .shop-sidebar .card,
  html[data-mobile-enhanced="true"] .filter-panel,
  html[data-mobile-enhanced="true"] .filter-sidebar {
    padding: 1rem !important;
  }

  html[data-mobile-enhanced="true"] .product-grid-shop,
  html[data-mobile-enhanced="true"] .shop-grid,
  html[data-mobile-enhanced="true"] #shopGrid,
  html[data-mobile-enhanced="true"] .product-grid,
  html[data-mobile-enhanced="true"] .products-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  html[data-mobile-enhanced="true"] .shop-card,
  html[data-mobile-enhanced="true"] .product-card,
  html[data-mobile-enhanced="true"] .cart-card {
    padding: 1rem !important;
    border-radius: 24px !important;
  }

  html[data-mobile-enhanced="true"] .shop-card-image,
  html[data-mobile-enhanced="true"] .product-card img,
  html[data-mobile-enhanced="true"] .shop-card img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 18px !important;
  }

  html[data-mobile-enhanced="true"] .shop-card-footer,
  html[data-mobile-enhanced="true"] .product-card-footer,
  html[data-mobile-enhanced="true"] .card-actions,
  html[data-mobile-enhanced="true"] .product-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  html[data-mobile-enhanced="true"] .shop-card-footer .btn,
  html[data-mobile-enhanced="true"] .product-card-footer .btn,
  html[data-mobile-enhanced="true"] .card-actions .btn,
  html[data-mobile-enhanced="true"] .product-actions .btn {
    width: 100% !important;
    min-height: 48px !important;
  }

  html[data-mobile-enhanced="true"] .shop-results-bar,
  html[data-mobile-enhanced="true"] .results-bar,
  html[data-mobile-enhanced="true"] .catalog-header {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    align-items: start !important;
  }

  html[data-mobile-enhanced="true"] .shop-results-bar select,
  html[data-mobile-enhanced="true"] .results-bar select,
  html[data-mobile-enhanced="true"] .catalog-header select {
    width: 100% !important;
  }

  html[data-mobile-enhanced="true"] .cart-item,
  html[data-mobile-enhanced="true"] .cart-line,
  html[data-mobile-enhanced="true"] .cart-row {
    display: grid !important;
    grid-template-columns: 88px 1fr !important;
    gap: 0.9rem !important;
    align-items: start !important;
  }

  html[data-mobile-enhanced="true"] .cart-item img,
  html[data-mobile-enhanced="true"] .cart-line img,
  html[data-mobile-enhanced="true"] .cart-row img {
    width: 88px !important;
    height: 88px !important;
    object-fit: cover !important;
    border-radius: 16px !important;
  }

  html[data-mobile-enhanced="true"] .cart-item-controls,
  html[data-mobile-enhanced="true"] .cart-controls,
  html[data-mobile-enhanced="true"] .line-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.65rem !important;
    align-items: center !important;
  }

  html[data-mobile-enhanced="true"] .cart-summary,
  html[data-mobile-enhanced="true"] .summary-panel,
  html[data-mobile-enhanced="true"] .cart-totals {
    margin-top: 1rem !important;
    position: static !important;
  }

  html[data-mobile-enhanced="true"] .cart-summary .btn,
  html[data-mobile-enhanced="true"] .summary-panel .btn,
  html[data-mobile-enhanced="true"] .cart-totals .btn {
    width: 100% !important;
  }

  html[data-mobile-enhanced="true"] .modal-content,
  html[data-mobile-enhanced="true"] .product-modal-content,
  html[data-mobile-enhanced="true"] .dialog-content {
    width: min(100vw - 1rem, 720px) !important;
    max-width: min(100vw - 1rem, 720px) !important;
    max-height: 88dvh !important;
    margin: 0.5rem auto !important;
    border-radius: 22px !important;
    overflow-y: auto !important;
  }

  html[data-mobile-enhanced="true"] .modal-body,
  html[data-mobile-enhanced="true"] .product-modal-body,
  html[data-mobile-enhanced="true"] .dialog-body {
    padding: 1rem !important;
  }

  html[data-mobile-enhanced="true"] .modal-body .btn,
  html[data-mobile-enhanced="true"] .product-modal-body .btn,
  html[data-mobile-enhanced="true"] .dialog-body .btn {
    min-height: 48px !important;
  }
}

@media (max-width: 767px) {
  html[data-mobile-enhanced="true"] .shop-sidebar,
  html[data-mobile-enhanced="true"] .filter-panel,
  html[data-mobile-enhanced="true"] .filter-sidebar {
    margin-bottom: 0.85rem !important;
  }

  html[data-mobile-enhanced="true"] .shop-card,
  html[data-mobile-enhanced="true"] .product-card,
  html[data-mobile-enhanced="true"] .cart-card {
    padding: 0.9rem !important;
  }

  html[data-mobile-enhanced="true"] .shop-card-title,
  html[data-mobile-enhanced="true"] .product-card-title,
  html[data-mobile-enhanced="true"] .cart-item-title {
    font-size: 1.15rem !important;
    line-height: 1.15 !important;
  }

  html[data-mobile-enhanced="true"] .shop-card-footer,
  html[data-mobile-enhanced="true"] .product-card-footer,
  html[data-mobile-enhanced="true"] .card-actions,
  html[data-mobile-enhanced="true"] .product-actions {
    grid-template-columns: 1fr !important;
  }

  html[data-mobile-enhanced="true"] .cart-item,
  html[data-mobile-enhanced="true"] .cart-line,
  html[data-mobile-enhanced="true"] .cart-row {
    grid-template-columns: 72px 1fr !important;
    gap: 0.75rem !important;
  }

  html[data-mobile-enhanced="true"] .cart-item img,
  html[data-mobile-enhanced="true"] .cart-line img,
  html[data-mobile-enhanced="true"] .cart-row img {
    width: 72px !important;
    height: 72px !important;
  }

  html[data-mobile-enhanced="true"] .modal-content,
  html[data-mobile-enhanced="true"] .product-modal-content,
  html[data-mobile-enhanced="true"] .dialog-content {
    width: calc(100vw - 0.75rem) !important;
    max-width: calc(100vw - 0.75rem) !important;
    max-height: 90dvh !important;
    border-radius: 18px !important;
  }
}


/* Step 5: shop-page-specific mobile cleanup
   Stronger, visible mobile-only changes for shop.html.
*/

@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page .shop-hero,
  html[data-mobile-enhanced="true"] body.shop-page .page-hero,
  html[data-mobile-enhanced="true"] body.shop-page .hero,
  html[data-mobile-enhanced="true"] body.shop-page .shop-banner,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-hero {
    min-height: auto !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-hero h1,
  html[data-mobile-enhanced="true"] body.shop-page .page-hero h1,
  html[data-mobile-enhanced="true"] body.shop-page .hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.55rem) !important;
    line-height: 0.98 !important;
    max-width: 9.5ch !important;
    margin-bottom: 0.7rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-hero p,
  html[data-mobile-enhanced="true"] body.shop-page .page-hero p,
  html[data-mobile-enhanced="true"] body.shop-page .hero p {
    font-size: 0.98rem !important;
    line-height: 1.45 !important;
    max-width: 34ch !important;
    margin-bottom: 0.85rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-hero .btn,
  html[data-mobile-enhanced="true"] body.shop-page .page-hero .btn,
  html[data-mobile-enhanced="true"] body.shop-page .hero .btn {
    min-height: 48px !important;
    padding: 0.85rem 1rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card {
    padding: 1.25rem !important;
    border-radius: 24px !important;
    margin-bottom: 1rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro h2,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card h2 {
    font-size: clamp(1.8rem, 7vw, 2.4rem) !important;
    line-height: 0.98 !important;
    margin-bottom: 0.75rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro p,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card p {
    font-size: 0.98rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .filter-panel,
  html[data-mobile-enhanced="true"] body.shop-page .filter-sidebar,
  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar {
    padding: 1rem !important;
    border-radius: 24px !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .filter-panel h2,
  html[data-mobile-enhanced="true"] body.shop-page .filter-sidebar h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar h2 {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
    line-height: 1 !important;
    margin-bottom: 0.75rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .filter-panel p,
  html[data-mobile-enhanced="true"] body.shop-page .filter-sidebar p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar p {
    font-size: 0.96rem !important;
    line-height: 1.45 !important;
    margin-bottom: 1rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .filter-panel label,
  html[data-mobile-enhanced="true"] body.shop-page .filter-sidebar label,
  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar label {
    font-size: 0.96rem !important;
    margin-bottom: 0.4rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .filter-panel select,
  html[data-mobile-enhanced="true"] body.shop-page .filter-sidebar select,
  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar select,
  html[data-mobile-enhanced="true"] body.shop-page .filter-panel input,
  html[data-mobile-enhanced="true"] body.shop-page .filter-sidebar input,
  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar input {
    min-height: 52px !important;
    font-size: 1rem !important;
    border-radius: 18px !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-status-card,
  html[data-mobile-enhanced="true"] body.shop-page .live-cart-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-summary-card,
  html[data-mobile-enhanced="true"] body.shop-page .cart-status-card {
    padding: 1rem !important;
    border-radius: 24px !important;
    margin-bottom: 1rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-status-card p,
  html[data-mobile-enhanced="true"] body.shop-page .live-cart-card p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-summary-card p,
  html[data-mobile-enhanced="true"] body.shop-page .cart-status-card p {
    font-size: 0.96rem !important;
    line-height: 1.45 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-status-card .btn,
  html[data-mobile-enhanced="true"] body.shop-page .live-cart-card .btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-summary-card .btn,
  html[data-mobile-enhanced="true"] body.shop-page .cart-status-card .btn {
    width: 100% !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .product-grid-shop,
  html[data-mobile-enhanced="true"] body.shop-page #shopGrid {
    gap: 1.1rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card {
    padding: 0.95rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-image-wrap {
    margin-bottom: 0.85rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-title {
    font-size: 1.2rem !important;
    line-height: 1.12 !important;
    margin-bottom: 0.5rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-text,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-description {
    font-size: 0.97rem !important;
    line-height: 1.45 !important;
    margin-bottom: 0.75rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-price {
    font-size: 1.1rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .stock-badge {
    font-size: 0.9rem !important;
    padding: 0.55rem 0.75rem !important;
    border-radius: 999px !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-footer {
    gap: 0.65rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-footer .btn {
    min-height: 50px !important;
    font-size: 1rem !important;
  }
}

@media (max-width: 767px) {
  html[data-mobile-enhanced="true"] body.shop-page .shop-hero,
  html[data-mobile-enhanced="true"] body.shop-page .page-hero,
  html[data-mobile-enhanced="true"] body.shop-page .hero {
    padding-top: 0.5rem !important;
    padding-bottom: 0.85rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card,
  html[data-mobile-enhanced="true"] body.shop-page .filter-panel,
  html[data-mobile-enhanced="true"] body.shop-page .filter-sidebar,
  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar,
  html[data-mobile-enhanced="true"] body.shop-page .shop-status-card,
  html[data-mobile-enhanced="true"] body.shop-page .live-cart-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-summary-card,
  html[data-mobile-enhanced="true"] body.shop-page .cart-status-card {
    padding: 0.95rem !important;
    border-radius: 20px !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro h2,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card h2 {
    font-size: clamp(1.55rem, 7.6vw, 2.1rem) !important;
    max-width: 10ch !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .filter-panel h2,
  html[data-mobile-enhanced="true"] body.shop-page .filter-sidebar h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar h2 {
    font-size: 1.45rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card {
    padding: 0.85rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-image,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card img {
    aspect-ratio: 1 / 1 !important;
  }
}


/* Step 6: shop mobile filter toggle
   Mobile-only collapsed filter panel for faster access to products.
*/

.mobile-shop-controls {
  display: none;
}

@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page .mobile-shop-controls {
    display: block !important;
    margin: 0 0 0.9rem 0 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .mobile-filter-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    min-height: 52px;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid #e0d4c7;
    background: #fffdfb;
    color: #3b2417;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(47, 33, 24, 0.05);
  }

  html[data-mobile-enhanced="true"] body.shop-page .mobile-filter-toggle:hover {
    background: #f7f2eb;
  }

  html[data-mobile-enhanced="true"] body.shop-page .mobile-filter-toggle:focus-visible {
    outline: 2px solid #c8743d;
    outline-offset: 2px;
  }

  html[data-mobile-enhanced="true"] body.shop-page .mobile-filter-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #efe7df;
    color: #8e431b;
    flex-shrink: 0;
  }

  html[data-mobile-enhanced="true"] body.shop-page .mobile-filter-toggle::after {
    content: "+";
    font-size: 1.35rem;
    line-height: 1;
    color: #8e431b;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }

  html[data-mobile-enhanced="true"] body.shop-page .mobile-filter-toggle[aria-expanded="true"]::after {
    content: "−";
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar {
    display: block !important;
    overflow: hidden !important;
    max-height: 0 !important;
    opacity: 0 !important;
    margin-bottom: 0 !important;
    transform: translateY(-6px);
    transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.2s ease, margin-bottom 0.2s ease;
    pointer-events: none;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-sidebar.is-open {
    max-height: 1200px !important;
    opacity: 1 !important;
    margin-bottom: 1rem !important;
    transform: translateY(0);
    pointer-events: auto;
  }

  html[data-mobile-enhanced="true"] body.shop-page .filter-box {
    padding-top: 0.2rem;
  }
}

@media (max-width: 767px) {
  html[data-mobile-enhanced="true"] body.shop-page .mobile-shop-controls {
    margin-bottom: 0.8rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .mobile-filter-toggle {
    min-height: 50px;
    padding: 0.82rem 0.9rem;
    border-radius: 16px;
  }
}


/* Step 6b: shrink the 'Browse the shop your way' section on mobile */
@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card {
    padding: 0.9rem 1rem !important;
    margin-bottom: 0.85rem !important;
    border-radius: 20px !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro h2,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card h2 {
    font-size: clamp(1.35rem, 5.6vw, 1.9rem) !important;
    line-height: 1.02 !important;
    margin-bottom: 0.45rem !important;
    max-width: 9ch !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro p,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card p {
    font-size: 0.92rem !important;
    line-height: 1.4 !important;
  }
}

@media (max-width: 767px) {
  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card {
    padding: 0.75rem 0.85rem !important;
    margin-bottom: 0.75rem !important;
    border-radius: 18px !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro h2,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card h2,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card h2 {
    font-size: clamp(1.2rem, 6vw, 1.65rem) !important;
    margin-bottom: 0.35rem !important;
    max-width: 8ch !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-section-intro p,
  html[data-mobile-enhanced="true"] body.shop-page .browse-shop-card p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-intro-card p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-info-card p {
    font-size: 0.88rem !important;
    line-height: 1.35 !important;
  }
}







/* Step 7c: aggressive 4-up minimal product cards on mobile shop page */
@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page .product-grid-shop,
  html[data-mobile-enhanced="true"] body.shop-page .shop-grid,
  html[data-mobile-enhanced="true"] body.shop-page #shopGrid,
  html[data-mobile-enhanced="true"] body.shop-page .product-grid,
  html[data-mobile-enhanced="true"] body.shop-page .products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card,
  html[data-mobile-enhanced="true"] body.shop-page .product-card {
    padding: 0.35rem !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-image,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card img,
  html[data-mobile-enhanced="true"] body.shop-page .product-card img {
    aspect-ratio: 1 / 1 !important;
    border-radius: 10px !important;
    width: 100% !important;
    object-fit: cover !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-image-wrap {
    margin-bottom: 0.35rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-title,
  html[data-mobile-enhanced="true"] body.shop-page .product-card-title,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-text,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-description,
  html[data-mobile-enhanced="true"] body.shop-page .product-card-text,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-price,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-content p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-content h3,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-content .meta,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-content .price,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-content .description {
    display: none !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .stock-badge {
    font-size: 0.52rem !important;
    line-height: 1 !important;
    padding: 0.2rem 0.3rem !important;
    border-radius: 999px !important;
    top: 0.25rem !important;
    right: 0.25rem !important;
    max-width: calc(100% - 0.5rem);
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-footer,
  html[data-mobile-enhanced="true"] body.shop-page .product-card-footer,
  html[data-mobile-enhanced="true"] body.shop-page .card-actions,
  html[data-mobile-enhanced="true"] body.shop-page .product-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.28rem !important;
    width: 100% !important;
    margin-top: 0 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card-footer .btn,
  html[data-mobile-enhanced="true"] body.shop-page .product-card-footer .btn,
  html[data-mobile-enhanced="true"] body.shop-page .card-actions .btn,
  html[data-mobile-enhanced="true"] body.shop-page .product-actions .btn {
    min-height: 28px !important;
    padding: 0.28rem 0.2rem !important;
    font-size: 0.58rem !important;
    line-height: 1 !important;
    border-radius: 8px !important;
    letter-spacing: 0 !important;
  }
}

/* slightly larger on wider phones while staying 4-up */
@media (min-width: 431px) and (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page .stock-badge {
    font-size: 0.58rem !important;
  }
  html[data-mobile-enhanced="true"] body.shop-page .shop-card-footer .btn,
  html[data-mobile-enhanced="true"] body.shop-page .product-card-footer .btn,
  html[data-mobile-enhanced="true"] body.shop-page .card-actions .btn,
  html[data-mobile-enhanced="true"] body.shop-page .product-actions .btn {
    min-height: 30px !important;
    font-size: 0.62rem !important;
  }
}

/* Make product images feel tappable for details */
.shop-card-image-wrap[data-details-trigger="true"],
.shop-card-image-wrap[data-details-trigger="true"] img {
  cursor: pointer;
}


/* Step 7e: use the actual live shop card structure for compact mobile cards
   Live structure confirmed:
   .shop-card
   .shop-card-media
   .shop-card-body
   .shop-price-row
   .shop-card-actions
*/
@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.3rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-body > h4,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-body > p,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-price-row {
    display: none !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.28rem !important;
    width: 100% !important;
    margin-top: 0 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions .mini-btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions .btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions button {
    min-height: 28px !important;
    padding: 0.28rem 0.2rem !important;
    font-size: 0.58rem !important;
    line-height: 1 !important;
    border-radius: 8px !important;
    letter-spacing: 0 !important;
    width: 100% !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-media {
    margin-bottom: 0.35rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-stock-pill {
    font-size: 0.52rem !important;
    line-height: 1 !important;
    padding: 0.2rem 0.3rem !important;
    border-radius: 999px !important;
    max-width: calc(100% - 0.5rem);
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-media,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-media img {
    cursor: pointer !important;
  }
}

@media (min-width: 431px) and (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-stock-pill {
    font-size: 0.58rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions .mini-btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions .btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions button {
    min-height: 30px !important;
    font-size: 0.62rem !important;
  }
}


/* Step 7i: stable 3-up compact mobile shop cards, desktop untouched */
@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page .product-grid-shop,
  html[data-mobile-enhanced="true"] body.shop-page .shop-grid,
  html[data-mobile-enhanced="true"] body.shop-page #shopGrid,
  html[data-mobile-enhanced="true"] body.shop-page .product-grid,
  html[data-mobile-enhanced="true"] body.shop-page .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card {
    padding: 0.42rem !important;
    border-radius: 14px !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions .mini-btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions .btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions button {
    min-height: 30px !important;
    padding: 0.34rem 0.22rem !important;
    font-size: 0.62rem !important;
    border-radius: 8px !important;
    width: 100% !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-stock-pill {
    font-size: 0.58rem !important;
    padding: 0.22rem 0.34rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-media,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-media img {
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }
}

@media (max-width: 430px) {
  html[data-mobile-enhanced="true"] body.shop-page .product-grid-shop,
  html[data-mobile-enhanced="true"] body.shop-page .shop-grid,
  html[data-mobile-enhanced="true"] body.shop-page #shopGrid,
  html[data-mobile-enhanced="true"] body.shop-page .product-grid,
  html[data-mobile-enhanced="true"] body.shop-page .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.42rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card {
    padding: 0.34rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions .mini-btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions .btn,
  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-card-actions button {
    min-height: 28px !important;
    font-size: 0.56rem !important;
    padding: 0.28rem 0.16rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page .shop-card .shop-stock-pill {
    font-size: 0.52rem !important;
  }
}


html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-body {
    padding: 0.8rem !important;
  }
}


@media (max-width: 430px) {
  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-content {
    width: calc(100vw - 0.7rem) !important;
    max-width: calc(100vw - 0.7rem) !important;
    max-height: 74dvh !important;
    margin-bottom: 0.18rem !important;
    border-radius: 22px 22px 0 0 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-body {
    padding: 0.8rem !important;
  }
}


/* Step 7l: proper mobile-only bottom sheet on the real active shop modal */
@media (max-width: 991px) {
  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal.shop-modal.active {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
    background: rgba(15, 11, 10, 0.74) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-content {
    position: relative !important;
    width: min(100vw - 1rem, 760px) !important;
    max-width: min(100vw - 1rem, 760px) !important;
    max-height: 74dvh !important;
    margin: 0 auto 0.4rem !important;
    border-radius: 24px 24px 0 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #fffdfb !important;
    box-shadow: 0 -12px 36px rgba(17, 12, 10, 0.32) !important;
    border: 1px solid rgba(255, 247, 240, 0.14) !important;
    touch-action: pan-y !important;
    transition: transform 0.22s ease, opacity 0.22s ease !important;
    will-change: transform !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-content::before {
    content: "" !important;
    display: block !important;
    width: 46px !important;
    height: 5px !important;
    margin: 0.7rem auto 0.2rem auto !important;
    border-radius: 999px !important;
    background: #d2c1b2 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    padding: 0.25rem 0.9rem 0.55rem !important;
    background: linear-gradient(to bottom, rgba(255,253,251,0.98), rgba(255,253,251,0.92)) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    border-bottom: 1px solid rgba(217,203,187,0.55) !important;
    cursor: grab;
    touch-action: none !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-top::before {
    content: "Swipe down or tap × to close" !important;
    display: block !important;
    font-size: 0.76rem !important;
    line-height: 1.3 !important;
    color: #7a6253 !important;
    margin-right: 3rem !important;
    padding-top: 0.1rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-top.dragging {
    cursor: grabbing !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-close {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.7rem !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 999px !important;
    background: #fff7f0 !important;
    border: 1px solid #d9cbbb !important;
    color: #2f2118 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.18rem !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 16px rgba(17, 12, 10, 0.16) !important;
    z-index: 4 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-body {
    padding: 0.9rem !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-content.sheet-dismiss {
    transform: translateY(110%) !important;
    opacity: 0.96 !important;
  }
}

@media (max-width: 430px) {
  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal.shop-modal.active {
    display: flex !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-content {
    width: calc(100vw - 0.8rem) !important;
    max-width: calc(100vw - 0.8rem) !important;
    max-height: 70dvh !important;
    margin-bottom: 0.25rem !important;
    border-radius: 22px 22px 0 0 !important;
  }

  html[data-mobile-enhanced="true"] body.shop-page #productDetailsModal .shop-modal-body {
    padding: 0.75rem !important;
  }
}
