/* Vape Taiwan — mobile polish (sitewide)
   Keeps cool-retail tokens; improves rhythm, touch, and density under 849px. */

@media (max-width: 849px) {
  :root {
    --row-padding: 14px;
    --section-gap: 44px;
    --radius-card: 14px;
    --mobile-gutter: 14px;
    --touch: 44px;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    font-size: 15.5px;
    line-height: 1.6;
    background-image:
      radial-gradient(720px 380px at 92% -12%, rgba(11, 110, 79, 0.16), transparent 58%),
      radial-gradient(560px 320px at -10% 12%, rgba(70, 95, 120, 0.12), transparent 52%),
      linear-gradient(180deg, #dfe6ec 0%, #e8edf2 42%, #eef2f5 100%);
  }

  /* ---- Header / chrome ---- */
  #top-bar.header-top,
  .header-top {
    min-height: 2rem;
  }

  #top-bar .nav > li > a,
  #top-bar .html,
  #top-bar .top-bar-nav a {
    font-size: 0.72rem !important;
    letter-spacing: 0.04em !important;
  }

  .header-inner {
    min-height: 3.65rem;
    padding-left: 4px;
    padding-right: 4px;
  }

  #logo img.header-logo,
  #logo .header_logo {
    max-height: 28px !important;
  }

  .header .logo-text {
    font-size: 1.12rem !important;
  }

  /* Larger tap targets for icon actions */
  .header-nav .nav-top-link,
  .header-nav .cart-item > a,
  .header-nav .account-link > a,
  .header-nav .header-search-dropdown > a,
  a[data-open="#main-menu"],
  .mobile-nav > a,
  .nav > li > a.icon-menu {
    min-width: var(--touch);
    min-height: var(--touch);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .off-canvas .nav-sidebar > li > a,
  #main-menu .nav-sidebar > li > a {
    font-family: var(--font-display) !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    padding: 0.85rem 1rem !important;
    border-radius: 10px;
    margin: 2px 8px;
  }

  .off-canvas .nav-sidebar > li > a:hover,
  .off-canvas .nav-sidebar > li.active > a {
    background: rgba(11, 110, 79, 0.1) !important;
    color: var(--color-primary) !important;
  }

  /* ---- Page gutters ---- */
  .container,
  .row-container > .container,
  .tw-container,
  .page-wrapper > .row,
  .shop-container .container {
    padding-left: var(--mobile-gutter) !important;
    padding-right: var(--mobile-gutter) !important;
  }

  .section,
  .section-content {
    padding-top: 1.35rem;
    padding-bottom: 1.35rem;
  }

  h1,
  .page-title h1,
  .tw-archive-title {
    font-size: clamp(1.45rem, 6.2vw, 1.85rem) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.03em;
  }

  h2 {
    font-size: clamp(1.2rem, 5vw, 1.45rem) !important;
    letter-spacing: -0.02em;
  }

  /* ---- Product loops ---- */
  ul.products {
    gap: 0.85rem !important;
    padding: 0.85rem !important;
    border-radius: 16px !important;
    margin-bottom: 1.25rem !important;
  }

  ul.products.columns-2 > li.product,
  ul.products.columns-3 > li.product,
  ul.products.columns-4 > li.product,
  .row .product-small {
    margin-bottom: 0 !important;
  }

  .product-small .box-image,
  ul.products li.product .box-image {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(18, 20, 23, 0.06);
  }

  .product-small:hover .box-image,
  ul.products li.product:hover .box-image {
    transform: none;
  }

  .product-small .box-text,
  ul.products li.product .box-text {
    padding: 0.65rem 0.2rem 0.35rem !important;
  }

  ul.products li.product .product-title,
  ul.products li.product .woocommerce-loop-product__title,
  .product-small .product-title a {
    font-size: 0.88rem !important;
    line-height: 1.35 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  ul.products li.product .price,
  .product-small .price {
    font-size: 0.98rem !important;
    margin-top: 0.25rem !important;
  }

  .badge,
  .onsale {
    font-size: 0.68rem !important;
    padding: 0.2rem 0.45rem !important;
  }

  .quick-view {
    font-size: 0.72rem !important;
    letter-spacing: 0.02em;
  }

  /* ---- Archive heading ---- */
  .tw-archive-heading {
    margin: 0.35rem 0 0.85rem;
    padding: 0;
  }

  .category-filtering,
  .woocommerce-ordering,
  .woocommerce-result-count {
    font-size: 0.82rem;
  }

  .filter-button,
  .category-filter-row a {
    min-height: 2.5rem;
    border-radius: 999px !important;
    padding: 0.45rem 0.9rem !important;
  }

  /* ---- Single product ---- */
  .single-product .product-gallery,
  .single-product .woocommerce-product-gallery {
    border-radius: 14px;
    margin-bottom: 0.85rem;
  }

  .single-product .product-info,
  .single-product .product-summary,
  .single-product .summary {
    padding: 1rem !important;
    border-radius: 14px;
    margin-bottom: 1rem;
  }

  .single-product .product-title,
  .single-product .product_title {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
  }

  .single-product .price {
    font-size: 1.35rem !important;
    margin: 0.4rem 0 0.85rem !important;
  }

  .single-product .variations,
  .single-product .variations td,
  .single-product .variations th {
    display: block;
    width: 100% !important;
    text-align: left;
  }

  .single-product .variations select,
  .single-product .quantity input.qty {
    min-height: var(--touch);
    width: 100%;
    font-size: 16px !important; /* avoid iOS zoom */
  }

  .single-product .cart .button,
  .single-product .single_add_to_cart_button {
    min-height: 3rem !important;
    width: 100% !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 24px rgba(11, 110, 79, 0.22);
  }

  .woocommerce-tabs,
  .product-footer,
  .related.products,
  .upsells.products {
    margin-top: 1.25rem;
  }

  .woocommerce-tabs ul.tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
  }

  .woocommerce-tabs ul.tabs li a {
    white-space: nowrap;
    padding: 0.55rem 0.85rem !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.7);
  }

  /* ---- Cart / checkout / account ---- */
  .woocommerce-cart .cart_totals,
  .woocommerce-checkout #order_review,
  .woocommerce-account .account-container,
  .woocommerce-form,
  .checkout-sidebar {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.85);
    padding: 1rem;
  }

  .woocommerce-cart table.shop_table,
  .woocommerce-checkout table.shop_table {
    border-radius: 12px;
    overflow: hidden;
  }

  .woocommerce-cart .button,
  .woocommerce-checkout .button,
  .woocommerce-form-login .button,
  .checkout-button,
  .wc-proceed-to-checkout a.checkout-button {
    min-height: 3rem !important;
    border-radius: 8px !important;
    font-family: var(--font-display) !important;
  }

  .woocommerce form .form-row input.input-text,
  .woocommerce form .form-row textarea,
  .woocommerce form .form-row select,
  .woocommerce-input-wrapper input,
  .woocommerce-Input {
    min-height: var(--touch);
    font-size: 16px !important;
    border-radius: 8px !important;
  }

  /* ---- Buttons / links general ---- */
  .button,
  button.button,
  a.button {
    min-height: 2.75rem;
  }

  /* ---- Breadcrumb ---- */
  .breadcrumb,
  .woocommerce-breadcrumb {
    font-size: 0.78rem;
    margin-bottom: 0.65rem !important;
    line-height: 1.4;
  }

  /* ---- Footer ---- */
  #footer,
  .footer-wrapper {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  #footer .footer-widgets,
  #footer .absolute-footer {
    padding-left: var(--mobile-gutter);
    padding-right: var(--mobile-gutter);
  }

  /* Floating contact / sticky UI clearance */
  .aecsf-fc,
  #aecsf-fc {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
  }

  /* Message bars */
  .woocommerce-message,
  .woocommerce-info,
  .woocommerce-error {
    border-radius: 12px !important;
    padding: 0.85rem 1rem !important;
  }
}

