/* GalloShop Core 18.0.0 — mobile UX audit and visual polish only. */
@media (max-width: 820px) {
    html, body { width: 100%; max-width: 100%; overflow-x: hidden !important; overflow-x: clip !important; }
    body *, body *::before, body *::after { box-sizing: border-box; }
    .gshop-storefront, .gshop-commerce-page, .gshop-commerce-shell, .gshop-commerce-content,
    main, section, article, form, fieldset, table, tbody, tr, td, th { min-width: 0; max-width: 100%; }
    img, video, iframe, svg { max-width: 100%; height: auto; }

    /* Consistent interactive targets */
    .gshop-storefront .gshop-button, .gshop-commerce-content .button,
    .gshop-commerce-content button:not(.gshop-cart-remove), .woocommerce a.button,
    .woocommerce button.button, .woocommerce input.button {
        min-height: 42px; padding: 9px 13px !important; border-radius: 9px !important;
        font-size: 11px !important; font-weight: 850 !important; line-height: 1.2 !important;
        white-space: normal; text-align: center; transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
    }
    .gshop-storefront .gshop-button:active, .gshop-commerce-content .button:active,
    .gshop-commerce-content button:active { transform: scale(.985); }

    /* Header and search */
    .gshop-header, .gshop-header-row, .gshop-brand-zone { max-width: 100% !important; }
    .gshop-brand { min-width: 0; overflow: hidden; }
    .gshop-brand > span { min-width: 0; white-space: nowrap; }
    .gshop-mobile-header-cart { overflow: visible !important; }
    .gshop-search { width: 100% !important; min-width: 0; }
    .gshop-search input[type=search] { min-width: 0 !important; font-size: 12px !important; }
    .gshop-search button { flex: 0 0 auto; min-width: 72px !important; padding-inline: 10px !important; }
    .gshop-search-results { right: 0 !important; left: 0 !important; width: 100% !important; max-height: min(58vh,420px); overflow-y: auto; }

    /* Menu, hierarchy and submenus */
    .gshop-header .gshop-category-nav { max-width: calc(100vw - 34px) !important; overflow-x: hidden !important; }
    .gshop-category-nav .gshop-container, .gshop-category-links, .gshop-category-links a { min-width: 0 !important; max-width: 100% !important; }
    .gshop-category-links a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .gshop-category-links .sub-menu, .gshop-category-links ul { width: 100%; margin: 0; padding: 0 0 0 22px; list-style: none; }
    .gshop-category-links .sub-menu a { min-height: 40px !important; font-size: 11px !important; }

    /* Product grids: Home, category and search */
    .gshop-product-grid, .gshop-shelf-grid { width: 100%; min-width: 0; }
    .gshop-product-card { width: 100%; min-width: 0; }
    .gshop-product-card h3, .gshop-product-card h3 a { overflow-wrap: normal !important; word-break: normal !important; }
    .gshop-product-card .gshop-product-price,
    .gshop-product-card .gshop-product-price .amount,
    .gshop-product-card .gshop-product-price bdi,
    .gshop-product-card .gshop-product-pix { white-space: nowrap !important; }
    .gshop-product-card .gshop-product-price-row { min-width: 0; gap: 4px; }
    .gshop-product-card .gshop-product-discount { flex: 0 0 auto; }
    .gshop-product-card .gshop-product-pix-row { overflow: hidden; }
    .gshop-product-card .gshop-product-pix-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .gshop-category-products, .gshop-search-products, .gshop-category-main { width: calc(100% - 20px) !important; margin-inline: auto !important; }

    /* Product page */
    .single-product .gshop-single-product-layout, .single-product .gshop-single-product-info,
    .single-product .gshop-product-gallery, .single-product form.cart { min-width: 0 !important; max-width: 100% !important; }
    .single-product .product_title { overflow-wrap: normal; word-break: normal; }
    .single-product .price, .single-product .price .amount, .single-product .price bdi,
    .single-product .gshop-commercial-price, .single-product .gshop-commercial-price .amount { white-space: nowrap !important; }
    .single-product .gshop-product-gallery img { max-width: 100%; object-fit: contain; }
    .single-product .gshop-product-commercial-meta p { line-height: 1.45; }

    /* Cart: prevent all known collisions */
    body.woocommerce-cart .gshop-commerce-content { overflow: visible; }
    body.woocommerce-cart table.shop_table.cart tr.cart_item { width: 100% !important; max-width: 100%; }
    body.woocommerce-cart td.product-price, body.woocommerce-cart td.product-subtotal,
    body.woocommerce-cart td.product-price *, body.woocommerce-cart td.product-subtotal * { white-space: nowrap !important; word-break: keep-all !important; }
    body.woocommerce-cart td.product-name a { max-width: 100%; }
    body.woocommerce-cart .actions, body.woocommerce-cart .coupon { min-width: 0; max-width: 100%; }
    body.woocommerce-cart .coupon #coupon_code { min-width: 0 !important; }
    body.woocommerce-cart .cart_totals table { table-layout: fixed; }
    body.woocommerce-cart .cart_totals th, body.woocommerce-cart .cart_totals td { width: 50%; overflow-wrap: anywhere; }
    body.woocommerce-cart .cart_totals td, body.woocommerce-cart .cart_totals td * { text-align: right; }

    /* Checkout fields and gateways */
    body.woocommerce-checkout .gshop-commerce-shell, body.woocommerce-checkout .gshop-commerce-content,
    body.woocommerce-checkout form.checkout, body.woocommerce-checkout #customer_details,
    body.woocommerce-checkout #order_review, body.woocommerce-checkout #payment { min-width: 0 !important; max-width: 100% !important; }
    body.woocommerce-checkout .form-row, body.woocommerce-checkout .woocommerce-input-wrapper,
    body.woocommerce-checkout .select2-container { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
    body.woocommerce-checkout input.input-text, body.woocommerce-checkout textarea,
    body.woocommerce-checkout select, body.woocommerce-checkout .select2-selection { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
    body.woocommerce-checkout #billing_postcode_field { min-width: 0 !important; }
    body.woocommerce-checkout #payment .wc_payment_method { position: relative !important; width: 100%; min-width: 0; }
    body.woocommerce-checkout #payment .wc_payment_method > input[type=radio],
    body.woocommerce-checkout #payment .wc_payment_method > input.input-radio {
        position: absolute !important; z-index: 3; 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 {
        display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 7px;
        width: 100% !important; min-width: 0; min-height: 46px !important; margin: 0 !important; padding: 6px 8px 6px 50px !important;
    }
    body.woocommerce-checkout #payment .wc_payment_method > label .gshop-payment-copy { flex: 1 1 auto; min-width: 0; }
    body.woocommerce-checkout #payment .wc_payment_method > label img { flex: 0 1 auto; max-width: 88px !important; max-height: 24px !important; object-fit: contain; }
    body.woocommerce-checkout #payment .payment_box, body.woocommerce-checkout #payment .payment_box fieldset,
    body.woocommerce-checkout #payment .payment_box .form-row { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
    body.woocommerce-checkout .woocommerce-checkout-review-order-table { table-layout: fixed; }
    body.woocommerce-checkout .woocommerce-checkout-review-order-table td:last-child,
    body.woocommerce-checkout .woocommerce-checkout-review-order-table td:last-child * { white-space: nowrap; text-align: right; }

    /* WooCommerce notices */
    .woocommerce-notices-wrapper { width: 100%; max-width: 100%; margin: 0 0 8px !important; }
    .woocommerce-message, .woocommerce-error, .woocommerce-info,
    .woocommerce-notice, .wc-block-components-notice-banner {
        width: 100% !important; min-height: 0 !important; margin: 0 0 8px !important; padding: 10px 11px !important;
        border-width: 0 0 0 3px !important; border-radius: 8px !important; font-size: 11px !important; line-height: 1.4 !important;
        overflow-wrap: anywhere;
    }
    .woocommerce-error { padding-left: 27px !important; }
    .woocommerce-error li + li { margin-top: 5px; }
    .woocommerce-message .button, .woocommerce-info .button { min-height: 30px !important; margin: -3px 0 -3px 8px !important; padding: 5px 8px !important; }

    /* Account, login, registration and password recovery */
    body.woocommerce-account .gshop-commerce-shell { width: calc(100% - 18px) !important; padding: 10px 0 26px !important; }
    body.woocommerce-account .gshop-commerce-content { padding: 11px !important; border-radius: 12px !important; }
    body.woocommerce-account .woocommerce { width: 100%; min-width: 0; }
    body.woocommerce-account .woocommerce-MyAccount-navigation,
    body.woocommerce-account .woocommerce-MyAccount-content { width: 100% !important; float: none !important; margin: 0 !important; }
    body.woocommerce-account .woocommerce-MyAccount-navigation ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin: 0 0 10px; padding: 0; list-style: none; }
    body.woocommerce-account .woocommerce-MyAccount-navigation a { display: flex; min-height: 38px; align-items: center; padding: 7px 8px; border: 1px solid #e0e4e9; border-radius: 8px; color: #25282c; font-size: 10px; text-decoration: none; }
    body.woocommerce-account .woocommerce-MyAccount-navigation .is-active a { border-color: #d70000; color: #b60000; background: #fff6f6; font-weight: 850; }
    body.woocommerce-account form.login, body.woocommerce-account form.register,
    body.woocommerce-account form.lost_reset_password, body.woocommerce-account .woocommerce-form-login,
    body.woocommerce-account .woocommerce-form-register { width: 100% !important; margin: 0 !important; padding: 12px !important; border-radius: 10px !important; }
    body.woocommerce-account .u-columns { display: grid !important; grid-template-columns: 1fr !important; gap: 12px; }
    body.woocommerce-account .u-column1, body.woocommerce-account .u-column2 { width: 100% !important; float: none !important; }
    body.woocommerce-account input, body.woocommerce-account select, body.woocommerce-account textarea { width: 100%; min-height: 42px; }
    body.woocommerce-account table.shop_table { display: block; width: 100%; overflow: hidden; }
    body.woocommerce-account table.shop_table thead { display: none; }
    body.woocommerce-account table.shop_table tbody { display: block; }
    body.woocommerce-account table.shop_table tr { display: grid; gap: 4px; margin-bottom: 8px; padding: 9px; border: 1px solid #e3e6ea; border-radius: 9px; }
    body.woocommerce-account table.shop_table td { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0 !important; border: 0 !important; font-size: 10px; text-align: right; }
    body.woocommerce-account table.shop_table td::before { flex: 0 0 auto; font-weight: 800; text-align: left; }

    /* Order received */
    body.woocommerce-order-received .woocommerce-order-overview { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 10px 0 !important; padding: 10px !important; }
    body.woocommerce-order-received .woocommerce-order-overview li { width: 100%; margin: 0 !important; padding: 7px 0 !important; border: 0 !important; border-bottom: 1px solid #eceef1 !important; }
    body.woocommerce-order-received .woocommerce-order-details table { table-layout: fixed; }
    body.woocommerce-order-received .woocommerce-order-details td, body.woocommerce-order-received .woocommerce-order-details th { overflow-wrap: anywhere; }
    body.woocommerce-order-received .woocommerce-order-details td:last-child,
    body.woocommerce-order-received .woocommerce-order-details td:last-child * { white-space: nowrap; text-align: right; }

    /* Drawers, modal and pop-up safety */
    .gshop-cart-drawer, .gshop-category-nav, .gshop-product-gallery-modal,
    [role=dialog], .modal, .popup { max-width: 100vw !important; }
    .gshop-product-gallery-modal { padding: 52px 10px 14px !important; overflow: hidden auto !important; }
    .gshop-product-gallery-modal img { width: auto !important; max-width: 100% !important; max-height: calc(100dvh - 90px) !important; object-fit: contain; }
    .gshop-cart-drawer-body, .gshop-category-nav .gshop-container { overscroll-behavior: contain; }

    /* Footer */
    .gshop-footer, .gshop-footer-inner, .gshop-footer-bottom { max-width: 100% !important; }
    .gshop-footer-inner { padding: 30px 18px 24px !important; }
    .gshop-footer-categories, .gshop-footer-contact, .gshop-footer-security,
    .gshop-footer-information, .gshop-footer-socials { margin-top: 22px !important; padding-top: 22px !important; }
    .gshop-footer a, .gshop-footer p, .gshop-footer li { overflow-wrap: anywhere; }
    .gshop-footer-bottom { width: calc(100% - 36px) !important; padding: 18px 0 24px !important; }
}

@media (max-width: 360px) {
    .gshop-brand > b { width: 38px !important; height: 38px !important; }
    .gshop-brand > span { font-size: 16px !important; }
    .gshop-mobile-header-cart__subtotal { max-width: 58px !important; font-size: 9px !important; }
    .gshop-search input[type=search] { font-size: 11px !important; }
    .gshop-product-card .gshop-product-price { font-size: 16px !important; }
    body.woocommerce-checkout #payment .wc_payment_method > label img { max-width: 68px !important; }
    body.woocommerce-account .woocommerce-MyAccount-navigation ul { grid-template-columns: 1fr; }
}

@media (min-width: 361px) and (max-width: 430px) {
    .gshop-mobile-header-cart__subtotal { max-width: 68px !important; }
    body.woocommerce-checkout #payment .wc_payment_method > label img { max-width: 78px !important; }
}

@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
