/**
 * Gallianse Mobile Fix — mobile-first styles (frontend).
 * Loaded by the Gallianse Mobile Fix plugin on every frontend page.
 * Applies to phones and small tablets (<= 767px).
 */

@media (max-width: 767px) {

  /* ---------- Global ---------- */
  html,
  body {
    overflow-x: hidden;
  }

  body {
    /* Keep content clear of the floating accessibility button. */
    padding-bottom: 72px;
  }

  /* ---------- Header ---------- */
  #header .ct-container {
    padding: 0 16px;
  }

  /* Bigger touch targets for cart / wishlist icons in the top bar. */
  #header .ct-cart-item,
  #header .ct-header-wishlist,
  #header .ct-header-account a,
  #header [data-device="mobile"] .ct-menu-link {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ---------- Home page ---------- */
  .g-hero {
    padding: 24px 20px 56px !important;
  }

  .g-hero h1 {
    font-size: clamp(34px, 9vw, 46px);
    line-height: 1.15;
  }

  /* Tighten the dead space above the hero on phones: the theme container's
     top padding plus the empty page-title margin plus the hero padding
     stacked into ~138px of empty space. Keep about one third of it. */
  body.home .ct-container-full {
    padding-top: 16px;
  }

  body.home .hero-section {
    margin-bottom: 0;
  }

  .g-hero-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .g-btn {
    width: 100%;
    max-width: 320px;
    padding: 15px 24px;
    text-align: center;
    justify-content: center;
  }

  .g-trust-wide {
    padding: 20px 12px;
  }

  .g-trust div {
    font-size: 11px;
  }

  .g-sec {
    padding: 44px 20px 52px;
  }

  .g-sec-head {
    margin-bottom: 30px;
  }

  .g-sec-head h2 {
    font-size: clamp(22px, 5.5vw, 32px);
  }

  /* ---------- Product page ---------- */
  .dl-announcement {
    font-size: 17px;
    padding: 10px 14px;
    white-space: normal;
    line-height: 1.4;
  }

  .woocommerce-breadcrumb {
    font-size: 11px;
    line-height: 1.4;
  }

  /* Reorder the buy box so it appears right after the price on phones,
     instead of after the long description. */
  .entry-summary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .entry-summary > * {
    order: 20;
  }

  .entry-summary > .product_title { order: 1; }
  .entry-summary > .dl-tagline { order: 2; }
  .entry-summary > .price { order: 3; }
  .entry-summary > .dl-shipping-note { order: 4; }
  .entry-summary > .ct-product-add-to-cart { order: 5; }
  .entry-summary > .ct-product-additional-actions { order: 6; }
  .entry-summary > .ct-shipping-progress-single { order: 7; }
  .entry-summary > .gpp-section-title { order: 8; }
  .entry-summary > .ct-product-divider:nth-child(6) { order: 9; }
  .entry-summary > .woocommerce-product-details__short-description { order: 10; }
  .entry-summary > .gpp-full-desc { order: 11; }
  .entry-summary > .ct-product-divider:nth-child(9) { order: 12; }
  .entry-summary > .ct-product-divider:nth-child(12) { order: 13; }
  .entry-summary > .product_meta { order: 14; }
  .entry-summary > .ct-payment-methods { order: 15; }

  /* Bigger, clearer add-to-cart controls. */
  .ct-product-add-to-cart .single_add_to_cart_button,
  .ct-product-add-to-cart .quantity .qty {
    min-height: 48px;
  }

  .single_add_to_cart_button {
    width: 100%;
    justify-content: center;
  }

  .dl-size-guide-btn {
    min-height: 44px;
    padding: 0 16px;
  }

  /* ---------- Shop page ---------- */
  .woo-listing-top .ct-toggle-filter-panel {
    min-height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .woocommerce-ordering select {
    min-height: 44px;
  }
}

/* ---------- Related products visible on mobile/tablet ---------- */
@media (max-width: 999.98px) {
  section.related.products.ct-hidden-sm,
  section.related.products.ct-hidden-md {
    display: block !important;
  }
}

/* ---------- Global announcement marquee ---------- */
div.dl-announcement {
  display: flex;
  align-items: center;
  height: 65px;
  min-height: 65px;
  padding: 0;
  justify-content: center;
  overflow: hidden;
  position: relative;
  font-size: 20px;
  letter-spacing: 0.12em;
  background: #7b1e2b;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}
div.dl-announcement .dl-announcement-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  width: max-content;
  animation: dl-marquee 11s linear infinite;
}
div.dl-announcement:hover .dl-announcement-track {
  animation-play-state: paused;
}
div.dl-announcement .dl-announcement-track span {
  max-width: none;
  margin: 0;
  padding: 0 2rem;
  flex: 0 0 auto;
}
@keyframes dl-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (max-width: 560px) {
  div.dl-announcement { font-size: 12px; }
  div.dl-announcement .dl-announcement-track span { padding: 0 1.25rem; }
}

/* Desktop: pull the homepage hero up closer to the announcement marquee. */
@media (min-width: 768px) {
  body.home .ct-container-full {
    padding-top: 30px;
  }
}

/* Homepage: 15px gap between the hero and the trust strip, same on all screens. */
.g-hero {
  margin-bottom: 15px;
}
