/* Mobile storefront system. Loaded after the legacy page styles.
   Keep desktop rules in their components; !important here only bridges the
   existing mobile overrides until those components can be migrated separately. */
.home-mobile-routes { display: none; }

@media (max-width: 768px) {
    :root {
        --mobile-ink: #203e30;
        --mobile-muted: #58695f;
        --mobile-line: #dce4dd;
        --mobile-paper: #fafbf8;
        --mobile-radius: 16px;
        --mobile-gutter: 16px;
        --mobile-header-height: calc(119px + env(safe-area-inset-top));
    }

    body {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 16px;
        line-height: 1.5;
        color: var(--mobile-ink);
        background: var(--mobile-paper);
        padding-top: var(--mobile-header-height) !important;
        padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
        -webkit-text-size-adjust: 100%;
    }
    body .container { padding-inline: var(--mobile-gutter) !important; }
    html { scroll-padding-top: calc(135px + env(safe-area-inset-top)); }
    body :is(button, input, select, textarea) { font: inherit; }
    body :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
        font-size: 16px !important;
        border-radius: 12px;
    }
    body :is(a, button, input, select, textarea, summary):focus-visible {
        outline: 3px solid #6d9165 !important;
        outline-offset: 3px;
    }
    body :is(button, a) { -webkit-tap-highlight-color: transparent; }
    body :is(.category-title, .opt-mobile-heading, .opt-cart-hero h1,
        .checkout-hero h1, .articles-hero h1, .search-hero h1) {
        font-size: 28px !important;
        line-height: 1.15 !important;
        font-weight: 700 !important;
        letter-spacing: -.6px;
        color: var(--mobile-ink);
    }

    /* A stable, reachable search and cart on every consumer page. */
    body #header-module .main-header {
        padding: calc(10px + env(safe-area-inset-top)) 0 10px !important;
        background: rgba(255,255,255,.98) !important;
        border-bottom: 1px solid var(--mobile-line);
        box-shadow: none !important;
    }
    html body #header-module .header-flex {
        grid-template-columns: minmax(44px, 1fr) auto !important;
        grid-template-rows: 44px 46px !important;
        gap: 8px 12px !important;
    }
    body #header-module .logo { grid-column: 1 !important; grid-row: 1 !important; }
    body #header-module .header-actions {
        grid-column: 2 !important;
        grid-row: 1 !important;
        gap: 8px !important;
    }
    body #header-module .icon-group { gap: 8px !important; }
    body #header-module :is(.icon-circle, .header-cart-link) {
        width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        border-radius: 13px !important;
        box-shadow: none !important;
    }
    html body #header-module .header-actions .header-cart-link {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        flex: 0 0 44px !important;
        padding: 0 !important;
    }
    body #header-module .search-wrapper {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        height: 46px !important;
        min-height: 46px !important;
        border: 1px solid var(--mobile-line) !important;
        border-radius: 13px !important;
        background: #f4f6f1 !important;
    }
    body #header-module .search-wrapper input { font-weight: 400 !important; }
    body #header-module .search-wrapper input::placeholder { color: var(--mobile-muted); opacity: 1; }
    body #header-module .search-btn { width: 46px !important; height: 44px !important; }
    body .opt-page .opt-floating-route { display: none !important; }

    /* Keep the user's four destinations, with a clear active page. */
    body .mobile-bottom-nav {
        left: 10px !important;
        right: 10px !important;
        bottom: calc(10px + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        min-height: 66px !important;
        padding: 5px !important;
        border: 1px solid rgba(255,255,255,.24) !important;
        border-radius: 19px !important;
        background: #1c402e !important;
        box-shadow: 0 6px 24px #132e2426 !important;
    }
    body .mobile-bottom-nav .mobile-bottom-item {
        min-height: 54px !important;
        gap: 4px !important;
        border-radius: 14px !important;
        color: #e1e9df !important;
    }
    body .mobile-bottom-nav .mobile-bottom-item svg { width: 22px !important; height: 22px !important; }
    body .mobile-bottom-nav .mobile-bottom-item span {
        font-size: 12px !important;
        line-height: 1.2 !important;
        font-weight: 600 !important;
    }
    body .mobile-bottom-nav .mobile-bottom-item:is(.is-active, [aria-expanded=true]) {
        background: #fff !important;
        color: #1c402e !important;
        box-shadow: none !important;
    }
    body.mobile-layer-open .mobile-bottom-nav { visibility: hidden; }
    body .mobile-catalog-menu {
        bottom: calc(100% + 10px) !important;
        padding: 20px !important;
        border: 1px solid var(--mobile-line);
        border-radius: 20px !important;
        box-shadow: 0 8px 40px #17362633 !important;
    }
    body .mobile-catalog-menu-grid a { min-height: 54px !important; border-radius: 12px !important; font-size: 15px !important; }

    /* Menus and filters share one bottom-sheet treatment. */
    body :is(.nav-bar, .mobile-filter-panel) {
        border-radius: 24px 24px 0 0 !important;
        box-shadow: 0 -12px 48px #17362626 !important;
        overscroll-behavior: contain;
        scroll-padding-block: 80px;
    }
    body .nav-bar { max-height: calc(100dvh - 32px) !important; padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important; }
    body .mobile-menu-head { padding: 18px 20px !important; }
    body .mobile-menu-head strong { font-size: 26px !important; font-weight: 700; }
    body :is(.mobile-menu-close, .mobile-filter-head button) { width: 44px !important; height: 44px !important; }
    body .mobile-menu-links > li:not(.mobile-menu-primary) a { min-height: 54px !important; padding: 14px 20px !important; font-size: 17px !important; font-weight: 500 !important; }
    body .mobile-menu-primary a { min-height: 76px !important; border-radius: 14px !important; font-size: 15px !important; text-transform: none !important; }
    body .mobile-menu-social { gap: 10px !important; padding: 20px !important; }
    body .mobile-menu-social a { padding: 12px !important; min-height: 66px; border-radius: 14px !important; }
    body .mobile-filter-panel { inset: auto 0 0 !important; width: 100% !important; padding: 0 20px !important; max-height: calc(100dvh - 32px) !important; }
    body .mobile-filter-head { position: sticky; top: 0; z-index: 5; background: #fff; padding: 16px 0 !important; }
    body .mobile-filter-head strong { font-size: 22px !important; }
    body .mobile-filter-actions { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)) !important; background: #fff; z-index: 5; }
    body .mobile-filter-actions button { min-height: 50px !important; border-radius: 13px !important; font-size: 16px !important; }
    body .filter-group > label { min-height: 44px; font-size: 16px !important; }
    body .mobile-filter-panel :is(.tea-category-link, .tea-category-toggle) { min-height: 46px; font-size: 16px !important; font-weight: 500 !important; text-transform: none !important; border-radius: 10px; }
    body .opt-catalog-filters button { min-height: 44px; font-size: 15px !important; }

    /* Home: editorial image + two permanent shopping routes. */
    body.home-page #slide-module { height: auto !important; min-height: 0 !important; }
    body.home-page .hero-section { width: auto !important; margin: 14px 0 0 !important; padding: 0 !important; }
    body.home-page .hero-section .container-full { width: 100% !important; }
    body.home-page :is(.hero-swiper, .hero-banner) { border-radius: 20px !important; overflow: hidden; }
    body.home-page :is(.hero-swiper, .hero-banner) { height: clamp(350px, 90vw, 420px) !important; min-height: clamp(350px, 90vw, 420px) !important; }
    body.home-page .hero-slide-content { inset: auto 0 0 !important; padding: 24px 22px 44px !important; max-width: none !important; }
    body.home-page .hero-slide-title { max-width: 330px !important; font-size: 30px !important; line-height: 1.07 !important; font-weight: 700 !important; letter-spacing: -.7px; }
    body.home-page .hero-text-banner-green .hero-slide-actions { display: none !important; }
    body.home-page .hero-slide-button { min-height: 46px !important; font-size: 15px !important; border-radius: 12px !important; }
    body.home-page .hero-swiper .swiper-pagination { bottom: 14px !important; }
    body.home-page .hero-swiper .swiper-pagination-bullet { width: 7px; height: 7px; background: #fff !important; opacity: .5; }
    body.home-page .hero-swiper .swiper-pagination-bullet-active { width: 22px; border-radius: 10px; opacity: 1; transform: none !important; }
    body.home-page .home-mobile-routes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px 0; }
    .home-mobile-routes a { position: relative; display: flex; min-height: 104px; flex-direction: column; justify-content: center; gap: 8px; padding: 16px 12px; border-radius: 16px; text-decoration: none; background: #1c402e; color: #fff; }
    .home-mobile-routes a + a { background: #e8eddf; color: #203e30; }
    .home-mobile-routes strong { font-size: 17px; line-height: 1.2; font-weight: 700; }
    .home-mobile-routes span { font-size: 13px; line-height: 1.3; }
    body.home-page #wholesale-promo-module { display: none; }
    body.home-page .category-banners { margin-block: 28px 24px !important; padding-block: 0 !important; }
    body .category-banners-head h2 { font-size: 24px !important; font-weight: 700 !important; letter-spacing: -.4px; }
    body .category-banners-swiper .banner-card { width: 100% !important; aspect-ratio: 3 / 4 !important; height: auto !important; min-height: 0 !important; border: 1px solid var(--mobile-ink) !important; border-radius: 8px !important; box-shadow: none !important; }
    body .category-banners-swiper .banner-title { font-size: 16px !important; font-weight: 600 !important; }
    body.home-page .featured-products { padding-block: 0 24px !important; background: var(--brand-accent); }
    body.home-page .featured-products-head { gap: 12px !important; margin-bottom: 12px !important; }
    body.home-page .featured-products-head .featured-audience-title { width: calc(100% + var(--mobile-gutter) * 2) !important; margin-inline: calc(-1 * var(--mobile-gutter)) !important; min-height: 64px !important; padding: 0 !important; font-size: 24px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: -.3px; }
    body.home-page .featured-audience-link { min-height: 64px; padding: 18px 16px; }
    body.home-page .featured-minimum-order { margin-bottom: 14px !important; padding: 12px 14px !important; border-radius: 12px !important; background: var(--brand-accent-wash); border-left-width: 3px; }
    body.home-page .featured-minimum-order strong { font-size: 15px !important; font-weight: 500 !important; line-height: 1.4 !important; }
    body.home-page .featured-business-order > span { font-size: 13px !important; }
    body.home-page .featured-showcase + .featured-showcase { margin-top: 16px !important; padding-top: 0 !important; border: 0 !important; }
    body.home-page .featured-business-footer a { min-height: 48px; border-radius: 13px; }
    body.home-page :is(.home-articles-section, .reviews, .pottery-section, .tea-history, .tea-origin, .own-production, .tea-ceremonies) { margin-block: 0 !important; padding-block: 28px !important; }
    body.home-page .home-articles-banner { border-radius: 20px !important; min-height: 190px !important; }
    body.home-page .home-articles-copy h2 { font-size: 26px !important; font-weight: 700 !important; }

    /* One card geometry in retail, wholesale, carousels and recommendations. */
    body .products-grid,
    body :is(.catalog-content, .product-related) .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    body .product-card.product-card {
        display: flex !important; flex-direction: column !important;
        min-height: 0 !important; height: auto !important;
        border: 1px solid var(--mobile-line) !important;
        border-radius: var(--mobile-radius) !important;
        box-shadow: none !important;
    }
    body .product-card.product-card :is(.product-card-media, .product-thumb-link, .product-thumb) {
        display: block !important; width: 100% !important; height: auto !important;
        min-height: 0 !important; padding: 0 !important;
        aspect-ratio: 1 !important; flex: 0 0 auto !important;
    }
    body .product-card.product-card .product-thumb img { width: 100% !important; height: 100% !important; aspect-ratio: 1 !important; object-fit: cover !important; border-radius: 0 !important; }
    body .product-card.product-card .product-info { display: flex !important; flex-direction: column !important; flex: 1 0 auto !important; min-height: 0 !important; gap: 8px !important; padding: 12px 10px 10px !important; text-align: left !important; }
    body .product-card.product-card :is(.product-title, .product-title a) { font-size: 15px !important; line-height: 1.3 !important; font-weight: 600 !important; color: var(--mobile-ink); }
    body .product-card.product-card .product-title { display: -webkit-box !important; -webkit-line-clamp: 3 !important; -webkit-box-orient: vertical; overflow: hidden; min-height: 58.5px !important; max-height: 58.5px !important; margin: 0 !important; }
    body .product-card.product-card .product-type { font-size: 12px !important; font-weight: 400 !important; color: var(--mobile-muted); }
    body .product-card.product-card .product-footer { margin-top: auto !important; gap: 8px !important; padding: 0 !important; }
    body .product-card.product-card .price-main { display: flex; flex-wrap: wrap; font-size: 20px !important; line-height: 1.15 !important; font-weight: 700 !important; gap: 4px !important; }
    body .product-card.product-card .price-unit { display: block; flex-basis: 100%; color: var(--mobile-muted); font-size: 13px !important; font-weight: 400 !important; }
    body .product-card.product-card :is(.add-to-cart-btn, .opt-catalog-product-button) { display: flex !important; align-items: center !important; justify-content: center !important; gap: 7px !important; min-height: 46px !important; padding: 10px 6px !important; border-radius: 11px !important; line-height: 1.2 !important; font-size: 14px !important; }
    body .product-card.product-card .add-to-cart-btn span { height: auto !important; min-height: 0 !important; line-height: 1.2 !important; }
    body .product-card.product-card .add-to-cart-icon { position: static !important; width: 16px !important; height: 16px !important; flex: 0 0 16px; transform: none !important; }
    body .product-card.product-card .product-favorite-btn { top: 6px !important; right: 6px !important; width: 44px !important; height: 44px !important; font-size: 23px !important; box-shadow: none !important; border-color: var(--mobile-line); }
    body .product-card.product-card .product-badge-group { top: 8px !important; left: 7px !important; max-width: calc(100% - 60px); }
    body .product-card.product-card .product-badge { font-size: 11px !important; font-weight: 500 !important; border-radius: 6px !important; padding: 4px 6px !important; }
    body .product-card.product-card .product-badge + .product-badge { display: none; }
    body .product-card.product-card .product-card-gallery-count { font-size: 12px !important; border-radius: 6px; }
    html body .opt-catalog-page .product-card :is([data-opt-card-price] strong, .opt-product-single-price strong) { font-size: 20px !important; }
    html body .opt-page .product-card.product-card :is(.product-title, .product-title a) { font-size: 15px !important; line-height: 1.3 !important; }
    body :is(.catalog-content, .opt-catalog-page) .catalog-pagination { margin-block: 20px 12px; }
    body .catalog-pagination button { width: 100%; border-radius: 13px; min-height: 50px; }

    /* Catalog chrome is lighter than the products and carries one active route. */
    body .catalog-route-tabs { gap: 3px !important; padding: 4px !important; min-height: 52px; border: 1px solid var(--mobile-line) !important; border-radius: 15px !important; background: #edf1e9 !important; box-shadow: none !important; }
    body .catalog-route-tabs a { min-height: 44px !important; padding: 8px 3px !important; font-size: 13px !important; font-weight: 600 !important; color: var(--mobile-ink) !important; border-radius: 11px !important; }
    body .catalog-route-tabs a.is-active { background: #1c402e !important; color: #fff !important; box-shadow: none !important; }
    body .mobile-filter-toggle { min-height: 48px !important; border: 1px solid var(--mobile-line) !important; border-radius: 13px !important; background: #fff !important; padding: 12px 16px !important; font-size: 16px !important; font-weight: 600 !important; }
    body .catalog-minimum-order { margin-block: 12px 16px !important; padding: 12px 14px !important; border-radius: 12px !important; background: var(--brand-accent) !important; }
    body .catalog-minimum-order strong { font-size: 14px !important; font-weight: 500 !important; }
    body .opt-mobile-conditions { padding: 14px !important; border-radius: 14px !important; background: var(--brand-accent) !important; }
    body .opt-mobile-conditions summary { position: relative; min-height: 44px; padding-right: 28px; cursor: pointer; list-style: none; }
    body .opt-mobile-conditions summary::-webkit-details-marker { display: none; }
    body .opt-mobile-conditions summary::after { content: '+'; position: absolute; top: 6px; right: 0; font-size: 24px; line-height: 1; }
    body .opt-mobile-conditions[open] summary::after { content: '−'; }
    body .opt-mobile-conditions summary strong { display: block; font-size: 16px; line-height: 1.3; font-weight: 600; }
    body .opt-mobile-conditions summary span { display: block; margin-top: 5px; color: var(--mobile-muted); font-size: 13px; line-height: 1.4; }
    body .opt-mobile-conditions[open] ul { margin-top: 14px; padding-top: 14px; border-top: 1px solid #d9dccf; }
    body .opt-mobile-conditions h2 { font-size: 16px !important; }
    body .opt-mobile-conditions :is(li, p, a) { font-size: 14px !important; line-height: 1.4 !important; }
    body .opt-mobile-conditions a { display: inline-flex; align-items: center; min-height: 44px; }
    body .opt-catalog-page .opt-catalog-content .opt-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

    /* Product details, forms and both carts follow the same spacing/controls. */
    body :is(.product-layout, .opt-cart-items-card, .opt-cart-order-card, .checkout-card, .checkout-summary, .checkout-panel) { border-radius: 18px !important; box-shadow: none !important; }
    body .product-page .product-panel h1 { font-size: 24px !important; line-height: 1.2 !important; letter-spacing: -.4px; }
    body .product-page .product-gallery .product-main-image { height: min(74vw, 320px) !important; }
    body .product-page .product-image-wrap { width: 100% !important; max-width: none !important; height: auto !important; border-radius: 18px !important; }
    body .product-page :is(.product-main-image-stage, .product-main-media) { height: auto !important; min-height: 0 !important; aspect-ratio: auto !important; background: #fff; }
    body .product-page .product-purchase { border-radius: 18px !important; padding: 16px !important; }
    body .product-page .product-lead { display: none !important; }
    body .product-page .product-gallery-favorite { width: 44px !important; height: 44px !important; }
    body .product-page .product-image-zoom-button { min-height: 44px !important; border-radius: 10px; font-size: 14px !important; }
    body .product-page :is(.product-primary-btn, .product-secondary-btn) { min-height: 50px !important; border-radius: 13px !important; }
    body :is(.opt-cart-page, .checkout-page) :is(input:not([type=checkbox]):not([type=radio]), select) { min-height: 48px; }
    body .opt-cart-page .opt-cart-hero { padding: 0 !important; gap: 16px !important; background: transparent !important; color: var(--mobile-ink) !important; }
    body .opt-cart-page .opt-cart-back { min-height: 44px; margin-bottom: 8px; align-items: center; color: var(--mobile-muted) !important; font-size: 14px !important; font-weight: 500; }
    body .opt-cart-page .opt-cart-switch { border-radius: 16px !important; padding: 4px !important; background: #edf1e9; }
    body .opt-cart-page .opt-cart-switch a { border-radius: 12px !important; padding: 12px !important; color: var(--mobile-ink) !important; }
    body .opt-cart-page .opt-cart-switch a.is-active { background: #1c402e !important; color: #fff !important; box-shadow: none !important; }
    body .opt-cart-page .opt-cart-switch small { opacity: 1; font-weight: 400 !important; }
    body .opt-cart-page .opt-cart-item { border-radius: 14px !important; background: #f8faf6 !important; }
    body .opt-cart-page .opt-cart-item-controls { margin-right: 0 !important; grid-template-columns: 44px minmax(60px, 1fr) 44px !important; gap: 6px !important; }
    body .opt-cart-page .opt-cart-item-controls button { width: 44px !important; min-height: 44px !important; }
    body .opt-cart-page .opt-cart-item-remove { width: 44px !important; height: 44px !important; }
    body .opt-cart-page .opt-cart-form [type=submit] { min-height: 52px; border-radius: 13px; }
    body .checkout-page .cart-item { border-radius: 15px; box-shadow: none; }
    body .checkout-page .cart-controls button { min-width: 44px; min-height: 44px; }
    body .checkout-page .cart-remove { min-height: 44px; }
    body .articles-page .article-card { border-radius: 16px !important; box-shadow: none !important; }
    body .articles-page .article-card h3 { font-size: 18px !important; font-weight: 600 !important; }
    body .search-page .search-hero { padding: 18px !important; border-radius: 18px !important; background: #edf1e9; }
    body .search-page .search-hero h1 { font-size: 24px !important; line-height: 1.2 !important; }
    body .search-page .search-hero-form { display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; gap: 8px !important; margin-top: 16px; }
    body .search-page .search-hero-form :is(input, button) { min-width: 0; min-height: 48px !important; padding-inline: 12px !important; border-radius: 12px !important; }
    body .search-page .search-quick-links { flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin-top: 12px; }
    body .search-page .search-quick-links a { display: inline-flex; min-height: 44px; align-items: center; flex-shrink: 0; }
    body .search-page .search-site-link { border-radius: 14px; }
    body .info-page .contact-method { border-radius: 16px !important; box-shadow: none !important; }
    body .info-page .contact-method a { min-height: 44px; }
    body #footer-module { padding-top: 28px !important; }
    body .site-footer { border-radius: 24px 24px 0 0; }
}

@media (max-width: 359px) {
    body { --mobile-gutter: 12px; }
    body .catalog-route-tabs a { font-size: 12px !important; }
    body .product-card.product-card .product-info { padding-inline: 8px !important; }
    body .product-card.product-card :is(.product-title, .product-title a) { font-size: 14px !important; }
    body .product-card.product-card .price-main { font-size: 18px !important; }
    body .opt-cart-page .opt-cart-item { grid-template-columns: 56px minmax(0, 1fr) !important; }
    body .opt-cart-page :is(.opt-cart-item-image, .opt-cart-item-image img) { width: 56px !important; height: 72px !important; }
    body .opt-cart-page .opt-cart-item-remove { grid-column: 2; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-swiper *, .mobile-filter-panel, .nav-bar { transition-duration: 0.01ms !important; }
}
