/**
 * Art-Webstore Mobile Beauty v1.0.0
 * Mobile-only beauty layer for the toy shop homepage.
 * Everything in this file is scoped to @media (max-width: 768px).
 * Desktop output is intentionally untouched.
 */

@media (max-width: 768px) {

  /* ============ 1. HERO — full-bleed slider card ============ */

  .xw-slider-card {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    border-radius: 0 0 28px 28px;
    overflow: hidden;
  }

  /* legible gradient behind the caption */
  .xw-slider-card .caption-wrap {
    background: linear-gradient(to top, rgba(15, 12, 8, 0.62) 0%, rgba(15, 12, 8, 0) 100%);
    padding: 56px 22px 26px;
  }

  .xw-slider-card .caption h2 {
    color: #ffffff;
    font-size: clamp(2rem, 9vw, 3.5rem);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 0.55rem;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.65);
  }

  .xw-slider-card .caption p {
    color: rgba(255, 255, 255, 0.93);
    font-size: 1rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
    margin: 0 0 1rem;
  }

  .xw-slider-card .caption a.wp-block-button__link {
    display: inline-block;
    border-radius: 999px;
    background-color: #fbbf24;
    color: #1f1b16;
    font-weight: 700;
    padding: 0.8rem 1.7rem;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  }

  /* seasonal pill above the caption — pure CSS, no markup changes */
  .xw-slider-card .caption-wrap::before {
    content: "Halloween drop — limited";
    display: inline-block;
    background-color: #a3e635;
    color: #1f1b16;
    border-radius: 999px;
    padding: 0.35rem 0.95rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  /* FlexSlider arrows as round white buttons (slider stays fully functional) */
  .xw-slider-card .flex-direction-nav a {
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border-radius: 999px;
    background: #ffffff;
    opacity: 1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    overflow: hidden;
  }
  .xw-slider-card .flex-direction-nav a::before {
    color: #1f1b16;
    font-size: 22px;
    line-height: 46px;
    text-shadow: none;
  }

  /* pill paging dots */
  .xw-slider-card .flex-control-paging li a {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: none;
    transition: width 0.25s ease, background-color 0.25s ease;
  }
  .xw-slider-card .flex-control-paging li a.flex-active {
    width: 30px;
    background: #a3e635;
  }

  /* ============ 2. PRODUCT CAROUSELS (scroll-snap) ============ */

  .xw-products > .woocommerce.columns-6 > ul.products.columns-6,
  ul.products.awmb-carousel-on {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding: 18px 16px 32px; /* extra bottom room for the offset cards */
    margin: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .xw-products > .woocommerce.columns-6 > ul.products.columns-6::-webkit-scrollbar,
  ul.products.awmb-carousel-on::-webkit-scrollbar {
    display: none;
  }
  .xw-products > .woocommerce.columns-6 > ul.products.columns-6 > li.product,
  ul.products.awmb-carousel-on > li.product {
    flex: 0 0 64% !important;
    max-width: 270px;
    width: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    scroll-snap-align: start;
  }
  /* playful alternating vertical offset */
  .xw-products > .woocommerce.columns-6 > ul.products.columns-6 > li.product:nth-child(odd),
  ul.products.awmb-carousel-on > li.product:nth-child(odd) {
    transform: translateY(14px);
  }

  /* carousel header row (injected by JS): counter + round arrows */
  .awmb-car-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 16px 10px;
  }
  .awmb-car-count {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #1f1b16;
    background: #f1ede2;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .awmb-car-nav {
    display: flex;
    gap: 8px;
  }
  .awmb-car-prev,
  .awmb-car-next {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(31, 27, 22, 0.14);
    background: #ffffff;
    color: #1f1b16;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(31, 27, 22, 0.08);
    padding: 0 0 2px;
  }
  .awmb-car-prev:disabled,
  .awmb-car-next:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
  }

  /* ============ 3. STICKY FILTER PILLS ============ */

  .xw-pills {
    position: sticky !important;
    top: 70px; /* clears the glass header */
    z-index: 40; /* stays under the header */
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 10px 26px rgba(31, 27, 22, 0.12);
    padding: 8px 12px;
    margin: 0 0 14px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .xw-pills::-webkit-scrollbar {
    display: none;
  }
  .xw-pills > a.xw-pill {
    flex: 0 0 auto;
  }

  /* ============ 4. LIGHT/DARK SECTION ALTERNATION ============ */

  .xw-banners,
  .awdr-carousel,
  .xw-cta,
  .xw-contact-cta,
  section:has(> a[href$="/contact/"]) {
    background-color: #1f1b16;
    border-radius: 28px;
    color: #f5f1e8;
  }
  .xw-banners {
    padding: 20px 16px;
  }
  .awdr-carousel {
    padding: 26px 18px 22px;
  }

  /* nested light text inside dark sections */
  .awdr-carousel .awdr-text,
  .awdr-carousel .awdr-author,
  :where(.xw-cta, .xw-contact-cta, section:has(> a[href$="/contact/"])) :is(h2, h3, p) {
    color: #f5f1e8;
  }
  .awdr-carousel .awdr-date {
    color: rgba(245, 241, 232, 0.62);
  }
  .awdr-carousel .awdr-stars {
    color: #fbbf24;
  }
  :where(.xw-banners, .awdr-carousel, .xw-cta) :is(.price, .amount) {
    color: #fbbf24;
  }

  /* review arrows + dots on dark */
  .awdr-carousel .awdr-arrow {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #ffffff;
    color: #1f1b16;
    border: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  }
  .awdr-carousel .awdr-dot {
    background: rgba(245, 241, 232, 0.35);
  }
  .awdr-carousel .awdr-dot.active,
  .awdr-carousel .awdr-dot[aria-selected="true"] {
    background: #a3e635;
  }

  /* final CTA link as a warm yellow pill */
  :where(.xw-cta, .xw-contact-cta, section:has(> a[href$="/contact/"])) a[href$="/contact/"] {
    display: inline-block;
    border-radius: 999px;
    background-color: #fbbf24;
    color: #1f1b16;
    font-weight: 700;
    padding: 0.85rem 1.8rem;
    text-decoration: none;
  }

  /* ============ 5. SCROLL ANIMATIONS (staggered) ============ */

  @media (prefers-reduced-motion: no-preference) {
    @keyframes awmb-fadeSlideUp {
      from {
        opacity: 0;
        transform: translateY(26px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* pre-hide only when our JS is active, so content can never get stuck invisible */
    .awmb-js :is(.xw-sec-head, .xw-cat, .xw-banner, .awdr-slide):not(.is-visible):not(.awmb-in) {
      opacity: 0;
      transform: translateY(26px);
    }
    :is(.xw-sec-head, .xw-cat, .xw-banner, .awdr-slide):is(.is-visible, .awmb-in) {
      animation: awmb-fadeSlideUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }

    /* stagger: top categories */
    .xw-cats .xw-cat:is(.is-visible, .awmb-in):nth-child(2) { animation-delay: 0.08s; }
    .xw-cats .xw-cat:is(.is-visible, .awmb-in):nth-child(3) { animation-delay: 0.16s; }
    .xw-cats .xw-cat:is(.is-visible, .awmb-in):nth-child(4) { animation-delay: 0.24s; }
    .xw-cats .xw-cat:is(.is-visible, .awmb-in):nth-child(5) { animation-delay: 0.32s; }
    /* stagger: promo banners */
    .xw-banners .xw-banner:is(.is-visible, .awmb-in):nth-child(2) { animation-delay: 0.1s; }
    .xw-banners .xw-banner:is(.is-visible, .awmb-in):nth-child(3) { animation-delay: 0.2s; }
    /* stagger: review slides */
    .awdr-track .awdr-slide:is(.is-visible, .awmb-in):nth-child(2) { animation-delay: 0.08s; }
    .awdr-track .awdr-slide:is(.is-visible, .awmb-in):nth-child(3) { animation-delay: 0.16s; }
  }

  /* ============ 6. SIGNATURE "TOY TRAIL" DIVIDER ============ */

  .xw-trail {
    border-top: 3px dashed #a3e635;
    margin: 30px 24px;
    position: relative;
  }
  .xw-trail::after {
    content: "";
    position: absolute;
    top: -8px;
    right: -3px;
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background-color: #a3e635;
    box-shadow: 0 0 0 5px rgba(163, 230, 53, 0.22);
  }

} /* end @media (max-width: 768px) */
