/* ================================================================
   STEP-4 CORRECTIONS — SilkRoad Pharmacy (SRP only)
   Item 1: custom navigation menu replaces the native select sheet
   Item 2: archive cards auto-flip while scrolling (mobile/tablet)
   Item 4: bottom-bar icon rings + boxed Pages/Categories panels
   Item 5: product purchase row (all viewports)
   Loaded after mob3.css; the mobile sections are gated to
   max-width 991.98px like the rest of the mobile layer.
   ================================================================ */

@keyframes step4spin { to { transform: rotate(360deg); } }

/* ---------------- Item 5: purchase row (ALL viewports) ----------
   Stepper and Add to cart share ONE row; the quantity input keeps a
   fixed width whatever is typed; the button flexes on narrow
   screens and never drops to a second line. */
.add_to_cart_simple form.cart {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 10px;
}
.add_to_cart_simple form.cart .clearfix { display: none; }
.add_to_cart_simple .quantity.buttons_added {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  float: none;
  margin: 0;
}
.add_to_cart_simple .quantity .minus,
.add_to_cart_simple .quantity .plus {
  width: 40px;
  flex: 0 0 40px;
  height: 45px;
  box-sizing: border-box;
}
.add_to_cart_simple .quantity input.qty {
  width: 54px !important;
  flex: 0 0 54px;
  height: 45px;
  text-align: center;
  box-sizing: border-box;
}
.add_to_cart_simple .single_add_to_cart_button {
  flex: 1 1 auto;
  min-width: 0;
  height: 45px;
  margin: 0;
  float: none;
  white-space: nowrap;
}

