/* ==========================================================================
   Touch targets and phone usability (usability audit 2026-10-13: tap targets, footer, newsletter, iOS zoom)

   Loaded after main.css / main-mobile.css (functions.php co_enqueue_assets, its own filemtime version), so it reaches
   visitors without touching the @import ?v= tokens. Every rule sits in a phone or touch-screen media query: desktop
   with a mouse is unchanged.

   Rule of thumb used here: a link, button or field you tap is at least 44 x 44 px. The extra size comes from padding or
   min-height around the same text and icons, so the design looks the same; where the padding would move things,
   a negative margin of the same size gives it back.
   ========================================================================== */

/* The compact phone header's search button (header.php): hidden unless the header is compact (section 2) */
.header-search-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   1. Phones and any touch screen
   -------------------------------------------------------------------------- */
@media (max-width: 768px), (pointer: coarse) {

    /* Header: menu button 30 -> 44 px. The three bars keep their 30 px width (content-box), the margin gives the
       padding back, so nothing in the header row moves. */
    .hamburger {
        box-sizing: content-box;
        padding: 7px;
        margin: -7px;
    }

    /* Header: account / wishlist / cart icons 24 -> 44 px, centred on the same icons. The gap that separated the
       24 px icons is now inside the 44 px boxes (centres 44 px apart instead of 40). */
    .header-icons {
        gap: 0;
    }
    .header-icon {
        min-width: 44px;
        min-height: 44px;
    }
    .header-icon .cart-count {           /* the badge keeps its place at the icon's top-right corner */
        top: 2px;
        right: 2px;
    }

    /* Phone menu: close button 27x36 -> 44 px, the x stays where it was */
    #mobile-menu-close {
        width: 44px;
        height: 44px;
        top: 10px;
        right: 6px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Footer link lists (Information, Get help): 17-19 px tall text links -> 44 px rows */
    .footer-col li.menu-item {
        margin-bottom: 0;
        line-height: normal;
    }
    .footer-col li.menu-item a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 12px;
    }

    /* Footer contact list (phone, two shop addresses): each row a 44 px target */
    .footer_about ul.elementor-icon-list-items li {
        margin-bottom: 0;
        line-height: normal;
    }
    .footer_about ul.elementor-icon-list-items li a {
        min-height: 44px;
    }
    .footer_about a[href^="tel:"] {
        white-space: nowrap;             /* never "800-730-" / "2087" (audit: phone number broke at 768) */
    }

    /* Footer bottom line: "Age Verification" sits in a sentence; inline-block + padding makes it 44 px tall without
       changing the line (the negative margin gives the padding back) */
    .footer-bottom p a {
        display: inline-block;
        padding: 12px 4px;
        margin: -12px -4px;
    }

    /* Product page: qty - / + 38 -> 44 px wide (simple products; the buttons are already 46 px tall) */
    .qty-btn {
        width: 44px;
    }

    /* Variable product rows: the per-row stepper was 30x34 with a 42 px box; now 44 px buttons and box */
    .co-var-qty .qty-btn {
        width: 44px;
        height: 44px;
    }
    .woocommerce .co-var-qty .quantity input.qty,
    .single-product .co-var-qty .quantity input {
        width: 44px;
        height: 44px;
    }

    /* Block checkout: coupon panel 24, "Log in" 18, check boxes 20 and "+ Add apartment, suite, etc." 18 px -> 44 px
       (the check box stays at the top of a long label; the label row gets the height) */
    .checkout_section .wc-block-components-panel__button {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .checkout_section .wc-block-components-address-form__address_2-toggle {
        display: inline-block;
        padding: 13px 0;
        margin: -13px 0;
    }
    .checkout_section .wc-block-checkout__login-prompt {
        display: inline-block;
        padding: 13px 4px;
        margin: -13px -4px;
    }
    .checkout_section .wc-block-components-checkbox label {
        min-height: 44px;
    }

    /* Listings: Filters button 41 px and sort drop-down 40 px -> 44 px */
    .sidebar-toggle,
    .woocommerce-ordering select.orderby {
        min-height: 44px;
    }

    /* Product gallery zoom button 36 -> 44 px (css/product-gallery.css) */
    #scZoomBtn {
        width: 44px;
        height: 44px;
    }

    /* Breadcrumbs and the product's brand / category lines: 20 px links -> 44 px hit area, lines unchanged */
    .woocommerce-breadcrumb a,
    .site-breadcrumb a,
    .single-product .product_meta a {
        display: inline-block;
        padding: 11px 0;
        margin: -11px 0;
    }

    /* Price filter: 24 px handles get an invisible 44 px hit area (the dot itself stays 24 px) */
    .shop-sidebar .price_slider .ui-slider-handle::after {
        content: '';
        position: absolute;
        inset: -12px;
        border-radius: 50%;
    }

    /* My Account login: Remember me (13 px box) and the show-password eye (22 px) */
    .woocommerce-form-login__rememberme {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        margin: 0 0 4px;
    }
    .woocommerce-form-login__rememberme input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin: 0;
    }
    .woocommerce form .show-password-input,
    .woocommerce-page form .show-password-input {
        width: 44px;
        height: 44px;
        right: 3px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .woocommerce form .password-input input[type="password"],
    .woocommerce form .password-input input[type="text"] {
        padding-right: 48px;
    }
    .woocommerce .lost_password a {
        display: inline-block;
        padding: 13px 0;
        margin: -13px 0;
    }

    /* Cart (block cart): qty - / + 30 -> 44 px, remove 24 -> 44 px and 16 px away from + (it was 12 px from a 30 px +) */
    .cart_page_sec .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity {
        gap: 16px;
        padding-right: 0;
        align-items: center;
    }
    .cart_page_sec .wc-block-cart-item__quantity .wc-block-components-quantity-selector {
        width: auto;                    /* WooCommerce fixes it at 107 px, which squeezed the bigger buttons */
    }
    .cart_page_sec .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
        min-width: 44px;
        min-height: 44px;
    }
    .cart_page_sec .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input {
        min-height: 44px;
        width: 36px;
        min-width: 36px;
    }
    .cart_page_sec table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
    .cart_page_sec .wc-block-components-panel__button {       /* "Add Gift Card / Coupon" 22-24 px -> 44 px */
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* --------------------------------------------------------------------------
   2. Phones only (the phone layout)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {

    /* iOS Safari zooms into any field under 16 px and stays zoomed (search 14 px, product qty 14 px, cart qty 13 px,
       contact form, checkout address 2, gift-card box). 16 px on phones (no field on the phone pages is bigger). */
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="image"]):not([type="file"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Footer contact block: phone and both addresses in one clean column. The list is centred as a block, the rows
       inside are left-aligned: a fixed 24 px icon column, both icons the same size, the text starts at the same x on
       every row and a wrapped address line lines up under its first line. */
    .footer_about ul.elementor-icon-list-items {
        display: flex;
        flex-direction: column;
        width: fit-content;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        text-align: left;
    }
    .footer_about ul.elementor-icon-list-items li a {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr);
        column-gap: 12px;
        align-items: center;
        padding: 0 4px;
        font-size: 16px;
    }
    .footer_about ul.elementor-icon-list-items .elementor-icon-list-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
    }
    .footer_about ul.elementor-icon-list-items li a svg,
    .footer_about ul.elementor-icon-list-items li:first-child a svg {
        width: 20px;
        height: 20px;
        margin: 0;
    }

    /* Footer link lists: the 44 px rows replace the old line-height spacing; keep the columns close together */
    .footer-col ul.menu {
        margin-bottom: 8px;
    }

    /* Compact header when scrolled (mega-menu.js initScrollEffect; it gives the lost height back as margin, so the page
       does not move): 142 px -> 81 px. Only the search row folds away and a search button (with the icons) opens it
       again; the logo row keeps its size and place, so nothing in it moves (no layout shift). */
    #site-header.is-compact .search_col {
        display: none;
    }
    #site-header.is-compact .header-search-toggle {
        display: flex;
    }

    /* The menu button sits at the right of the icon row (main.css, another developer's live edit of 2026-11-12:
       position absolute, bottom 83px, and bottom 20px once .scrolled). The compact header is not the same as .scrolled:
       after Cancel in the compact header's search, or while the search field has focus, the header is scrolled but
       full, and bottom 20px put the button on the search row, behind the search button. So 83px holds until the header
       is really compact. This also keeps the button above the search row when mega-menu.js measures the height the
       header is about to lose (searchRowHeight() compares the search row with this button: 61 px, no correction). */
    #site-header.sticky.scrolled:not(.is-compact) .hamburger.for_mobile {
        bottom: 83px;
    }

    /* The account / wishlist / cart icons always get a row of their own, centred, as on phones up to about 680 px.
       Above that they fitted next to the logos, where bottom 83px put the menu button over the cart icon and the
       compact header lost only 2 px (the icons wrapped when the search button joined them). */
    #site-header .header-row > .header-icons.for_mobile {
        flex-basis: 100%;
        justify-content: center;
    }

    /* The home category pills are position:sticky (front-page.php). #homepage-main hid its overflow (no sideways scroll on
       phones), which makes it a scroll box and stops a sticky child; clip does the same clipping without that. flow-root
       keeps the block formatting context overflow:hidden gave. Browsers without clip keep hidden (the bar then scrolls). */
    #homepage-main {
        display: flow-root;
        overflow: clip;
    }

    /* Home category pills: 33 -> 44 px tall, and the bar 88 -> 60 px (the 9th pill's 25 px bottom padding is for the
       desktop column list and made every pill row 58 px tall on phones) */
    #hero-tab-list {
        align-items: center;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    #hero-tab-list li:nth-child(9) {
        padding-bottom: 0;
    }
    .hp-hero-tabs li button.hp-tab-btn {
        min-height: 44px;
    }

    /* Home newsletter (Brevo form): email box 38 px and Subscribe 40 px, 1 px apart in height and position -> both
       48 px, same top, so the pill reads as one control */
    .hp-newsletter .sib-form .input {
        height: 48px;
        min-height: 48px;
    }
    .hp-newsletter .sib-form-block__button {
        top: 12px;                      /* the email box's top inside #sib-container (8 px block padding + 4 px) */
        height: 48px;
        min-height: 48px;
        align-items: center;
    }
}

