/* PIYAMO v1.6.3.70 — compact checkout/account and Android WebView comfort.
   Loaded last, scoped to phones. Does not change checkout field names, checkout
   handlers, payment fields or WooCommerce validation. */
@media (max-width: 767px) {
  /* Native Android fling scrolling, no page-wide animated scroll while typing.
     Keep horizontal swipes on image galleries, filters, and sliders intact. */
  html { scroll-behavior: auto !important; -webkit-text-size-adjust: 100%; }
  html, body { overscroll-behavior-x: none; }
  body { touch-action: manipulation; }
  .piyamo-mobile-category-strip, .piyamo-mobile-category-filter,
  .piyamo-mobile-category-gallery, .piyamo-mobile-banner-slider,
  .piyamo-gallery, .product-gallery, .product-image-slider {
    -webkit-overflow-scrolling: touch;
  }

  /* Suppress Chromium's momentary blue tap/long-press selection flash on
     clickable cards without suppressing focus indicators for keyboard users. */
  .product-card, .product-card *,
  .woocommerce ul.products li.product,
  .woocommerce ul.products li.product * {
    -webkit-tap-highlight-color: transparent !important;
  }
  .product-card, .product-card a, .product-card button,
  .product-card .product-card-info, .product-card .piyamo-card-visual {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
  }
  .product-card img { -webkit-user-drag: none; user-select: none; }
  .product-card a:focus-visible, .product-card button:focus-visible,
  .product-card [tabindex]:focus-visible {
    outline: 2px solid var(--primary, #7b5a7c) !important;
    outline-offset: 2px !important;
  }

  /* Form panels no longer consume most of the phone viewport. */
  body.woocommerce-checkout .checkout-main { gap: 12px !important; }
  body.woocommerce-checkout .checkout-section { padding: 12px 13px !important; }
  body.woocommerce-checkout .checkout-section .section-title-row {
    gap: 8px !important; margin-bottom: 9px !important;
  }
  body.woocommerce-checkout .checkout-section .section-number {
    width: 24px !important; height: 24px !important; font-size: 12px !important;
  }
  body.woocommerce-checkout .checkout-section .section-heading {
    font-size: 15px !important; line-height: 1.25 !important;
  }
  body.woocommerce-checkout .login-prompt {
    display: flex !important; flex-flow: row wrap !important;
    align-items: center !important; gap: 3px 9px !important;
    padding: 7px 10px !important; margin-bottom: 10px !important;
    font-size: 12px !important; line-height: 1.3 !important;
  }
  body.woocommerce-checkout .login-prompt a { display: inline-flex !important; gap: 3px !important; }
  body.woocommerce-checkout .login-prompt a svg { width: 14px; height: 14px; }

  /* Two short names can share a row without making address or email cramped.
     16px input text prevents iOS auto zoom; 44px controls are touch friendly. */
  body.woocommerce-checkout .billing-fields-grid,
  body.woocommerce-checkout .shipping-fields-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 9px !important; row-gap: 7px !important;
    align-items: start !important;
  }
  body.woocommerce-checkout .billing-fields-grid > .form-field-custom,
  body.woocommerce-checkout .shipping-fields-grid > .form-field-custom {
    margin: 0 !important; min-width: 0 !important; overflow: visible !important;
  }
  body.woocommerce-checkout .billing-fields-grid > .form-field-custom.full-width,
  body.woocommerce-checkout .shipping-fields-grid > .form-field-custom.full-width,
  body.woocommerce-checkout .billing-fields-grid > .form-field-custom:not(.half-width),
  body.woocommerce-checkout .shipping-fields-grid > .form-field-custom:not(.half-width),
  body.woocommerce-checkout .billing-fields-grid > .triple-wrapper,
  body.woocommerce-checkout .shipping-fields-grid > .triple-wrapper {
    grid-column: 1 / -1 !important;
  }
  body.woocommerce-checkout .billing-fields-grid > .form-field-custom.half-width,
  body.woocommerce-checkout .shipping-fields-grid > .form-field-custom.half-width {
    grid-column: span 1 !important;
  }
  body.woocommerce-checkout .billing-fields-grid .triple-wrapper,
  body.woocommerce-checkout .shipping-fields-grid .triple-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px 9px !important; overflow: visible !important;
  }
  body.woocommerce-checkout .billing-fields-grid .triple-wrapper > .form-field-custom,
  body.woocommerce-checkout .shipping-fields-grid .triple-wrapper > .form-field-custom {
    margin: 0 !important; grid-column: span 1 !important;
  }
  body.woocommerce-checkout .billing-fields-grid .triple-wrapper > #billing_postcode_field,
  body.woocommerce-checkout .shipping-fields-grid .triple-wrapper > #shipping_postcode_field {
    grid-column: 1 / -1 !important;
  }
  body.woocommerce-checkout .billing-fields-grid .form-field-custom label,
  body.woocommerce-checkout .shipping-fields-grid .form-field-custom label {
    display: block !important; font-size: 10.5px !important;
    line-height: 1.25 !important; letter-spacing: .015em !important;
    margin: 0 0 4px !important; font-weight: 600 !important;
    text-transform: uppercase !important;
  }
  body.woocommerce-checkout .billing-fields-grid :is(input.input-text, input.f-input, select.f-input, select),
  body.woocommerce-checkout .shipping-fields-grid :is(input.input-text, input.f-input, select.f-input, select),
  body.woocommerce-checkout .woocommerce-form-login :is(input.input-text, input[type="text"], input[type="password"]) {
    box-sizing: border-box !important; width: 100% !important;
    height: 44px !important; min-height: 44px !important; max-height: 44px !important;
    padding: 0 10px !important;
    font-size: 16px !important; line-height: normal !important;
    border-radius: 9px !important; box-shadow: none !important;
    transition: border-color .12s ease !important;
  }
  body.woocommerce-checkout .billing-fields-grid .select2-container .select2-selection--single,
  body.woocommerce-checkout .shipping-fields-grid .select2-container .select2-selection--single {
    height: 44px !important; min-height: 44px !important;
    display: flex !important; align-items: center !important;
    border-radius: 9px !important;
  }
  body.woocommerce-checkout .billing-fields-grid .select2-selection__rendered,
  body.woocommerce-checkout .shipping-fields-grid .select2-selection__rendered {
    line-height: 1.3 !important; padding-left: 10px !important;
    font-size: 16px !important;
  }
  body.woocommerce-checkout .billing-fields-grid .select2-selection__arrow,
  body.woocommerce-checkout .shipping-fields-grid .select2-selection__arrow { height: 44px !important; }
  body.woocommerce-checkout .billing-fields-grid textarea,
  body.woocommerce-checkout .shipping-fields-grid textarea {
    height: 72px !important; min-height: 72px !important;
    padding: 9px 10px !important; font-size: 16px !important;
    line-height: 1.4 !important;
  }
  body.woocommerce-checkout .form-field-custom .optional { font-size: 10px !important; }
  body.woocommerce-checkout .checkout-page-title { margin-bottom: 8px !important; }
  body.woocommerce-checkout .steps-indicator { margin-bottom: 5px !important; padding-bottom: 8px !important; }
  body.woocommerce-checkout .step-label-group { margin-bottom: 9px !important; }
  body.woocommerce-checkout .piyamo-auto-account-note { margin-block: 11px !important; }

  /* Login + registration compact enough for WebView's reduced keyboard viewport. */
  body.woocommerce-account .account-auth-card {
    padding: 15px 14px 17px !important;
    border-radius: 16px !important;
  }
  body.woocommerce-account .account-auth-eyebrow {
    font-size: 10px !important; margin-bottom: 4px !important;
  }
  body.woocommerce-account .account-auth-card h2.account-auth-title {
    font-size: 22px !important; line-height: 1.18 !important;
  }
  body.woocommerce-account .account-auth-card .woocommerce-form-login,
  body.woocommerce-account .account-auth-card .woocommerce-form-register {
    margin-top: 11px !important; padding: 0 !important;
  }
  body.woocommerce-account .account-auth-card .form-row,
  body.woocommerce-account .woocommerce .account-auth-card .woocommerce-form-login .form-row,
  body.woocommerce-account .woocommerce .account-auth-card .woocommerce-form-register .form-row {
    margin: 0 0 9px !important; padding: 0 !important;
  }
  body.woocommerce-account .woocommerce .account-auth-card :is(.woocommerce-form-login, .woocommerce-form-register) .form-row > label:not(.woocommerce-form__label) {
    font-size: 11px !important; line-height: 1.3 !important;
    margin-bottom: 4px !important;
  }
  body.woocommerce-account .woocommerce .account-auth-card :is(.woocommerce-form-login, .woocommerce-form-register) .form-row input.input-text {
    box-sizing: border-box !important;
    height: 44px !important; min-height: 44px !important;
    max-height: 44px !important; width: 100% !important;
    padding: 0 11px !important; line-height: normal !important;
    font-size: 16px !important; border-radius: 10px !important;
    transition: border-color .12s ease !important;
  }
  body.woocommerce-account .account-auth-card .password-input input { padding-right: 45px !important; }
  body.woocommerce-account .account-auth-card .password-input .show-password-input {
    width: 42px !important; height: 42px !important; top: 50% !important;
    right: 2px !important;
  }
  body.woocommerce-account .account-auth-card .woocommerce-form-login__rememberme {
    font-size: 12px !important; margin-bottom: 7px !important;
  }
  body.woocommerce-account .account-auth-card .woocommerce-form-login__submit,
  body.woocommerce-account .account-auth-card .woocommerce-form-register__submit {
    min-height: 44px !important; padding: 9px 14px !important;
    font-size: 14px !important; border-radius: 12px !important;
  }
  body.woocommerce-account .account-auth-card .lost_password {
    margin-top: 7px !important; font-size: 12px !important;
  }

  /* Keyboard present: give real estate to the form instead of decorative
     header chrome. Only active for a focused editor + shrunken visual viewport. */
  body.piyamo-keyboard-open.woocommerce-checkout .piyamo-sticky-header-shell,
  body.piyamo-keyboard-open.woocommerce-account .piyamo-sticky-header-shell {
    transform: translateY(-120%) !important; pointer-events: none !important;
    transition: none !important;
  }
  body.piyamo-keyboard-open.woocommerce-checkout .piyamo-fixed-header-spacer,
  body.piyamo-keyboard-open.woocommerce-account .piyamo-fixed-header-spacer {
    height: 0 !important; min-height: 0 !important; padding: 0 !important;
  }
  body.piyamo-keyboard-open.woocommerce-checkout .piyamo-festival-countdown,
  body.piyamo-keyboard-open.woocommerce-account .piyamo-festival-countdown,
  body.piyamo-keyboard-open.woocommerce-checkout .checkout-page-title,
  body.piyamo-keyboard-open.woocommerce-checkout .steps-indicator,
  body.piyamo-keyboard-open.woocommerce-checkout .step-label-group,
  body.piyamo-keyboard-open.woocommerce-checkout .login-prompt,
  body.piyamo-keyboard-open.woocommerce-checkout .section-title-row,
  body.piyamo-keyboard-open.woocommerce-account .account-auth-eyebrow,
  body.piyamo-keyboard-open.woocommerce-account .account-auth-title {
    display: none !important;
  }
  body.piyamo-keyboard-open.woocommerce-account .account-auth-card,
  body.piyamo-keyboard-open.woocommerce-checkout .checkout-section {
    animation: none !important; box-shadow: none !important;
  }
  body.piyamo-keyboard-open.woocommerce-account .account-auth-card .woocommerce-form-login,
  body.piyamo-keyboard-open.woocommerce-account .account-auth-card .woocommerce-form-register {
    margin-top: 0 !important;
  }
  body.piyamo-keyboard-open.woocommerce-checkout .checkout-section { padding-top: 8px !important; }
  body.piyamo-keyboard-open.woocommerce-account .piyamo-mobile-cart-dock,
  body.piyamo-keyboard-open.woocommerce-checkout .piyamo-mobile-cart-dock { display: none !important; }
  body.piyamo-keyboard-open .piyamo-global-scroll-top,
  body.piyamo-keyboard-open .piyamo-scroll-top { display: none !important; }
}
/* Preserve minimum hit size if a site owner changes typography. */
@media (prefers-reduced-motion: reduce) {
  .product-card { scroll-behavior: auto !important; }
}
