/* GalloShop Core 17.0.0 — premium mobile experience. Desktop is untouched. */
@media (min-width: 821px) {
    .gshop-category-links a > i, .single-product .gshop-trust-mobile-extra { display: none; }
}

@media (max-width: 820px) {
    :root { --gshop-mobile-gutter: 12px; --gshop-mobile-radius: 12px; }
    html { overflow-x: hidden; }
    body { overflow-wrap: anywhere; }
    img { max-width: 100%; }

    /* Header and permanent cart */
    .gshop-header-row { gap: 7px !important; padding: 7px var(--gshop-mobile-gutter) 0 !important; }
    .gshop-brand-zone { grid-template-columns: minmax(0,1fr) 38px minmax(82px,auto) !important; }
    .gshop-mobile-header-cart {
        min-width: 82px !important; min-height: 42px !important; grid-template-columns: 34px minmax(0,1fr) !important;
        padding: 4px 7px !important; border-color: #f0b5b5 !important; background: linear-gradient(180deg,#fff,#fff8f8) !important;
        box-shadow: 0 4px 13px rgba(170,0,0,.12) !important; transition: transform .18s ease, box-shadow .18s ease !important;
    }
    .gshop-mobile-header-cart:active { transform: scale(.97); }
    .gshop-mobile-header-cart__icon { width: 32px !important; height: 32px !important; font-size: 23px !important; }
    .gshop-mobile-header-cart__count { top: -5px !important; right: -5px !important; min-width: 18px !important; height: 18px !important; }
    .gshop-mobile-header-cart__subtotal { max-width: 72px !important; color: #b50000 !important; font-size: 10.5px !important; font-weight: 900 !important; }
    .gshop-search { height: 42px !important; margin-bottom: 7px !important; }
    .gshop-search input[type=search], .gshop-search button { height: 40px !important; min-height: 40px !important; }

    /* Menu drawer */
    .gshop-mobile-menu-overlay { background: rgba(8,12,18,.58) !important; backdrop-filter: blur(2px); transition: opacity .26s ease !important; }
    .gshop-header .gshop-category-nav {
        width: min(88vw, 360px) !important; box-shadow: 18px 0 55px rgba(0,0,0,.24) !important;
        transition: transform .3s cubic-bezier(.22,.8,.22,1), visibility 0s linear .3s !important;
    }
    .gshop-header.is-menu-open .gshop-category-nav { transition-delay: 0s !important; }
    .gshop-mobile-drawer-heading { padding: 14px 14px 11px !important; }
    .gshop-mobile-drawer-search {
        display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 4px;
        margin: 3px 12px 10px; padding: 3px; border: 1px solid #dfe3e8; border-radius: 10px; background: #f7f8fa;
    }
    .gshop-mobile-drawer-search > span { text-align: center; color: #6b7280; font-size: 18px; }
    .gshop-mobile-drawer-search input { min-width: 0; height: 36px; padding: 0 4px; border: 0; outline: 0; background: transparent; font-size: 12px; }
    .gshop-mobile-drawer-search button { height: 34px; padding: 0 11px; border: 0; border-radius: 8px; background: #d70000; color: #fff; font-size: 10px; font-weight: 850; }
    .gshop-header .gshop-category-nav .gshop-category-links { padding: 0 12px 18px !important; }
    .gshop-header .gshop-category-nav .gshop-category-links a { min-height: 47px !important; padding: 6px 5px !important; gap: 11px; font-size: 13px !important; }
    .gshop-category-links a > i { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 8px; background: #f3f4f6; color: #c60000; font-style: normal; font-weight: 900; }
    .gshop-category-links a > span { min-width: 0; }
    .gshop-category-links .gshop-category-promo > i { background: #fff0f0; }

    /* Home rhythm */
    .gshop-home .gshop-section, .gshop-home .gshop-hero, .gshop-home .gshop-categories,
    .gshop-home .gshop-home-shelf, .gshop-home .gshop-benefits-conversion, .gshop-home .gshop-counter-grid {
        width: calc(100% - (2 * var(--gshop-mobile-gutter))) !important; max-width: none !important; margin-right: auto !important; margin-left: auto !important;
    }
    .gshop-home section { scroll-margin-top: 110px; }
    .gshop-home .gshop-section-heading, .gshop-home .gshop-shelf-topbar { margin-bottom: 9px !important; }
    .gshop-home .gshop-product-grid, .gshop-home .gshop-shelf-grid { align-items: stretch; gap: 9px !important; }

    /* Equal product cards */
    .gshop-product-grid > .gshop-product-card, .gshop-shelf-grid > .gshop-product-card {
        display: grid !important; grid-template-rows: auto minmax(0,1fr) auto; min-width: 0; height: 100%; overflow: hidden;
        border-radius: var(--gshop-mobile-radius) !important; box-shadow: 0 5px 16px rgba(17,24,39,.075) !important;
    }
    .gshop-product-card .gshop-product-image { display: grid !important; place-items: center; width: 100%; height: 142px !important; padding: 8px !important; background: #fff; }
    .gshop-product-card .gshop-product-image img { width: 100% !important; height: 100% !important; object-fit: contain !important; }
    .gshop-product-card .gshop-product-body { display: flex !important; min-width: 0; flex-direction: column; padding: 9px 9px 5px !important; }
    .gshop-product-card h3 { min-height: 34px; margin: 0 0 4px !important; overflow: hidden; }
    .gshop-product-card h3 a { display: -webkit-box; overflow: hidden; font-size: 11px !important; line-height: 1.35 !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .gshop-product-rating { min-height: 17px; }
    .gshop-product-price-row { min-height: 33px; align-items: center; margin-top: 3px; }
    .gshop-product-price { font-size: clamp(16px,5vw,20px) !important; line-height: 1.05 !important; }
    .gshop-product-pix-row { min-height: 30px; margin-top: 3px; }
    .gshop-product-installments { min-height: 16px; }
    .gshop-product-trust { min-height: 22px; margin-top: auto !important; }
    .gshop-product-actions { padding: 7px 9px 9px !important; }
    .gshop-product-actions .gshop-button { width: 100%; min-height: 38px !important; border-radius: 8px !important; font-size: 10px !important; transition: transform .16s ease, filter .16s ease, box-shadow .16s ease !important; }
    .gshop-product-actions .gshop-button:active { transform: scale(.98); filter: brightness(.94); }

    /* Product conversion */
    .single-product .gshop-stock-status { display: inline-flex !important; width: fit-content; padding: 5px 9px; border-radius: 999px; background: #eaf8ef; font-size: 10px !important; }
    .single-product .summary .gshop-buy-now { background: linear-gradient(180deg,#ed0808,#c90000) !important; color: #fff !important; box-shadow: 0 8px 20px rgba(215,0,0,.25) !important; }
    .single-product .summary .gshop-buy-now:active { transform: scale(.985) !important; }
    .single-product .gshop-trust-cards { grid-template-columns: repeat(4,minmax(0,1fr)) !important; gap: 5px !important; }
    .single-product .gshop-trust-marketplace { display: none !important; }
    .single-product .gshop-trust-cards article { min-width: 0; min-height: 54px !important; padding: 7px 3px !important; }
    .single-product .gshop-trust-cards article b { font-size: 9px !important; }
    .single-product .gshop-trust-cards article strong { font-size: 7.5px !important; line-height: 1.1; text-align: center; }
    .single-product .gshop-trust-cards article small { display: none; }

    /* Short premium drawer */
    .gshop-cart-drawer { width: min(92vw,380px) !important; }
    .gshop-cart-drawer > header { padding: 14px 15px 11px !important; }
    .gshop-cart-drawer > header h2 { margin-top: 3px !important; font-size: 21px !important; }
    .gshop-cart-drawer > header > button { width: 36px !important; height: 36px !important; font-size: 23px !important; }
    .gshop-cart-drawer-body { padding: 12px 14px 16px !important; }
    .gshop-cart-success { margin-bottom: 7px !important; padding: 7px 9px !important; }
    .gshop-cart-progress { margin-bottom: 10px !important; }
    .gshop-cart-items { gap: 8px !important; }
    .gshop-cart-items li { grid-template-columns: 58px minmax(0,1fr) 34px !important; min-width: 0; gap: 8px !important; padding-bottom: 8px !important; }
    .gshop-cart-item-image, .gshop-cart-items img { width: 58px !important; height: 58px !important; }
    .gshop-cart-item-content > strong { display: -webkit-box; overflow: hidden; font-size: 11px !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .gshop-cart-item-content > small { display: none; }
    .gshop-cart-qty { margin-top: 4px !important; }
    .gshop-cart-subtotal { margin: 10px 0 !important; font-size: 15px !important; }
    .gshop-cart-drawer-actions { gap: 6px !important; }
    .gshop-cart-drawer-actions > * { min-height: 42px !important; font-size: 9px !important; }

    /* Cart cards */
    body.woocommerce-cart .gshop-commerce-shell { width: calc(100% - 18px) !important; }
    body.woocommerce-cart table.shop_table.cart tr.cart_item {
        position: relative !important;
        display: grid !important;
        grid-template-columns: clamp(80px,25vw,88px) minmax(0,1fr) !important;
        grid-template-areas: 'image name' 'image quantity' 'image price' 'image subtotal' !important;
        align-items: start !important;
        gap: 5px 10px !important;
        min-width: 0 !important;
        padding: 10px 38px 10px 10px !important;
        border-radius: 11px !important;
        overflow: hidden;
    }
    body.woocommerce-cart table.shop_table.cart tr.cart_item > td { min-width: 0 !important; max-width: 100%; }
    body.woocommerce-cart td.product-thumbnail { grid-area: image !important; align-self: start; }
    body.woocommerce-cart td.product-thumbnail a { display: grid !important; place-items: center; width: 100%; }
    body.woocommerce-cart td.product-thumbnail img {
        display: block; width: clamp(80px,25vw,88px) !important; height: clamp(80px,25vw,88px) !important;
        max-width: 100% !important; object-fit: contain !important;
    }
    body.woocommerce-cart td.product-name { grid-area: name !important; padding-right: 0 !important; }
    body.woocommerce-cart td.product-name a {
        display: -webkit-box !important; min-width: 0; max-height: 2.7em; overflow: hidden;
        line-height: 1.35 !important; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    }
    body.woocommerce-cart td.product-quantity {
        grid-area: quantity !important; align-self: center !important; justify-self: center !important;
        width: max-content !important; max-width: 100%; margin: 1px 0 !important;
    }
    body.woocommerce-cart td.product-price {
        grid-area: price !important; min-width: 0; white-space: nowrap !important;
        font-size: clamp(10px,3.2vw,12px) !important; line-height: 1.2 !important;
    }
    body.woocommerce-cart td.product-price .amount,
    body.woocommerce-cart td.product-price bdi,
    body.woocommerce-cart td.product-subtotal .amount,
    body.woocommerce-cart td.product-subtotal bdi { white-space: nowrap !important; }
    body.woocommerce-cart td.product-subtotal {
        grid-area: subtotal !important; align-self: end !important; justify-self: end !important;
        max-width: 100%; white-space: nowrap !important; font-size: clamp(10px,3.2vw,12px) !important;
    }
    body.woocommerce-cart td.product-remove {
        position: absolute !important; z-index: 2; top: 7px; right: 7px; display: block !important;
        width: 27px !important; height: 27px !important; margin: 0 !important;
    }
    body.woocommerce-cart td.product-remove a { display: grid !important; place-items: center; width: 27px !important; height: 27px !important; }
    body.woocommerce-cart .quantity.gshop-cart-qty-ready {
        display: inline-grid !important; grid-template-columns: 30px minmax(32px,38px) 30px !important;
        width: auto !important; max-width: 100%; margin: 0 auto !important;
    }
    body.woocommerce-cart .cart_totals { border: 1px solid #e0e4e9 !important; }

    /* Checkout: compact, ordered and aligned */
    body.woocommerce-checkout .gshop-checkout-premium-content { font-size: 12px; }
    body.woocommerce-checkout form.checkout, body.woocommerce-checkout form.woocommerce-checkout { gap: 6px !important; }
    body.woocommerce-checkout form.checkout > .col2-set, body.woocommerce-checkout form.woocommerce-checkout > .col2-set { padding: 9px !important; }
    body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper { gap: 5px 6px !important; }
    body.woocommerce-checkout .gshop-checkout-premium-content .input-text,
    body.woocommerce-checkout .gshop-checkout-premium-content select,
    body.woocommerce-checkout .gshop-checkout-premium-content .select2-selection { min-height: 37px !important; height: 37px !important; }
    body.woocommerce-checkout #order_review { padding: 7px !important; }
    body.woocommerce-checkout #payment { padding: 4px !important; }
    body.woocommerce-checkout #payment .wc_payment_method { margin-bottom: 5px !important; }
    body.woocommerce-checkout #payment .wc_payment_method > input[type=radio],
    body.woocommerce-checkout #payment .wc_payment_method > input.input-radio { top: 23px !important; left: 12px !important; width: 18px !important; height: 18px !important; margin: 0 !important; transform: translateY(-50%); }
    body.woocommerce-checkout #payment .wc_payment_method > label { box-sizing: border-box; width: 100% !important; min-height: 46px !important; padding: 6px 8px 6px 50px !important; }
    body.woocommerce-checkout .gshop-mobile-order-preview { width: 100%; margin: 6px 0 0 !important; box-sizing: border-box; }
    body.woocommerce-checkout .gshop-checkout-trust.is-footer-trust { min-height: 24px !important; margin-top: 6px !important; }

    /* Floating actions and chats never overlap */
    body.gshop-has-fixed-action .joinchat, body.gshop-has-fixed-action .ht-ctc-chat,
    body.gshop-has-fixed-action #qlwapp, body.gshop-has-fixed-action .wpp-float { bottom: calc(84px + env(safe-area-inset-bottom)) !important; }

    button, a, input, select { max-width: 100%; }
    .gshop-button, button { -webkit-tap-highlight-color: transparent; }
}

@media (max-width: 360px) {
    :root { --gshop-mobile-gutter: 9px; }
    .gshop-brand > span { font-size: 17px !important; }
    .gshop-brand-zone { grid-template-columns: minmax(0,1fr) 36px minmax(76px,auto) !important; gap: 5px !important; }
    .gshop-mobile-header-cart { min-width: 76px !important; padding-inline: 5px !important; }
    .gshop-product-card .gshop-product-image { height: 126px !important; }
    .gshop-product-card .gshop-product-body { padding-inline: 7px !important; }
    .gshop-product-actions { padding-inline: 7px !important; }
    body.woocommerce-cart table.shop_table.cart tr.cart_item {
        grid-template-columns: minmax(76px,82px) minmax(0,1fr) !important;
        gap: 4px 8px !important; padding: 9px 35px 9px 8px !important;
    }
    body.woocommerce-cart td.product-thumbnail img { width: min(82px,100%) !important; height: 82px !important; }
}

@media (min-width: 481px) and (max-width: 820px) {
    .gshop-home .gshop-product-grid, .gshop-home .gshop-shelf-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
    .gshop-product-card .gshop-product-image { height: 150px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .gshop-mobile-header-cart, .gshop-category-nav, .gshop-product-card, .gshop-button, button { animation: none !important; transition: none !important; }
}
