/* MYC Mobile Store v1.1 — mobile-only, namespaced rules. */
.mycm-app { display: none !important; }

@media screen and (max-width: 767px) {
  body.mycm-enabled { overflow-x: hidden; }
  /* Original page shell is hidden only for the replaced mobile home and shop.
     JavaScript additionally detects theme wrappers without relying on theme names. */
  body.mycm-home .mycm-theme-shell,
  body.mycm-shop .mycm-theme-shell { display: none !important; }
  body.mycm-home > #page,
  body.mycm-shop > #page,
  body.mycm-home > .fl-page,
  body.mycm-shop > .fl-page,
  body.mycm-home > .wp-site-blocks,
  body.mycm-shop > .wp-site-blocks,
  body.mycm-home > .site,
  body.mycm-shop > .site,
  body.mycm-home > #wrapper,
  body.mycm-shop > #wrapper { display: none !important; }
  /* Hide only the original theme header on category pages. */
  body.mycm-enabled #masthead,
  body.mycm-enabled header.site-header,
  body.mycm-enabled .site-header:not(.mycm-header) { display: none !important; }

  /* Only Home and Shop are visually replaced: content still exists on desktop. */
  body.mycm-home #content,
  body.mycm-shop #content,
  body.mycm-home .site-footer,
  body.mycm-shop .site-footer { display: none !important; }

  body.mycm-enabled .mycm-app {
    --mycm-purple: #7212b5;
    --mycm-purple-dark: #441078;
    --mycm-blue: #004abe;
    --mycm-cyan: #03bce5;
    --mycm-ink: #101b36;
    --mycm-line: #e6eaf2;
    display: block !important;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    color: var(--mycm-ink);
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.35;
    position: relative;
    z-index: 5;
  }
  .mycm-app *, .mycm-app *::before, .mycm-app *::after { box-sizing: border-box; }
  .mycm-app a { text-decoration: none; }
  .mycm-app button, .mycm-app input { font: inherit; }
  .mycm-app .mycm-icon { flex: none; }
  .mycm-app .mycm-screen-reader {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
  }
  .mycm-header {
    padding: 13px 14px 14px;
    background: #fff;
    box-shadow: 0 2px 10px rgb(29 31 67 / 5%);
    position: relative;
    z-index: 10;
  }
  .mycm-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    min-height: 68px;
  }
  .mycm-app .mycm-icon-button {
    color: #081e47;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 42px;
    padding: 3px;
    margin: 0;
    border: 0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    position: relative;
  }
  .mycm-app .mycm-icon-button .mycm-icon { width: 26px; height: 26px; }
  .mycm-brand {
    min-width: 0;
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    max-width: 208px;
    color: var(--mycm-ink);
  }
  .mycm-brand img {
    width: 54px;
    height: 62px;
    object-fit: contain;
    flex: none;
    padding: 1px;
  }
  .mycm-brand-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: .93;
    border-left: 2px solid #04b6d9;
    padding-left: 7px;
    letter-spacing: -.06em;
  }
  .mycm-brand-name strong { font-size: clamp(25px, 7.5vw, 34px); color: #52128d; font-weight: 850; }
  .mycm-brand-name small { font-size: clamp(12px, 3.4vw, 16px); color: #069dc0; font-weight: 750; letter-spacing: -.02em; margin-top: 5px; }
  .mycm-header-actions { display: flex; gap: 0; }
  .mycm-cart-count {
    position: absolute;
    top: 1px; right: -1px;
    min-width: 16px; height: 16px;
    padding: 1px 3px;
    border-radius: 10px;
    background: #6711a7;
    color: #fff;
    font-size: 10px;
    text-align: center;
  }
  .mycm-search {
    display: flex;
    width: 100%;
    height: 44px;
    margin: 12px 0 0;
    border: 1px solid #c6cada;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
  }
  .mycm-app .mycm-search input[type="search"] {
    flex: 1;
    min-width: 0;
    width: 0;
    padding: 0 12px;
    background: #fff;
    border: 0;
    outline: 0;
    font-size: 13px;
    color: var(--mycm-ink);
    box-shadow: none;
    border-radius: 0;
    margin: 0;
  }
  .mycm-search input::placeholder { color: #6d7483; opacity: 1; }
  .mycm-app .mycm-search button {
    width: 48px;
    min-width: 48px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: white;
    cursor: pointer;
    background: linear-gradient(135deg, #963ed5, #6410a5);
  }
  .mycm-menu-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 81px;
    padding: 12px;
    border: 1px solid #e4ddee;
    background: #fff;
    box-shadow: 0 16px 40px rgb(35 17 69 / 20%);
    border-radius: 14px;
    display: grid;
    gap: 0;
    z-index: 1000;
  }
  .mycm-menu-panel[hidden] { display: none !important; }
  .mycm-menu-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #5c1598;
    font-weight: 800;
    border-bottom: 1px solid #e8e6ed;
    padding: 2px 7px 8px;
  }
  .mycm-app .mycm-menu-close {
    color: #0a2247; background: transparent; border: 0; padding: 4px;
    cursor: pointer; border-radius: 6px;
  }
  .mycm-menu-panel > a { padding: 11px 8px; color: #1b2742; border-bottom: 1px solid #eff0f6; font-size: 14px; }
  .mycm-menu-panel > a:last-child { border-bottom: none; }

  .mycm-main { width: 100%; background: #fff; padding-bottom: 0; }
  .mycm-hero { display: block; width: 100%; overflow: hidden; background: #34088b; line-height: 0; }
  .mycm-hero img { display: block; width: 100%; height: auto; margin: 0; border: 0; border-radius: 0; }
  .mycm-app a:focus-visible, .mycm-app button:focus-visible, .mycm-app input:focus-visible {
    outline: 3px solid #03bce5;
    outline-offset: 3px;
  }

  .mycm-carousel { position:relative; width:100%; background:#35117d; overflow:hidden; }
  .mycm-carousel-track { width:100%; aspect-ratio: 900 / 443; position:relative; }
  .mycm-app .mycm-slide { position:absolute; inset:0; display:block; width:100%; height:100%; }
  .mycm-app .mycm-slide[hidden] { display:none !important; }
  .mycm-app .mycm-slide img { width:100%; height:100%; object-fit:cover; border:0; border-radius:0; margin:0; padding:0; }
  .mycm-carousel-controls { display:flex; justify-content:center; align-items:center; gap:16px; background:#fff; min-height:35px; }
  .mycm-app .mycm-carousel-prev, .mycm-app .mycm-carousel-next { appearance:none; background:none; border:0; color:#6413ab; font-size:25px; cursor:pointer; padding:0 12px; line-height:1; min-height:34px; }
  .mycm-carousel-dots { display:flex; gap:8px; align-items:center; justify-content:center; }
  .mycm-app .mycm-carousel-dot { appearance:none; border:0; padding:0; width:9px; height:9px; border-radius:50%; background:#c8c8d8; cursor:pointer; }
  .mycm-app .mycm-carousel-dot.is-active { background:#7118b4; width:10px; height:10px; }
  .mycm-featured-grid .mycm-product-image { height:clamp(102px,33vw,154px); }
  .mycm-featured-grid .mycm-product-name { font-size:clamp(11px,3vw,13px); }
  .mycm-featured-grid .mycm-product-price { font-size:clamp(12px,3.25vw,15px); }
  .mycm-featured-grid .mycm-buy { min-height:38px; font-size:12px; }

  .mycm-categories {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 17px 10px 18px;
    border-bottom: 1px solid #e6eaf2;
  }
  .mycm-category { min-width:0; display:flex; flex-direction:column; align-items:center; gap:6px; color:#17233a !important; }
  .mycm-category-icon {
    width: min(100%, 64px);
    aspect-ratio: 1.14;
    border-radius: 13px;
    display:grid;
    place-items:center;
    box-shadow: 0 2px 6px rgb(50 27 108 / 9%);
    color:#fff;
    background: linear-gradient(132deg, #00bbd9 0%, #0061d4 48%, #5a00cb 100%);
  }
  .mycm-category:nth-child(2n) .mycm-category-icon { background: linear-gradient(128deg, #932bd5, #4e06a5); }
  .mycm-category:nth-child(3) .mycm-category-icon { background: linear-gradient(128deg, #08b8d4, #004dc2); }
  .mycm-category-icon .mycm-icon { width: 35px; height: 35px; stroke-width: 1.7; }
  .mycm-category-name { font-size: clamp(9.5px, 2.65vw, 12px); font-weight: 650; line-height:1.15; text-align:center; }

  .mycm-featured { padding: 15px 11px 18px; }
  .mycm-section-title { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:14px; }
  .mycm-app .mycm-section-title h2 {
    position:relative;
    color:#11141e;
    margin:0;
    padding:0 0 0 13px;
    font-size: clamp(17px, 5.2vw, 23px);
    line-height:1.3;
    letter-spacing:-.04em;
    font-weight:800;
  }
  .mycm-section-title h2::before {
    content:'';
    position:absolute;
    top:3px;bottom:3px;left:0;
    width:5px;border-radius:5px;
    background:linear-gradient(180deg,#6710a8,#a235d8);
  }
  .mycm-section-title > a {
    display:inline-flex;align-items:center;gap:3px;
    color:#6811aa;white-space:nowrap;font-size:13px;font-weight:800;
  }
  .mycm-section-title > a .mycm-icon { width:14px;height:14px; }
  .mycm-featured-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .mycm-product-card {
    min-width:0;
    display:flex;flex-direction:column;
    padding:8px 7px 9px;
    background:white;
    border:1px solid #e0e3ec;
    border-radius:13px;
    box-shadow:0 2px 4px rgb(23 29 51 / 3%);
  }
  .mycm-product-image {
    display:flex;align-items:center;justify-content:center;
    height:clamp(74px,24vw,116px);
    min-width:0;
  }
  .mycm-app .mycm-product-image img {
    width:100%;height:100%;object-fit:contain;
    max-width:100%;max-height:100%;
    box-shadow:none;border:0;padding:0;margin:0;
  }
  .mycm-product-name {
    color:#172132 !important;
    font-size:clamp(10px,2.65vw,12px);
    font-weight:650;
    line-height:1.3;
    display:-webkit-box;
    -webkit-line-clamp:3;
    -webkit-box-orient:vertical;
    overflow:hidden;
    min-height:3.9em;
    margin:5px 0 6px;
    word-break:normal;
  }
  .mycm-product-price {
    color:#59138c;
    font-size:clamp(10.5px,2.95vw,14px);
    font-weight:850;
    line-height:1.25;
    margin: auto 0 10px;
    letter-spacing:-.025em;
    overflow-wrap:anywhere;
  }
  .mycm-product-price del { color:#777; opacity:.8; display:block; font-size:10px; }
  .mycm-product-price ins { color:#59138c; text-decoration:none; }
  .mycm-app .mycm-buy {
    display:flex;align-items:center;justify-content:center;gap:4px;
    width:100%;min-height:31px;
    border-radius:7px;
    color:white !important;
    background:linear-gradient(120deg,#9327cf,#59109d);
    padding:6px 3px;
    font-size:clamp(9.5px,2.6vw,12px);font-weight:800;text-align:center;
    line-height:1.15;
    margin-top:auto;
  }
  .mycm-buy .mycm-icon { width:15px;height:15px; }
  .mycm-empty { margin:8px 0; font-size:13px; }
  .mycm-benefits {
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
    padding:17px 8px 14px;
    border-top:1px solid #e6eaf2;
  }
  .mycm-benefit {
    display:flex;flex-direction:column;align-items:center;gap:6px;
    text-align:center;min-width:0;padding:2px 6px;
    color:#211b42;font-size:clamp(9px,2.75vw,12px);font-weight:550;line-height:1.18;
    border-right:1px solid #b8bed2;
  }
  .mycm-benefit:last-child {border-right:0;}
  .mycm-benefit .mycm-icon {width:28px;height:28px;color:#5e0d9b;stroke-width:2.1;}
  .mycm-bottom-wave {
    height:28px;
    border-radius:45% 45% 0 0 / 50% 50% 0 0;
    background:linear-gradient(110deg,#6610a9 0%,#4e1aae 25%,#00b2df 65%,#6e0cb0 100%);
  }

  /* A functional WooCommerce catalog is supplied on the mobile Shop view. */
  .mycm-catalog-grid { padding:8px 12px 22px; }
  .mycm-catalog-grid .woocommerce { width:100%; }
  .mycm-catalog-grid .woocommerce ul.products,
  .mycm-catalog-grid .woocommerce-page ul.products {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    column-gap:10px !important;
    row-gap:12px !important;
    margin:0 !important;
    padding:0 !important;
  }
  .mycm-catalog-grid .woocommerce ul.products::before,
  .mycm-catalog-grid .woocommerce ul.products::after { display:none !important; }
  .mycm-catalog-grid .woocommerce ul.products li.product,
  .mycm-catalog-grid .woocommerce-page ul.products li.product {
    display:flex !important;
    flex-direction:column;
    clear:none !important;
    width:auto !important;
    float:none !important;
    margin:0 !important;
    padding:9px !important;
    border:1px solid #e2e6ee !important;
    border-radius:13px;
    background:#fff;
    text-align:left;
    min-width:0;
  }
  .mycm-catalog-grid .woocommerce ul.products li.product img {width:100%;height:135px;object-fit:contain;margin:0 0 10px;}
  .mycm-catalog-grid .woocommerce ul.products li.product h2,
  .mycm-catalog-grid .woocommerce ul.products li.product .woocommerce-loop-product__title {font-size:12px !important;line-height:1.3;min-height:3.9em;color:#1a2540 !important;}
  .mycm-catalog-grid .woocommerce ul.products li.product .price {font-size:14px !important;color:#601097 !important;font-weight:800;margin:7px 0 !important;}
  .mycm-catalog-grid .woocommerce ul.products li.product .button,
  .mycm-catalog-grid .woocommerce ul.products li.product .added_to_cart {
    display:inline-flex;align-items:center;justify-content:center;
    padding:9px 8px !important;
    border-radius:7px !important;
    font-size:11px !important;
    line-height:1.2;
    text-align:center;
    min-height:36px;
    background:#6812aa !important;color:#fff !important;
    margin:auto 0 0 !important;
  }
  .mycm-catalog-grid .woocommerce nav.woocommerce-pagination {margin:22px auto 4px;}
  .mycm-catalog-grid .woocommerce nav.woocommerce-pagination a,
  .mycm-catalog-grid .woocommerce nav.woocommerce-pagination span {padding:9px 12px;}

  /* Category archives retain WooCommerce’s native product filters and pagination. */
  body.mycm-catalog #content { display:block !important; }
  body.mycm-catalog .woocommerce ul.products {display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  body.mycm-catalog .woocommerce ul.products li.product {width:auto !important;float:none !important;margin:0 !important;clear:none !important;}
  body.mycm-catalog .mycm-main {border-bottom:1px solid #eee;}
  body.mycm-catalog .mycm-categories {padding:10px;}
}

@media screen and (max-width: 360px) {
  .mycm-header {padding:10px 9px 12px;}
  .mycm-brand img {width:43px;height:55px;}
  .mycm-brand-name {padding-left:5px;}
  .mycm-header-actions .mycm-icon-button {width:30px;}
  .mycm-categories {gap:4px;padding-left:6px;padding-right:6px;}
  .mycm-category-icon .mycm-icon {width:30px;height:30px;}
  .mycm-product-card {padding:7px 5px;}
  .mycm-featured {padding:15px 7px 17px;}
}

@media (prefers-reduced-motion: no-preference) {
  @media screen and (max-width: 767px) {
    .mycm-category-icon, .mycm-buy {transition:transform .18s ease,filter .18s ease;}
    .mycm-category:active .mycm-category-icon,.mycm-buy:active {transform:scale(.96);}
  }
}
