/* ==========================================================================
   MKM Biolabs Theme — theme-fixes.css  v2
   Targeted overrides for:
   1. .woocommerce-info::before  — SVG icon fix (no icon-font dependency)
   2. Cart-drawer mini-cart items — single clean ruleset, flex-row layout
      so image appears LEFT and product name RIGHT (not stacked)
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. WooCommerce notice ::before icon fix
   WooCommerce uses a custom icon font for ::before glyphs. When the font
   fails to load the glyph renders as an empty box. We replace it with an
   inline SVG mask that always renders correctly.
   -------------------------------------------------------------------------- */

.mkm-skin .woocommerce-info,
.mkm-skin .woocommerce-message,
.mkm-skin .woocommerce-error,
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex-direction: column;
}

/* --- info (blue circle i) --- */
.mkm-skin .woocommerce-info::before,
.woocommerce-info::before {
  font-family: none !important;
  content: "" !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border-radius: 50% !important;
  margin-right: 10px !important;
  flex-shrink: 0 !important;
  background-color: #2f6bff !important;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='8.01'/%3E%3Cpolyline points='11 12 12 12 12 16 13 16'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='8.01'/%3E%3Cpolyline points='11 12 12 12 12 16 13 16'/%3E%3C/svg%3E") !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-position: center !important;
  mask-position: center !important;
  color: transparent !important;
  font-size: 0 !important;
}

/* --- message / success (green tick) --- */
.mkm-skin .woocommerce-message::before,
.woocommerce-message::before {
  font-family: none !important;
  content: "" !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border-radius: 50% !important;
  margin-right: 10px !important;
  flex-shrink: 0 !important;
  background-color: #28c76f !important;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12 5 5L20 6'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12 5 5L20 6'/%3E%3C/svg%3E") !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-position: center !important;
  mask-position: center !important;
  color: transparent !important;
  font-size: 0 !important;
}

/* --- error (red warning) --- */
.mkm-skin .woocommerce-error::before,
.woocommerce-error::before {
  font-family: none !important;
  content: "" !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border-radius: 50% !important;
  margin-right: 10px !important;
  flex-shrink: 0 !important;
  background-color: #ff5a6e !important;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-position: center !important;
  mask-position: center !important;
  color: transparent !important;
  font-size: 0 !important;
}

/* Error list items must not show the wrapper ::before again */
.woocommerce-error li::before {
  display: none !important;
}


/* --------------------------------------------------------------------------
   2. Cart Drawer — single authoritative ruleset  (v3 — flex-row fix)

   WooCommerce mini-cart HTML structure per item:
     <li class="woocommerce-mini-cart-item mini_cart_item">
       <a href="remove-url" class="remove remove_from_cart_button">×</a>
       <a href="product-url">
         <img class="attachment-woocommerce_thumbnail …" />
         Product Name
       </a>
       <span class="quantity">1 × <span class="amount">£100</span></span>
     </li>

   Previous bug: `flex-direction:column` on <a> stacked img above name,
   which made the card look like it had two separate images.

   Correct layout goal:
     ┌─────────────────────────────────┐
     │ [img 60×60]  Product Name  [×] │
     │              1 × £100.00        │
     └─────────────────────────────────┘
   -------------------------------------------------------------------------- */

/* ── Panel shell ─────────────────────────────────────────────────── */
.mkm-drawer-panel {
  background: linear-gradient(180deg, #0c1425 0%, #060b18 100%) !important;
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.55) !important;
  border-left: 1px solid rgba(88, 166, 255, 0.14) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  pointer-events: auto !important;
  z-index: 999999 !important;
}

.mkm-drawer-panel::before {
  content: "" !important;
  position: absolute !important;
  top: -60px !important;
  right: -60px !important;
  width: 220px !important;
  height: 220px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(47, 107, 255, 0.28), transparent 68%) !important;
  filter: blur(26px) !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

/* ── Head ────────────────────────────────────────────────────────── */
.mkm-drawer-head {
  position: relative !important;
  z-index: 1 !important;
  padding: 18px 20px !important;
  background: rgba(47, 107, 255, 0.07) !important;
  border-bottom: 1px solid rgba(88, 166, 255, 0.14) !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
}

.mkm-drawer-headline {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.mkm-drawer-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.35), rgba(88, 166, 255, 0.18)) !important;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.28), 0 6px 18px rgba(47, 107, 255, 0.28) !important;
}

.mkm-drawer-badge .mkm-i {
  width: 18px !important;
  height: 18px !important;
  stroke: #58a6ff !important;
}

