/* Colony phones & small tablets: photos first, minimal text. Loaded last. */

/* ---- one product grid everywhere (shop, categories, landing pages, related products) ---- */
#content ul.products { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0 0 1.5em !important; padding: 0 !important; }
#content ul.products::before, #content ul.products::after { display: none !important; }
#content ul.products li.product { width: auto !important; max-width: none !important; margin: 0 !important; float: none !important; clear: none !important; padding: 0 !important; }
@media (min-width: 768px)  { #content ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { #content ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#content .woocommerce[class*="columns-"] ul.products li.product:nth-child(n) { margin-right: 0 !important; }

@media (max-width: 767px) {
    :root { --shop-pad: 6px; }

    /* announcement + header: slimmer */
    .uh-announce { padding: 7px 10px; font-size: 10px; letter-spacing: .07em; }
    #masthead { border-bottom-color: #eee; }
    #ast-mobile-header .site-primary-header-wrap { min-height: 54px; }
    #ast-mobile-header .custom-logo { width: 104px !important; height: auto !important; }

    /* page title + filters: compact */
    body .ast-archive-description .ast-archive-title, body .ast-archive-description .page-title { padding: 14px 0 12px !important; font-size: 26px !important; }
    .shop-filterbar { margin: 0 -2px 8px; }
    .sf-left { flex-wrap: nowrap; overflow-x: auto; gap: 18px; scrollbar-width: none; padding: 0 8px; }
    .sf-left::-webkit-scrollbar { display: none; }
    .sf-btn { padding: 12px 0; font-size: 13px; white-space: nowrap; }
    .sf-right { padding: 0 8px; } .sf-count { font-size: 13px; }

    /* cards: image-led */
    #content ul.products li.product .astra-shop-thumbnail-wrap img:not(.hover-img) { aspect-ratio: 4 / 5; height: auto; object-fit: cover; width: 100%; }
    #content ul.products li.product .ast-woo-product-category,
    #content ul.products li.product .card-bnpl,
    #content ul.products li.product .product-price-installments-not-in-variation { display: none !important; }
    #content ul.products li.product .astra-shop-summary-wrap { padding: 8px 6px 14px !important; }
    #content ul.products li.product .woocommerce-loop-product__title { margin: 0 0 3px; font-size: 11.5px; letter-spacing: .03em; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    #content ul.products li.product .price { margin: 0; font-size: 13px; }
    #content ul.products li.product .price del { margin-right: 5px; font-size: 12px; }
    /* hover extras make no sense on phones: tap opens the product */
    .card-sizes, .card-quickview, .astra-shop-thumbnail-wrap img.hover-img { display: none !important; }
    .card-tag { top: 6px; left: 6px; padding: 5px 7px; font-size: 9.5px; }
    .card-sizes.card-soldout-bar { display: flex !important; left: 6px; right: 6px; bottom: 6px; }
    .card-size.card-soldout { padding: 8px 2px; font-size: 10px; letter-spacing: .08em; }

    /* home: slim headings + hero buttons, 2-up tiles with smaller overlay text */
    .elementor-element-ced9ea5, .elementor-element-e7c41fb, .elementor-element-dd273fc, .elementor-element-9e5fa43 { padding-top: 22px; }
    .elementor-95 .elementor-top-section { padding: 0 6px 4px; }
    .elementor-95 .elementor-top-section .elementor-heading-title { font-size: 13px !important; letter-spacing: .05em; }
    .elementor-95 .elementor-top-section .elementor-button { font-size: 10.5px !important; }
    .elementor-95 .elementor-top-section .elementor-widget-wrap { min-height: 0; }
    .elementor-95 .elementor-top-section .elementor-widget-heading { bottom: 46px; left: 12px; right: 8px; }
    .elementor-95 .elementor-top-section .elementor-widget-button { left: 12px; bottom: 14px; }
    .elementor-95 .elementor-top-section .elementor-widget-image img { aspect-ratio: 4 / 5; }
    .elementor-95 .elementor-top-section .elementor-col-50 .elementor-widget-wrap:has(.elementor-widget-heading + .elementor-widget-heading) .elementor-widget-heading + .elementor-widget-heading { display: none; }
    .elementor-95 .elementor-top-section .elementor-col-50 .elementor-widget-image + .elementor-widget-heading { bottom: 46px !important; }

    /* product popup: bottom sheet with the photo on top */
    .qv-info { padding: 18px 16px 20px; } .qv-title { font-size: 17px; } .qv-desc { display: none; }

    /* footer: stack neatly */
    .site-footer .ast-builder-grid-row { gap: 22px; }
}

@media (max-width: 380px) { #content ul.products { gap: 3px; } #content ul.products li.product .woocommerce-loop-product__title { font-size: 11px; } }

/* ================= phone refinements (home, header, listings) ================= */
@media (max-width: 767px) {
    /* header: icon + count badge only; the money total made the bar overflow */
    #masthead .ast-woo-header-cart-info-wrap, #masthead .ast-woo-header-cart-total { display: none !important; }

    /* home hero: show the whole picture (its text is part of the image), buttons sit under it as two equal touch buttons */
    .hm-managed > .e-parent:first-child { display: flex; flex-direction: column; }
    .hm-managed > .e-parent:first-child .elementor-widget-image { order: 1; }
    .hm-managed .elementor-element-390aac1 img { width: 100%; height: auto !important; aspect-ratio: auto !important; object-fit: contain; }
    /* the hero box must grow with its picture: as a flex item it could shrink to a height measured before the tall phone
       picture loaded (seen at 3x pixel density), and the next heading then sat on top of the banner */
    .hm-managed > .e-parent:first-child { height: auto !important; min-height: 0 !important; }
    .hm-managed > .e-parent:first-child > .elementor-widget-image { flex: 0 0 auto !important; height: auto !important; }
    /* with its own phone picture the hero is a plain block (its buttons sit on the photo, nothing to reorder): as a flex
       column Chrome sized it from the picture's natural size, not the drawn one, so at 3x screens or other widths it came out
       shorter than the photo and the next section ran over the banner */
    .hm-managed > .e-parent.hero-has-mobile:first-child { display: block !important; position: relative; }
    .hm-managed > .e-parent.hero-has-mobile:first-child .elementor-widget-image, .hm-managed > .e-parent.hero-has-mobile:first-child picture,
    .hm-managed > .e-parent.hero-has-mobile:first-child img { display: block !important; width: 100% !important; height: auto !important; }
    /* "graphic tees" row: one card per line on phones, so the photo fills the card instead of sitting in a narrow strip */
    .hm-managed .elementor-element-79a89ab .elementor-widget-image a, .hm-managed .elementor-element-79a89ab .elementor-widget-image .elementor-widget-container { display: block; width: 100% !important; }
    .hm-managed .elementor-element-79a89ab .elementor-widget-image img { width: 100% !important; max-width: none !important; height: auto !important; aspect-ratio: 1 / 1 !important; object-fit: cover; object-position: center top; }
    .hm-managed .hero-cta { order: 2; position: static; transform: none; display: flex; gap: 8px; padding: 10px 6px 4px; }
    .hm-managed .hero-btn { flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 8px; text-align: center; font-size: 12px; letter-spacing: .08em; }
    /* hero with its own tall phone picture: the buttons sit on the photo near the bottom, side by side */
    .hm-managed .hero-has-mobile .hero-cta { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); z-index: 6; width: min(78%, 300px); padding: 0; gap: 6px; }
    .hm-managed .hero-has-mobile .hero-btn { min-height: 40px; font-size: 11px; border-color: #fff; }

    /* promo banners: whole picture, no side crop */
    .hm-managed .elementor-element-e8dc465 img, .hm-managed .elementor-element-2b5dc8c img { height: auto !important; aspect-ratio: auto !important; object-fit: contain; }

    /* tile text sized for phones (home.css loads after this file, so the extra `body` wins at equal weight) */
    body .elementor-95 .elementor-top-section .elementor-widget-heading { left: 12px; right: 8px; width: auto; max-width: calc(100% - 20px); bottom: 44px; }
    body .elementor-95 .elementor-top-section .elementor-widget-button { left: 12px; bottom: 14px; }
    body .elementor-95 .elementor-top-section .elementor-heading-title { font-size: 13px !important; letter-spacing: .05em; line-height: 1.2 !important; overflow-wrap: anywhere; }
    body .elementor-95 .elementor-top-section .elementor-button { font-size: 10.5px !important; }
    body .elementor-95 .elementor-top-section .elementor-col-50 .elementor-heading-title { font-size: 16px !important; }
    body .elementor-95 .elementor-top-section .elementor-col-50 .elementor-widget-heading + .elementor-widget-heading .elementor-heading-title { font-size: 13px !important; }
    body .elementor-95 .elementor-top-section .elementor-col-50 .elementor-widget-wrap:has(.elementor-widget-heading + .elementor-widget-heading) .elementor-widget-image + .elementor-widget-heading { bottom: 74px !important; }
    body .elementor-95 .elementor-top-section .elementor-col-50 .elementor-widget-button { bottom: 20px; }

    /* section headings: slim, never wider than the screen */
    .elementor-element-ced9ea5 .elementor-heading-title, .elementor-element-e7c41fb .elementor-heading-title, .elementor-element-dd273fc .elementor-heading-title, .elementor-element-9e5fa43 .elementor-heading-title { font-size: 18px !important; }

    /* the wide tiles get the same tall phone shape as the rest */
    .elementor-95 .elementor-top-section .elementor-col-50 .elementor-widget-image img { aspect-ratio: 4 / 5; }
}

/* ================= phone listings: touch-sized filters, sheets above the tab bar ================= */
@media (max-width: 767px) {
    /* the tab bar is 68px tall: keep the last row of content clear of it */
    html body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

    /* sort + filter row stays reachable while scrolling, just under the header */
    body .shop-filterbar { position: sticky; top: 74px; z-index: 150; background: #fff; margin: 0 -6px 8px; padding: 0 6px; box-shadow: 0 1px 0 #eee; }
    body .sf-btn { min-height: 44px; padding: 0 2px; align-items: center; }
    body .sf-left { gap: 4px 18px; }
    body .sf-clear { display: inline-flex; align-items: center; min-height: 44px; }

    /* filter sheets take the bottom of the screen: the tab bar steps aside while one is open (the sticky filter row is its own stacking layer, so z-index alone cannot lift the sheet above the bar) */
    body:has(.sf-group.is-open) .m-tabbar { display: none; }
    body .sf-group.is-open .sf-panel { z-index: 380; max-height: 72vh; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; }
    body .sf-row { min-height: 48px; padding: 12px 20px; font-size: 15px; }
    body .sf-row.sf-sub { padding-left: 40px; font-size: 14px; }
    body .sf-row input { width: 20px; height: 20px; }
    body .sf-sizes.sf-panel, body .sf-sizes.sf-panel { min-width: 0; }
    body .sf-chip span { min-width: 52px; padding: 14px 12px; font-size: 14px; }

    /* page links, if a listing has more than one page */
    body .woocommerce-pagination ul.page-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; border: 0; }
    body .woocommerce-pagination ul.page-numbers li { border: 0; float: none; }
    body .woocommerce-pagination .page-numbers a, body .woocommerce-pagination .page-numbers span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }

    /* sold-out bar and tags never overlap the title */
    body ul.products li.product .woocommerce-loop-product__title { min-height: 2.6em; }
}

/* ================= phone 404 ================= */
@media (max-width: 767px) {
    body.error404 .ast-container { padding: 28px 18px 8px; }
    body.error404 .page-title, body.error404 .entry-title { font-size: 26px !important; line-height: 1.2 !important; margin: 0 0 14px !important; text-align: center; }
    body.error404 .page-content, body.error404 .page-content p, body.error404 .page-content h2 { font-size: 16px !important; line-height: 1.5 !important; text-align: center; font-weight: 500; }
    body.error404 .search-form, body.error404 .search-field { width: 100%; }
    body.error404 .search-field { min-height: 48px; font-size: 16px; padding: 0 14px; border-radius: 10px; }
    body.error404 .search-submit { min-width: 48px; min-height: 48px; }
}

/* ================= desktop: the phone-only tab bar, search sheet and help list never show =================
   (mobile-app.css, which hides them by default, is only loaded on phones, so the desktop rule has to live in a file that loads everywhere) */
@media (min-width: 768px) {
    .m-tabbar, .m-search, .m-help { display: none !important; }
}
