/* ============================================================
   Mobile-first layer for Sharine's Sharing
   Loaded after the theme so it only overrides where it matters.
   Traffic is almost entirely phones, most of it from short video.
   ============================================================ */

/* --- 1. stop horizontal scroll / iOS quirks --- */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }

/* 16px inputs: anything smaller makes iOS Safari zoom on focus,
   which feels broken on a phone. */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
select,
textarea {
  font-size: 16px;
}

/* --- 2. tap targets --- */
.wp-block-button__link,
button,
input[type="submit"],
.wc-block-components-button,
.woocommerce a.button,
.woocommerce button.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 24px;
  padding-right: 24px;
}

/* --- 3. product grids: two up on a phone --- */
@media (max-width: 781px) {
  ul.wc-block-product-template,
  ul.wc-block-grid__products,
  .wp-block-woocommerce-product-template ul.products,
  .wp-block-woocommerce-product-collection ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
  ul.wc-block-product-template > li,
  ul.wc-block-grid__products > li,
  .wp-block-woocommerce-product-template ul.products > li,
  .wp-block-woocommerce-product-collection ul.products > li {
    width: 100% !important;
    margin: 0 !important;
  }
}

/* --- 4. type scale on small screens --- */
@media (max-width: 781px) {
  h1, .wp-block-post-title { font-size: clamp(26px, 7.4vw, 34px) !important; line-height: 1.15; }
  h2 { font-size: clamp(21px, 5.6vw, 26px) !important; }
  h3 { font-size: clamp(18px, 4.6vw, 22px) !important; }
  p, li { font-size: 15.5px; line-height: 1.62; }

  /* theme headers use 85% width; on a phone that wastes the screen */
  .header-sec,
  .footer-wrap,
  .rights-box-upper { width: 92% !important; max-width: 92% !important; }
}

/* --- 5. sticky action bar, phones only ---
   A short-video visitor lands, scrolls two screens, and needs one obvious
   way back into the catalogue at any point. */
.sharine-mobile-bar {
  display: none;
}

@media (max-width: 781px) {
  .sharine-mobile-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: #ffffff;
    border-top: 1px solid #e6e1d9;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .06);
  }
  .sharine-mobile-bar a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    text-decoration: none;
  }
  .sharine-mobile-bar .bar-primary {
    background: #1a1a1a;
    color: #fff;
  }
  .sharine-mobile-bar .bar-secondary {
    background: #f3efe8;
    color: #1a1a1a;
    flex: 0 0 38%;
  }
  /* never cover the actual checkout flow */
  .woocommerce-cart .sharine-mobile-bar,
  .woocommerce-checkout .sharine-mobile-bar,
  .woocommerce-account .sharine-mobile-bar { display: none; }

  /* room so the bar doesn't sit on top of the footer */
  body { padding-bottom: 76px; }
}

/* --- 6. tap feedback, quietly --- */
@media (hover: none) {
  a:active { opacity: .72; }
  .wp-block-button__link:active { transform: translateY(1px); }
}

/* --- 7. keep long words from breaking the layout --- */
h1, h2, h3, p, li, a { overflow-wrap: break-word; }