.mkm-drawer-head .mkm-eyebrow {
  font-size: 0.62rem !important;
  letter-spacing: 0.22em !important;
  color: #58a6ff !important;
  margin-bottom: 1px !important;
}

.mkm-drawer-head b {
  font-family: "Space Grotesk", Inter, sans-serif !important;
  font-size: 1rem !important;
  color: #e8eefc !important;
}

.mkm-drawer-x {
  border: 0 !important;
  background: rgba(88, 166, 255, 0.08) !important;
  color: #93a3c4 !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: background 0.2s, color 0.2s !important;
}

.mkm-drawer-x:hover {
  background: rgba(255, 90, 110, 0.15) !important;
  color: #ff7d8f !important;
}

/* ── Body / scroll area ──────────────────────────────────────────── */
.mkm-drawer-body,
[data-mkm-mini-cart],
.widget_shopping_cart_content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  pointer-events: auto !important;
  padding: 14px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(88, 166, 255, 0.4) transparent !important;
  position: relative !important;
  z-index: 1 !important;
}

.mkm-drawer-body::-webkit-scrollbar {
  width: 5px !important;
}

.mkm-drawer-body::-webkit-scrollbar-track {
  background: rgba(6, 11, 24, 0.5) !important;
}

.mkm-drawer-body::-webkit-scrollbar-thumb {
  background: rgba(88, 166, 255, 0.4) !important;
  border-radius: 999px !important;
}

.mkm-drawer-body::-webkit-scrollbar-thumb:hover {
  background: rgba(88, 166, 255, 0.7) !important;
}

/* ── Mini-cart list ──────────────────────────────────────────────── */
.mkm-drawer .woocommerce-mini-cart,
.mkm-drawer ul.cart_list,
.mkm-drawer ul.product_list_widget {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  overflow: visible !important;
  height: auto !important;
  touch-action: pan-y !important;
}

/* ══════════════════════════════════════════════════════════════════
   CART ITEM CARD
   li = column flex → [row: img+name] then [row: quantity]
   ══════════════════════════════════════════════════════════════════ */
.mkm-drawer .woocommerce-mini-cart-item {
  position: relative !important;
  /* COLUMN: stacks the <a> row above the quantity row */
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  align-items: stretch !important;

  padding: 12px 12px 10px !important;
  border: 1px solid rgba(88, 166, 255, 0.18) !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, rgba(16, 28, 56, 0.85), rgba(8, 12, 24, 0.95)) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s !important;

  /* reset old grid-based layouts */
  grid-template-columns: unset !important;
  grid-template-rows: unset !important;
}

.mkm-drawer .woocommerce-mini-cart-item:hover {
  border-color: rgba(88, 166, 255, 0.4) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(47, 107, 255, 0.18) !important;
}

/* Product <a> — ROW layout: [img LEFT] + [product name RIGHT]
   KEY FIX: flex-direction:row  (was column → caused the double-image bug) */
.mkm-drawer .woocommerce-mini-cart-item>a:not(.remove) {
  display: flex !important;
  flex-direction: row !important;
  /* ← image LEFT, name RIGHT — not stacked */
  align-items: flex-start !important;
  gap: 12px !important;
  padding-right: 30px !important;
  /* clearance for absolute × button */
  text-decoration: none !important;
  color: #e8eefc !important;
  font-size: 0.87rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;

  /* neutralise old grid-inside-grid */
  grid-column: unset !important;
  grid-template-columns: unset !important;
  width: auto !important;
}

.mkm-drawer .woocommerce-mini-cart-item>a:not(.remove):hover {
  color: #58a6ff !important;
}

/* Product image — fixed 60 × 60, left side of the row */
.mkm-drawer .woocommerce-mini-cart-item img {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  flex-shrink: 0 !important;
  object-fit: cover !important;
  border-radius: 10px !important;
  border: 1px solid rgba(88, 166, 255, 0.2) !important;
  background: rgba(11, 17, 32, 0.9) !important;
  display: block;
  order: 0 !important;
  /* reset order:-1 from old blocks */
  grid-column: unset !important;
  grid-row: unset !important;
}

/* Override the `width:100px !important` from mkm.css line 2707 with a
   more-specific selector that wins even at equal source-order specificity */
.mkm-drawer .woocommerce-mini-cart-item>a:not(.remove) img.attachment-woocommerce_thumbnail,
.mkm-drawer .woocommerce-mini-cart-item>a:not(.remove) img.size-woocommerce_thumbnail,
.mkm-drawer .woocommerce-mini-cart-item>a:not(.remove) img.wp-post-image {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
}

