/* Phone-only storefront. Keep app.css and desktop geometry unchanged. */
@media (max-width:640px), (max-width:960px) and (max-height:500px) and (pointer:coarse) {
  :root { --mobile-nav-height:68px; --mobile-safe-bottom:env(safe-area-inset-bottom,0px); }
  html { scroll-padding-top:124px; }
  body { padding-bottom:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom)); font-size:14px; line-height:1.5; }
  .container { width:calc(100% - 32px); }
  main, main section, .header-main, .product-info, .cart-item-copy { min-width:0; }
  h1,h2,h3,.product-title,.cart-item-copy,.summary-line,.info-content,.legal-document { overflow-wrap:anywhere; }
  h1 { font-size:32px; line-height:1.1; letter-spacing:-.045em; }
  h2 { font-size:26px; line-height:1.15; }
  a,button,input,select,textarea { touch-action:manipulation; }
  input:not([type=checkbox]):not([type=radio]),select,textarea { font-size:16px; }
  :focus-visible { outline:3px solid #b67b06; outline-offset:3px; }
  .page-scrollbar-track { display:none; }
  .topbar-inner { min-height:28px; gap:8px; font-size:10px; }
  .topbar-inner a { padding:6px 0; white-space:nowrap; }
  .site-header { position:sticky; top:0; z-index:30; }
  .header-main { display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:8px 12px; padding:9px 0 12px; min-height:0; }
  .header-main .logo { font-size:23px; gap:8px; min-height:40px; }
  .header-main .logo img { width:32px; height:32px; }
  .header-main .header-action { display:none; }
  .header-main .header-action-whatsapp { display:grid; grid-column:2; grid-row:1; width:44px; height:44px; min-width:44px; border:1px solid var(--line); border-radius:12px; background:#fff; }
  .header-main .header-action-whatsapp .ui-icon { width:23px; height:23px; }
  .search-form { order:initial; grid-column:1/-1; grid-row:2; width:100%; min-width:0; height:46px; border-radius:12px; }
  .search-form>span { padding-left:12px; flex:0 0 auto; }
  .search-form input { min-width:0; padding:0 8px; font-size:16px; }
  .search-form button { min-width:62px; padding:0 12px; border-radius:0 11px 11px 0; font-size:12px; }
  .search-suggestions { max-height:min(52dvh,360px); border-radius:12px; }
  .search-suggestions button { min-height:48px; }
  .search-suggestions button span { white-space:normal; }

  /* Five permanent destinations, safe-area padding for iPhone home indicator. */
  .mobile-bottom-nav[hidden] { position:fixed; z-index:70; inset:auto 0 0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); height:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom)); padding:7px max(4px,env(safe-area-inset-right)) calc(7px + var(--mobile-safe-bottom)) max(4px,env(safe-area-inset-left)); border-top:1px solid #e5e5e2; background:rgba(255,255,255,.98); box-shadow:0 -5px 24px rgba(23,40,59,.06); }
  .mobile-nav-link { display:flex; min-width:0; min-height:50px; flex-direction:column; align-items:center; justify-content:center; gap:3px; color:#737983; font-size:10px; font-weight:600; line-height:1.2; }
  .mobile-nav-icon { position:relative; display:grid; place-items:center; width:44px; height:29px; border-radius:18px; }
  .mobile-nav-icon .ui-icon { width:22px; height:22px; stroke-width:1.7; }
  .mobile-nav-link.is-active { color:var(--navy); font-weight:800; }
  .mobile-nav-link.is-active .mobile-nav-icon { background:#ffcb45; }
  .mobile-nav-icon i { position:absolute; top:-3px; right:0; min-width:15px; height:15px; display:grid; place-items:center; padding:0 3px; border:1px solid #fff; border-radius:9px; background:var(--accent); color:#342707; font-size:9px; font-style:normal; font-weight:800; }
  .mobile-nav-icon i[hidden] { display:none; }
  .mobile-bottom-nav a:active .mobile-nav-icon { background:#fff1c6; }
  .toast { right:16px; left:16px; bottom:calc(82px + var(--mobile-safe-bottom)); max-width:none; text-align:center; }

  .hero-grid { min-height:0; padding:36px 0 32px; }
  .hero-copy { width:100%; }
  .hero-copy .eyebrow { margin-bottom:14px; font-size:10px; }
  .hero-copy h1 { font-size:clamp(32px,9vw,46px); line-height:1.08; margin-bottom:18px; }
  .hero-copy>p { font-size:15px; line-height:1.6; margin-bottom:0; }
  .hero-actions { display:grid; grid-template-columns:1fr; gap:10px; margin-top:24px; }
  .hero-actions .button { min-height:48px; border-radius:12px; }
  .hero-trust { display:grid; gap:10px; margin-top:24px; font-size:11px; }
  .hero-trust>span { display:flex; align-items:center; gap:8px; }
  .hero-trust .ui-icon { width:15px; height:15px; }
  .section { padding:36px 0; }
  .section-header { flex-direction:row; align-items:flex-end; gap:12px; margin-bottom:20px; }
  .section-header>div { min-width:0; }
  .section-header .eyebrow { margin-bottom:9px; font-size:10px; }
  .section-header h2 { margin:0; font-size:26px; }
  .section-header>a { display:flex; flex:0 0 auto; align-items:center; gap:5px; padding:6px 0; font-size:11px; }
  .section-header>a .ui-icon { width:15px; height:15px; }
  .section-header p { margin-top:10px; font-size:13px; }
  .category-grid,.catalog-group-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .category-card,.catalog-group-card { min-height:178px; border-radius:14px; box-shadow:none; }
  .category-card>img,.catalog-group-card>img { object-fit:contain; padding:8px 8px 34px; }
  .category-card:after,.catalog-group-card:after { inset:30% 0 0; }
  .category-card>span,.catalog-group-card>div { width:100%; padding:12px 24px 12px 12px; }
  .category-card strong,.catalog-group-card strong { font-size:12px; line-height:1.3; }
  .category-card small,.catalog-group-card small { margin-top:4px; font-size:10px; }
  .category-card>.ui-icon,.catalog-group-card>span { right:9px; bottom:13px; width:14px; height:18px; font-size:18px; }
  .page-shell { padding:18px 0 40px; }
  .page-heading { max-width:100%; margin:12px 0 24px; }
  .page-heading h1 { font-size:32px; margin-bottom:12px; }
  .page-heading p { font-size:14px; line-height:1.55; margin-bottom:0; }
  .breadcrumbs { margin:0 0 18px; font-size:11px; line-height:1.65; overflow-wrap:anywhere; }
  .product-grid,.catalog-results .product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .product-card { border-radius:14px; }
  .product-image { height:auto; aspect-ratio:1/1; padding:7px; background:#fff; }
  .product-image img { min-height:0; }
  .product-card-body { padding:11px; gap:7px; }
  .product-card .favorite-button { top:8px; right:8px; width:36px; height:36px; }
  .product-card .stock { font-size:10px; }
  .product-title { min-height:3.9em; max-height:3.9em; font-size:12px; line-height:1.3; -webkit-line-clamp:3; line-clamp:3; }
  .product-price { gap:4px; padding-top:5px; }
  .product-price strong { font-size:16px; line-height:1.35; }
  .product-price small { font-size:10px; }
  .product-actions { grid-template-columns:1fr; gap:0; }
  .product-actions>.icon-button { display:none; }
  .product-actions .button { min-height:44px; padding:0 5px; font-size:12px; border-radius:10px; }
  .product-actions .button .ui-icon { width:16px; height:16px; }
  .pagination { gap:6px; margin-top:22px; }
  .pagination a,.pagination button { width:40px; height:44px; }

  /* Progressive enhancement: without JS the original filters remain inline. */
  .mobile-ready .mobile-filter-toggle[hidden] { display:flex; width:100%; margin-bottom:12px; min-height:46px; justify-content:flex-start; padding:0 14px; border-radius:12px; }
  .catalog-layout { gap:16px; }
  .catalog-toolbar { flex-direction:column; align-items:stretch; padding:12px; gap:10px; border-radius:12px; }
  .catalog-toolbar>span { font-size:12px; }
  .catalog-toolbar label { display:grid; grid-template-columns:auto minmax(0,1fr); gap:10px; width:100%; font-size:11px; }
  .catalog-toolbar select { width:100%; min-width:0; height:44px; font-size:16px; }
  .mobile-ready .filters { display:none; }
  .mobile-ready .filters.is-mobile-open { position:fixed; z-index:100; inset:12px 0 0 auto; display:flex; flex-direction:column; width:min(100%,480px); max-width:none; height:calc(100dvh - 12px); margin:0; padding:0; border:0; border-radius:20px 20px 0 0; background:#fff; box-shadow:0 -12px 50px rgba(0,0,0,.12); }
  .is-mobile-open .mobile-filter-header[hidden] { display:flex; align-items:center; justify-content:space-between; flex:0 0 auto; padding:16px 20px; border-bottom:1px solid var(--line); font-size:20px; }
  .is-mobile-open [data-catalog-filters] { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:18px 20px; }
  .filters label,.brand-filter>div>span { font-size:14px; }
  .filter-scroll { max-height:260px; gap:6px; }
  .filter-scroll label { min-height:38px; white-space:normal; }
  .filter-scroll label span { white-space:normal; }
  .filters input[type=checkbox] { flex:0 0 20px; width:20px; height:20px; }
  .brand-filter>div { grid-template-columns:minmax(0,1fr) 44px 44px; min-height:44px; }
  .brand-filter button { width:44px; height:44px; font-size:19px; }
  .price-inputs { gap:12px; }
  .price-inputs input { height:46px; }
  .is-mobile-open .mobile-filter-apply[hidden] { display:flex; flex:0 0 auto; min-height:48px; margin:12px 20px calc(16px + var(--mobile-safe-bottom)); }
  .mobile-filter-backdrop:not([hidden]) { position:fixed; z-index:90; inset:0; display:block; width:100%; height:100%; padding:0; border:0; background:rgba(13,29,44,.48); }
  html.mobile-filters-open,html.mobile-filters-open body { overflow:hidden; }

  .product-detail { display:flex; flex-direction:column; gap:22px; margin-top:0; }
  .product-gallery { width:100%; min-width:0; }
  .product-gallery>img { height:auto; aspect-ratio:1/1; padding:12px; border-radius:16px; }
  .product-gallery>div { max-width:100%; overflow-x:auto; gap:10px; padding:4px 0; }
  .product-gallery>div img { flex:0 0 68px; width:68px; height:68px; padding:4px; cursor:pointer; }
  .product-gallery>div img[aria-pressed=true] { border:2px solid var(--accent2); }
  .product-info { width:100%; }
  .product-info h1 { margin:12px 0; font-size:26px; line-height:1.18; letter-spacing:-.035em; }
  .product-info>.product-meta { display:block; margin:0 0 12px; font-size:11px; }
  .product-info>p { font-size:14px; }
  .buy-box { grid-template-columns:minmax(0,1fr) 48px; gap:12px; margin-top:20px; padding:16px; }
  .buy-box>.product-price { grid-column:1/-1; padding:0; }
  .buy-box .product-price strong { font-size:24px; }
  .buy-box>.button,.buy-box>.icon-button { min-height:48px; }
  .buy-box>.icon-button { width:48px; }
  .product-tabs { gap:26px; margin-top:32px; }
  .product-tabs h2 { font-size:23px; }
  .specifications { padding:10px; }
  .specifications>div { grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:12px; padding:10px 6px; font-size:12px; overflow-wrap:anywhere; }
  .documents { margin-top:26px; padding:16px; }
  .documents a { gap:12px; overflow-wrap:anywhere; }
  .related-products { margin-top:36px; }
  .related-products .section-header { flex-direction:column; align-items:flex-start; }

  .cart-layout,.checkout-layout { grid-template-columns:minmax(0,1fr); gap:20px; }
  .cart-item { grid-template-columns:72px minmax(0,1fr); align-items:start; padding:14px; gap:12px; }
  .cart-item img { width:72px; height:82px; }
  .cart-item-copy { font-size:12px; }
  .cart-item-copy .text-button { min-height:36px; justify-self:start; }
  .cart-item>div:last-child { grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
  .quantity button,.quantity input { height:44px; }
  .quantity button { width:44px; }
  .quantity input { width:54px; font-size:16px; }
  .order-summary { padding:18px; gap:14px; box-shadow:none; }
  .order-summary h2 { margin-bottom:4px; font-size:24px; }
  .summary-line { gap:12px; font-size:13px; }
  .summary-line>span { min-width:0; }
  .summary-line>strong { flex-shrink:0; white-space:nowrap; }
  .summary-total { gap:12px; font-size:15px; }
  .summary-total strong { white-space:nowrap; }
  .order-summary>.button { min-height:50px; font-size:14px; padding:10px 12px; }
  .checkout-section { padding:18px; }
  .checkout-section h2 { font-size:21px; }
  .form-grid { grid-template-columns:minmax(0,1fr); gap:16px; }
  .form-grid label { min-width:0; font-size:13px; }
  .form-grid input,.checkout-section textarea { min-height:48px; font-size:16px; }
  .choice-row { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
  .choice-row label { min-height:48px; font-size:14px; }
  .choice-row input[type=radio] { width:20px; height:20px; min-height:20px; margin:0; }
  .payment-method { padding:14px; gap:12px; font-size:13px; }
  .payment-method p { margin:6px 0 0; }
  .legal-consents label { min-height:44px; }
  .auth-shell { min-height:0; padding:24px 0 40px; }
  .auth-card { width:100%; padding:24px 20px; gap:18px; border-radius:16px; box-shadow:none; }
  .auth-card h1 { font-size:30px; }
  .auth-card input { min-height:48px; font-size:16px; }
  .auth-card input[type=checkbox] { min-height:20px; width:20px; height:20px; }
  .auth-consents { padding:12px; }
  .auth-consents label { grid-template-columns:20px minmax(0,1fr); }
  .account-heading { gap:14px; margin:12px 0 24px; }
  .account-heading h1 { font-size:30px; }
  .account-heading p { overflow-wrap:anywhere; }
  .account-orders { padding:18px; }
  .order-list article { grid-template-columns:minmax(0,1fr); gap:6px; }
  .order-list article>span { grid-column:auto; }
  .order-success { min-height:420px; padding:32px 0; }
  .order-success h1 { font-size:30px; }
  .info-content,.legal-document { padding:20px; font-size:14px; }
  .info-content table,.legal-document table { display:block; max-width:100%; overflow-x:auto; }
  .faq-intro-card { padding:20px; gap:18px; }
  .faq-list summary { min-height:48px; font-size:14px; }
  .site-footer { padding-top:32px; }
  .footer-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px 20px; font-size:12px; }
  .footer-grid>div:first-child,.footer-grid>div:last-child { grid-column:1/-1; }
  .footer-grid h3 { font-size:14px; margin-bottom:4px; }
  .footer-grid>div>a:not(.logo) { padding:4px 0; overflow-wrap:anywhere; }
  .footer-bottom { margin-top:28px; padding:18px 0 24px; font-size:11px; }
  .footer-faq-button { min-height:44px; }
  .ai-launcher { width:72px; height:72px; right:10px; bottom:calc(82px + var(--mobile-safe-bottom)); }
  .ai-consultant { inset:8px 8px calc(78px + var(--mobile-safe-bottom)); width:auto; height:auto; max-height:calc(100dvh - 94px - var(--mobile-safe-bottom)); border-radius:16px; }
  .ai-consultant-header { padding:12px; gap:8px; }
  .ai-consultant-header strong { font-size:14px; }
  .ai-consultant-header small { font-size:10px; }
  .ai-consultant-header .ai-consultant-avatar { display:none; }
  .ai-consultant-form textarea { min-width:0; font-size:16px; }
  .ai-product-card { grid-template-columns:64px minmax(0,1fr); }
  .empty-state,.skeleton { min-height:220px; padding:24px 16px; }
}

@media (max-width:359px) {
  .container { width:calc(100% - 24px); }
  .category-card,.catalog-group-card { min-height:164px; }
  .category-card strong,.catalog-group-card strong { font-size:11px; }
  .section-header { flex-direction:column; align-items:flex-start; gap:8px; }
  .product-card-body { padding:9px; }
  .product-actions .button { font-size:11px; }
  .mobile-nav-link { font-size:9px; }
}

@media (min-width:641px) and (max-width:960px) and (max-height:500px) and (pointer:coarse) {
  .header-main { grid-template-columns:150px minmax(0,1fr) 44px; padding:7px 0; }
  .search-form { grid-column:2; grid-row:1; }
  .header-main .header-action-whatsapp { grid-column:3; }
  .category-grid,.catalog-group-grid,.product-grid,.catalog-results .product-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .hero-copy h1 { max-width:640px; font-size:36px; }
}