/* Phones under 360 px (iPhone SE 1st gen, 320 px): the compact header's four icons keep their 44 px width and sit
   4 px apart, which leaves 9 px before the menu button at the right of their row (with the 20 px gap from main.css
   and 36 px icons, the cart icon ended 1 px from it) */
@media (max-width: 359px) {
    #site-header.is-compact .header-icons.for_mobile {
        gap: 4px !important;
    }
}

/* --------------------------------------------------------------------------
   3. Phone menu (drawer, below 1024 px) on touch screens: sub-menu links 30 -> 44 px rows
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) and (pointer: coarse), (max-width: 768px) {
    #primary-nav .mega-col a,
    #primary-nav .mega-menu-bottom a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* --------------------------------------------------------------------------
   4. Phone header: the three logos always fit the screen (Andrus 2026-11-12: "fix third logo")

   Fox Cigar, Fox Cigar Bar and Cigar Outlet were three fixed 120 px logos with 15 px between them: 390 px plus the
   row's padding, so on every phone narrower than about 430 px the third one was cut off and the page was wider than
   the screen (408 px on a 390 px phone, sideways scroll). Up to 430 px the logo row now takes the full width and each
   logo may shrink below 120 px. Wider screens had room already and are not touched.
   -------------------------------------------------------------------------- */
@media (max-width: 430px) {
    #site-header .logo_col {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }
    #site-header .logo_col .site-logo {
        flex: 0 1 120px;
        min-width: 0;
    }
    #site-header .logo_col .site-logo img {
        display: block;
        width: 100%;
        max-width: 120px;
        height: auto;
    }
}