/* Quantity — sits below the <a> row, indented to align with the name */
.mkm-drawer .woocommerce-mini-cart-item .quantity {
  display: block !important;
  margin: 0 !important;
  padding-left: 72px !important;
  /* img(60) + gap(12) = 72 */
  color: #7db2ff !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  grid-column: unset !important;
  grid-row: unset !important;
}

.mkm-drawer .woocommerce-mini-cart-item .quantity .amount {
  color: #58a6ff !important;
  font-weight: 700 !important;
}

/* Remove (×) button — absolute top-right corner of the card */
.mkm-drawer .woocommerce-mini-cart-item a.remove {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 125, 143, 0.4) !important;
  background: rgba(255, 90, 110, 0.12) !important;
  color: #ff7d8f !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.15s !important;
  order: 0 !important;
  grid-column: unset !important;
}

.mkm-drawer .woocommerce-mini-cart-item a.remove:hover {
  background: rgba(255, 90, 110, 0.28) !important;
  border-color: rgba(255, 125, 143, 0.7) !important;
  transform: scale(1.1) !important;
}

/* ── Subtotal row ────────────────────────────────────────────────── */
.mkm-drawer .woocommerce-mini-cart__total {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 12px 14px !important;
  margin-top: 12px !important;
  border: 1px solid rgba(88, 166, 255, 0.22) !important;
  border-radius: 12px !important;
  background: rgba(47, 107, 255, 0.1) !important;
  font-size: 0.9rem !important;
  color: #e8eefc !important;
}

.mkm-drawer .woocommerce-mini-cart__total strong {
  font-weight: 600 !important;
  color: #e8eefc !important;
}

.mkm-drawer .woocommerce-mini-cart__total .amount {
  color: #58a6ff !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
}

/* WC default buttons hidden — theme provides View Cart / Checkout in footer */
.mkm-drawer .woocommerce-mini-cart__buttons {
  display: none !important;
}

/* Empty cart message */
.mkm-drawer .woocommerce-mini-cart__empty-message {
  margin: 8px 0 !important;
  padding: 20px 14px !important;
  border-radius: 12px !important;
  border: 1px dashed rgba(88, 166, 255, 0.28) !important;
  background: rgba(11, 17, 32, 0.6) !important;
  text-align: center !important;
  color: #93a3c4 !important;
  font-size: 0.85rem !important;
}

/* ── Footer (View Cart / Checkout buttons) ───────────────────────── */
.mkm-drawer-foot {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  padding: 14px !important;
  border-top: 1px solid rgba(88, 166, 255, 0.25) !important;
  background: #060b18 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  position: sticky !important;
  bottom: 0 !important;
  margin-top: auto !important;
  flex-shrink: 0 !important;
  z-index: 100 !important;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.75) !important;
}

.mkm-drawer-foot .mkm-btn {
  justify-content: center !important;
  width: 100% !important;
  text-align: center !important;
  padding: 12px 16px !important;
  font-size: 0.87rem !important;
  order: 0 !important;
}

.mkm-drawer-foot .mkm-btn-ghost {
  order: 0 !important;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .mkm-drawer-body {
    padding: 10px !important;
  }

  .mkm-drawer .woocommerce-mini-cart-item img {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
  }

  .mkm-drawer .woocommerce-mini-cart-item .quantity {
    padding-left: 60px !important;
    /* img(48)+gap(12) */
  }

  .mkm-drawer-foot {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Mobile Category Off-Canvas Drawer & Accordion Styling
   ========================================================================== */

.mkm-mobile-cat-bar {
  display: none;
  width: 100%;
  margin: 20px 10px 0 0;
}

@media (max-width: 768px) {
  .mkm-mobile-cat-bar {
    display: flex !important;
    justify-content: center;
    align-items: center;
  }

  .mkm-desktop-pills {
    display: none !important;
  }
}

.mkm-cat-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.mkm-cat-filter-btn:hover,
.mkm-cat-filter-btn:focus {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(56, 189, 248, 0.08) 100%);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.2);
}

.mkm-cat-filter-btn .mkm-i {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.mkm-filter-count-badge,
.mkm-active-cat-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 4px;
}

/* Off-Canvas Category Drawer Container */
.mkm-cat-drawer {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.mkm-cat-drawer.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.mkm-cat-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mkm-cat-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  background: #0b0f19;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.65);
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.mkm-cat-drawer.is-open .mkm-cat-drawer-panel {
  transform: translateX(0);
}

/* Drawer Header */
.mkm-cat-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.8);
}