/* Narrow phones */
@media (max-width: 390px) {
  :root {
    --mobile-gutter: 12px;
  }

  ul.products {
    padding: 0.65rem !important;
    gap: 0.65rem !important;
  }

  ul.products li.product .product-title,
  .product-small .product-title a {
    font-size: 0.82rem !important;
  }

  .single-product .product-title,
  .single-product .product_title {
    font-size: 1.22rem !important;
  }
}

/* Homepage mobile refinements */
@media (max-width: 849px) {
  .tw-redesign-home .hero-inner {
    padding: 36px 0 28px !important;
  }

  .tw-redesign-home .hero-copy h1,
  .tw-redesign-home .hero-title {
    font-size: clamp(1.7rem, 8vw, 2.15rem) !important;
    line-height: 1.15 !important;
  }

  .tw-redesign-home .hero-copy p,
  .tw-redesign-home .hero-lead {
    font-size: 0.95rem !important;
    max-width: 34ch;
  }

  .tw-redesign-home .hero-actions,
  .tw-redesign-home .hero-cta {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1.1rem;
  }

  .tw-redesign-home .hero-actions .button,
  .tw-redesign-home .hero-cta .button,
  .tw-redesign-home .hero-actions a.btn {
    width: 100%;
    justify-content: center;
    min-height: 3rem;
  }

  #categories .tw-container {
    padding: 20px 14px 22px !important;
    border-radius: 18px !important;
  }

  .tw-categories-grid {
    gap: 12px !important;
  }

  .tw-cat-card {
    border-radius: 14px !important;
  }

  .tw-cat-card-body {
    padding: 0.85rem 0.95rem 1rem !important;
  }

  .tw-section {
    margin-block: 1.5rem !important;
  }

  .tw-section-title {
    margin-bottom: 1rem !important;
  }

  .tw-section-label {
    font-size: 0.72rem !important;
    letter-spacing: 0.12em !important;
  }

  .tw-trust-row,
  .tw-trust-items {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0.65rem !important;
  }

  .tw-trust-item {
    padding: 0.85rem 1rem !important;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.8);
  }

  .tw-puff-lane,
  .tw-puff-lanes {
    gap: 0.75rem !important;
  }

  .tw-faq-item {
    border-radius: 12px !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(18, 20, 23, 0.06);
    margin-bottom: 0.55rem;
  }

  .tw-faq-q {
    min-height: var(--touch);
    padding: 0.9rem 1rem !important;
    font-size: 0.95rem !important;
  }

  .tw-faq-a {
    padding: 0 1rem 1rem !important;
    font-size: 0.9rem !important;
  }

  #contact-cta .tw-footer-contact-module {
    border-radius: 18px !important;
  }

  #contact-cta .tw-footer-mega-btn {
    border-radius: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-small .box-image,
  ul.products li.product .box-image,
  .single-product .single_add_to_cart_button {
    transition: none !important;
    box-shadow: none;
  }
}