/* ---------------- Items 1, 2, 4: mobile + tablet ---------------- */
@media (max-width: 991.98px) {

  /* ---- Item 1: custom navigation menu (black & white, boxed) ---- */
  select.main-menu-mobile.step4-native-hidden { display: none !important; }
  .step4-host { position: relative; }
  .step4-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    height: 35px;
    padding: 4px 10px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .2);
    font-size: 14px;
    line-height: 1.2;
    color: #555;
    text-align: left;
    cursor: pointer;
  }
  .step4-trigger .step4-chev { flex: 0 0 auto; width: 12px; height: 12px; }
  .step4-trigger .step4-chev svg {
    display: block; width: 12px; height: 12px;
    fill: none; stroke: #111; stroke-width: 2.4; stroke-linecap: round;
  }

  /* One boxed-menu design language: the top navigation panel, the
     Pages drop-up and the Categories drop-up all share it. */
  .step4-panel {
    background: #fff;
    border: 2px solid #111;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
    padding: 8px;
    box-sizing: border-box;
  }
  .step4-navpanel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 56vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1200;
  }
  .step4-navpanel.step4-open { display: block; }
  .step4-box {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #111;
    background: #fff;
    color: #111;
    padding: 10px 12px;
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }
  .step4-box:last-child { margin-bottom: 0; }
  .step4-box.step4-sub { margin-left: 14px; width: calc(100% - 14px); }
  .step4-box.step4-label {
    background: #111;
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: default;
  }

  /* ---- Item 2: scroll-driven auto flip ---- */
  #products li.product_item.step4-flip .image_container .loop_product.front {
    transform: rotateY(180deg) !important;
  }
  #products li.product_item.step4-flip .image_container .loop_products.back {
    transform: rotateY(0deg) !important;
  }
  /* Belt and braces: the old pill toggles never render again. */
  .mob3-fb { display: none !important; }

  /* ---- Item 4: bottom bar — richer icons, rotating rings ---- */
  .mob3-cell svg { width: 24px; height: 24px; }
  .mob3-cell .step4-ring {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }
  .mob3-cell .step4-ring::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(#111 0deg, #111 282deg, #e53935 318deg, #e53935 344deg, #111 360deg);
    animation: step4spin 7s linear infinite;
  }
  .mob3-cell .step4-disc {
    position: relative;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mob3-cell.mob3-active svg { stroke: #e53935; }
  .mob3-cell.mob3-active .mob3-label { color: #e53935; }
  /* ---- Owner's own idea (2026-11-05): the CART cell carries the site's
         camel inside its rotating ring, and this ring's red segment is
         dark green instead. Black + dark green, camel only. ---- */
  /* ---- Owner's SIGNAL (2026-11-05): the camel/cart ring does NOT spin.
         Green streams grow out of the ring's left and right midpoints and
         meet at the top and the bottom — seven times. On the seventh
         meeting, a white light blooms out of the two meeting points (out
         of the green functions, not out of the camel) and settles softly
         over the camel; then the whole cycle begins again. Meaning, in
         the owner's words: take your things and benefit — a sign of joy.
         One 14-second loop: six plain meetings, the seventh is the
         signal. Choreography lives only here, under .mob3-camel. ---- */
  .mob3-cell.mob3-camel .step4-ring::before { display: none; }
  .mob3-cell.mob3-camel .camel-svg {
    position: absolute;
    inset: 0;
    width: 40px;
    height: 40px;
    overflow: visible;
  }
  .mob3-cell.mob3-camel .cr-base {
    fill: none;
    stroke: #111;
    stroke-width: 2.4;
    opacity: .92;
  }
  .mob3-cell.mob3-camel .cr-q {
    fill: none;
    stroke: #0b6e35;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    opacity: 0;
    animation: camelMeet 14s linear infinite;
  }
  .mob3-cell.mob3-camel .cr-flash {
    fill: url(#camelGlow);
    stroke: none;
    opacity: 0;
    animation: camelBloom 14s linear infinite;
  }
  .mob3-cell.mob3-camel .step4-disc { overflow: hidden; }
  .mob3-cell.mob3-camel .camel-veil {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .55) 45%, rgba(255, 255, 255, 0) 78%);
    opacity: 0;
    pointer-events: none;
    animation: camelVeil 14s linear infinite;
  }
  @keyframes camelMeet {
    0% { stroke-dashoffset: 100; opacity: 0; }
    1% { opacity: 1; }
    6% { stroke-dashoffset: 0; }
    9% { stroke-dashoffset: 0; opacity: 1; }
    11% { opacity: 0; }
    12% { stroke-dashoffset: 100; opacity: 0; }
    13% { opacity: 1; }
    18% { stroke-dashoffset: 0; }
    21% { stroke-dashoffset: 0; opacity: 1; }
    23% { opacity: 0; }
    24% { stroke-dashoffset: 100; opacity: 0; }
    25% { opacity: 1; }
    30% { stroke-dashoffset: 0; }
    33% { stroke-dashoffset: 0; opacity: 1; }
    35% { opacity: 0; }
    36% { stroke-dashoffset: 100; opacity: 0; }
    37% { opacity: 1; }
    42% { stroke-dashoffset: 0; }
    45% { stroke-dashoffset: 0; opacity: 1; }
    47% { opacity: 0; }
    48% { stroke-dashoffset: 100; opacity: 0; }
    49% { opacity: 1; }
    54% { stroke-dashoffset: 0; }
    57% { stroke-dashoffset: 0; opacity: 1; }
    59% { opacity: 0; }
    60% { stroke-dashoffset: 100; opacity: 0; }
    61% { opacity: 1; }
    66% { stroke-dashoffset: 0; }
    69% { stroke-dashoffset: 0; opacity: 1; }
    71% { opacity: 0; }
    72% { stroke-dashoffset: 100; opacity: 0; }
    73% { opacity: 1; }
    78% { stroke-dashoffset: 0; }
    90% { stroke-dashoffset: 0; opacity: 1; }
    95% { stroke-dashoffset: 0; opacity: 0; }
    97%, 100% { stroke-dashoffset: 100; opacity: 0; }
  }
  @keyframes camelBloom {
    0%, 79% { opacity: 0; }
    84% { opacity: .95; }
    89% { opacity: .45; }
    93%, 100% { opacity: 0; }
  }
  @keyframes camelVeil {
    0%, 81% { opacity: 0; }
    88% { opacity: .62; }
    93% { opacity: .14; }
    96%, 100% { opacity: 0; }
  }
  .mob3-cell.mob3-camel .step4-disc img.mob3-camel-img {
    height: 27px;
    width: auto;
    display: block;
  }
  .mob3-cell.mob3-camel.mob3-active .mob3-label { color: #0b6e35; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important; }

  /* Pages / Categories drop-ups in the shared boxed language */
  .mob3-panel.step4-panel {
    border: 2px solid #111;
    border-bottom: none;
    padding: 10px;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .25);
  }
  .mob3-cats {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    display: none;
    background: #fff;
    max-height: 46vh;
    overflow-y: auto;
  }
  .mob3-cats.mob3-open { display: block; }
  .mob3-panel a.step4-box {
    display: flex;
    border: 1.5px solid #111;
    font-size: 13.5px;
    padding: 9px 12px;
  }
  .mob3-panel .step4-panel-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #111;
    margin: 1px 2px 8px;
  }
}