.mkm-cat-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.mkm-cat-drawer-title .mkm-i {
  width: 20px;
  height: 20px;
  color: #38bdf8;
}

.mkm-cat-drawer-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mkm-cat-drawer-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Drawer Body & Category Tree */
.mkm-cat-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.mkm-cat-tree {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mkm-cat-tree-item {
  display: flex;
  flex-direction: column;
}

.mkm-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.mkm-cat-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.mkm-cat-tree-item.is-active-parent>.mkm-cat-row,
.mkm-cat-tree-item.is-active>.mkm-cat-row {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.mkm-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  padding: 10px 14px;
  text-decoration: none;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.mkm-cat-link.is-active,
.mkm-cat-tree-item.is-active>.mkm-cat-row .mkm-cat-title {
  color: #38bdf8;
  font-weight: 700;
}

.mkm-cat-count {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 8px;
}

/* Subcategory Toggle Button (Right Side Icon) */
.mkm-cat-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.mkm-cat-toggle-btn:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.mkm-cat-toggle-btn .mkm-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mkm-cat-tree-item.is-expanded>.mkm-cat-row .mkm-cat-toggle-btn .mkm-chevron,
.cat-parent.is-expanded>.mkm-woo-widget-toggle .mkm-chevron {
  transform: rotate(180deg);
}

/* Subcategory Sub-Tree */
.mkm-sub-cat-tree {
  list-style: none !important;
  margin: 6px 0 6px 16px !important;
  padding: 4px 0 4px 12px !important;
  border-left: 2px solid rgba(56, 189, 248, 0.25);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mkm-sub-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #cbd5e1;
  font-size: 13px;
  transition: all 0.2s ease;
}

.mkm-sub-cat-link:hover,
.mkm-sub-cat-item.is-active .mkm-sub-cat-link {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-weight: 600;
}

/* Desktop Pills Dropdown Styling */
.mkm-desktop-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mkm-filter-wrapper {
  position: relative;
  display: inline-flex;
}

.mkm-filter-wrapper.has-dropdown .mkm-filter {
  padding-right: 28px;
  position: relative;
}

.mkm-pill-arrow {
  width: 14px;
  height: 14px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
}

.mkm-filter-wrapper:hover .mkm-pill-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.mkm-filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 190px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99;
}

.mkm-filter-wrapper:hover .mkm-filter-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mkm-filter-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  color: #cbd5e1;
  font-size: 13px;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.mkm-filter-dropdown-item:hover,
.mkm-filter-dropdown-item.is-active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* Enhancements for standard WooCommerce Sidebar Category Widgets */
.widget_product_categories .cat-parent {
  position: relative;
}

.widget_product_categories .mkm-woo-widget-toggle {
  position: absolute;
  right: 6px;
  top: 6px;
  border-left: none;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Mobile Responsive Padding, Margin & Font Size Compact Optimization
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. Global Containers & Section Padding */
  .mkm-wrap,
  .mkm-narrow,
  .mkm-container,
  .woocommerce-page,
  .woocommerce,
  .mkm-main,
  #mkm-main {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .mkm-section {
    padding: 20px 0 !important;
  }

  .mkm-section-tight {
    padding: 12px 0 !important;
  }

  .mkm-pagehead {
    padding: 24px 0 16px !important;
  }

  .mkm-mt {
    margin-top: 14px !important;
  }

  .mkm-mb {
    margin-bottom: 14px !important;
  }

  .mkm-panel {
    padding: 14px 12px !important;
    border-radius: 10px !important;
  }

  /* 2. Page Headers & Typography */
  .mkm-eyebrow {
    font-size: 0.62rem !important;
    letter-spacing: 0.15em !important;
    margin-bottom: 4px !important;
  }

  .mkm-h1,
  .mkm-h1-sm,
  h1.page-title,
  .mkm-section-head h2 {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    margin-bottom: 6px !important;
  }

  .mkm-lead {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
  }

  /* 3. Product Cards Grid & Layout (Compact 2-Column ONLY for Products on Mobile) */
  .mkm-product-grid,
  .mkm-grid.mkm-product-grid,
  .mkm-shop-grid,
  .mkm-products-grid,
  .mkm-products .mkm-grid,
  .mkm-shop .mkm-grid,
  .mkm-category-products .mkm-grid,
  .mkm-woo-main .mkm-grid,
  .woocommerce ul.products,
  .woocommerce-page ul.products,
  ul.products,
  .wc-block-grid__products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-top: 12px !important;
  }

  .woocommerce ul.products li.product,
  .woocommerce-page ul.products li.product,
  .woocommerce ul.products[class*="columns-"] li.product,
  .woocommerce-page ul.products[class*="columns-"] li.product,
  ul.products li.product {
    width: auto !important;
    max-width: 100% !important;
    float: none !important;
    clear: none !important;
    margin-right: 0 !important;
  }

  /* 4. Non-Product Box Grids & Blog Posts (1 Column ONLY on Mobile) */
  .mkm-grid:not(.mkm-product-grid),
  .mkm-grid-2:not(.mkm-product-grid),
  .mkm-grid-3:not(.mkm-product-grid),
  .mkm-grid-4:not(.mkm-product-grid),
  .mkm-blog .mkm-grid,
  .mkm-post-grid,
  .mkm-why-grid,
  .mkm-reviews-grid,
  .mkm-cat-grid,
  .mkm-focus-grid,
  .mkm-process-grid,
  .mkm-stats-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-top: 14px !important;
  }

  /* 5. Footer Grid (Explore & Legal Side-by-Side in 1 Row on Mobile) */
  .mkm-footer-grid,
  #mkm-footer-widgets,
  .footer-widgets {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px 12px !important;
  }

  /* About / First Column: Full Width 100% */
  .mkm-footer-about,
  .mkm-footer-grid > .mkm-footer-col:first-child,
  #mkm-footer-widgets .mkm-widget:first-child {
    flex: 0 0 100% !important;
    width: 100% !important;
  }

  /* Explore & Legal Columns: 50% Width Each (2 Columns in 1 Row) */
  .mkm-footer-nav,
  .mkm-footer-grid > .mkm-footer-col:nth-child(2),
  .mkm-footer-grid > .mkm-footer-col:nth-child(3),
  #mkm-footer-widgets .mkm-widget:nth-child(2),
  #mkm-footer-widgets .mkm-widget:nth-child(3),
  .mkm-footer-grid > .widget_nav_menu {
    flex: 0 0 calc(50% - 6px) !important;
    width: calc(50% - 6px) !important;
    max-width: 50% !important;
    box-sizing: border-box !important;
  }

  /* Contact / Last Column: Full Width 100% */
  .mkm-footer-grid > .mkm-footer-col:last-child,
  .mkm-footer-grid > .mkm-footer-col:nth-child(4),
  #mkm-footer-widgets .mkm-widget:last-child {
    flex: 0 0 100% !important;
    width: 100% !important;
  }

  .mkm-card,
  ul.products li.product {
    padding: 10px !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
  }

  /* Card Image Area */
  .mkm-card-media,
  ul.products li.product a img {
    height: 130px !important;
    max-height: 130px !important;
  }

  .mkm-card-media img {
    max-height: 130px !important;
    object-fit: contain !important;
  }

  /* Card Body & Title */
  .mkm-card-body {
    margin-top: 8px !important;
  }

  .mkm-tag {
    font-size: 0.55rem !important;
    letter-spacing: 0.12em !important;
    margin-bottom: 2px !important;
  }

  .mkm-card-body h3,
  ul.products li.product .woocommerce-loop-product__title,
  ul.products li.product h2,
  ul.products li.product h3 {
    font-size: 0.88rem !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    margin: 4px 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.5em;
  }

  .mkm-meta,
  .mkm-excerpt,
  ul.products li.product .woocommerce-loop-product__desc {
    font-size: 0.72rem !important;
    line-height: 1.3 !important;
    margin-top: 4px !important;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Card Footer & Price */
  .mkm-card-foot {
    margin-top: 8px !important;
    padding-top: 8px !important;
    gap: 6px !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .mkm-price,
  ul.products li.product .price,
  span.price,
  .amount {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    width: 100% !important;
  }

  /* Compact Add to Cart / Action Button */
  .mkm-card .mkm-btn,
  .mkm-card-foot .mkm-btn,
  ul.products li.product .button,
  .add_to_cart_button {
    padding: 6px 8px !important;
    font-size: 0.75rem !important;
    min-height: 30px !important;
    height: auto !important;
    line-height: 1.2 !important;
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 6px !important;
  }

  /* 6. Single Product Page Typography & Spacing Compact Overrides */
  .product .product_title {
    font-size: 1.4rem !important;
    line-height: 1.25 !important;
  }

  .product .price {
    font-size: 1.2rem !important;
  }

  .single-product div.product form.cart {
    margin-top: 12px !important;
    margin-bottom: 12px !important;
  }
}