/* Desktop: the custom menu machinery stays out of the way; the
   native select keeps serving desktop exactly as before. */
@media (min-width: 992px) {
  .step4-trigger, .step4-navpanel { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mob3-cell .step4-ring::before { animation: none !important; }
  /* Camel signal rests as a complete green ring — no motion, no veil. */
  .mob3-cell.mob3-camel .cr-q {
    animation: none !important;
    stroke-dashoffset: 0;
    opacity: .9;
  }
  .mob3-cell.mob3-camel .cr-flash,
  .mob3-cell.mob3-camel .camel-veil { animation: none !important; opacity: 0; }
}

/* ---------------- Item 8: cart drawer header (ALL viewports) ----
   The icon-font bag glyph beside "Your Cart" is replaced by an
   inline SVG bag; the count becomes a clean pill badge. */
.xoo-wsch-basket .step4-cart-ico {
  display: inline-flex;
  width: 30px;
  height: 30px;
  color: #111;
}
.xoo-wsch-basket .step4-cart-ico svg { width: 30px; height: 30px; display: block; }
.xoo-wsch-basket .xoo-wscb-count {
  position: absolute;
  left: auto;
  right: -9px;
  top: -7px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

/* STEP4-C2 (audit correction): restore the reference card — the
   category label straddles the info box's top border. The theme's own
   design does this (.product_details .category { margin:-22px …;
   background:#FFF }), but the archive blades' later
   `.product_details p.category { margin: 0 0 6px }` reset silently
   cancelled it, leaving the label inside the box and the card looking
   detached. This rule restores the theme values with a stronger
   selector; the blades' font sizing is untouched. */
body .product_item .product_details p.category {
  margin: -22px 25px 10px 25px;
  padding: 5px;
  line-height: 10px;
  background: #fff;
}

/* ---------------- Step-4 correction C3: desktop refinements (STEP4-C3) ----
   (a) ADD TO CART keeps its original compact size on desktop: the
       purchase-row flex stretch is for narrow screens, where the row
       is short; on a wide info column flex:1 stretched the button
       across the whole column.
   (b) The description tabs block (side rail + panel, together) sits a
       little higher on desktop, closing the empty band above it. */
@media (min-width: 992px) {
  .add_to_cart_simple .single_add_to_cart_button { flex: 0 0 auto; width: auto; }
  .product_tabs { margin-top: -35px; }
}

/* AUDITFIX30: long unbreakable product names (chemical names) must wrap
   inside their title, never push the page wider than the screen. */
.product_title, .entry-title, .product-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* AUDITFIX-30 continued (mobile home cards): on a phone the home sliders
   show one card at nearly full width, and its image area — the link that
   wraps the front/back pictures — stretched unbounded into a giant slab
   that read as a black void until (or unless) the picture loaded. The
   image area now keeps the desktop card's own 270/247 shape, capped in
   height, on a light ground, and the picture is contained inside it. */
@media (max-width: 640px) {
  /* IMGFRAME (owner report, 2026-11-08): the product photos carry their own
     white ground, so the old #f4f4f4 slab made every picture read as a small
     white rectangle floating in grey, and grid cards had no frame at all.
     Now every product card (home sliders + shop/category grids) gets the
     same white frame with a hairline edge, the front/back layers fill it
     exactly, and the picture is contained whole — never cropped. */
  .product_item .image_container a.prodimglink {
    display: block;
    position: relative;
    aspect-ratio: 270 / 247;
    max-height: 260px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 6px;
  }
  .product_item .image_container .loop_product,
  .product_item .image_container .loop_products {
    position: absolute;
    inset: 0;
    height: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  .product_item .image_container .loop_product { z-index: 2; }
  .product_item .image_container .loop_products { z-index: 1; }
  .product_item .image_container picture {
    display: block;
    width: 100%;
    height: 100%;
  }
  .product_item .image_container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
