/* Apex Fitness Supply theme: menus (all screen sizes) and phone layout. Loaded after main.css and woocommerce.css. */

/* ==========================================================================
   Menu: shared
   ========================================================================== */
.submenu-toggle{display:none;align-items:center;justify-content:center;background:none;border:0;padding:0;margin:0;cursor:pointer;color:inherit;border-radius:6px}
.submenu-toggle span{display:block;width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform .2s}
.menu-item-has-children.is-open>.submenu-toggle span{transform:translateY(2px) rotate(-135deg)}
.submenu-toggle:focus-visible{outline:3px solid var(--accent);outline-offset:1px}
.nav-cta{display:none}
.menu-toggle .icon-close{display:none}
.menu-toggle[aria-expanded="true"] .icon-open{display:none}
.menu-toggle[aria-expanded="true"] .icon-close{display:inline}
.menu-toggle span{display:inline-flex}

/* ==========================================================================
   Menu: desktop dropdowns (hover, keyboard and tap)
   ========================================================================== */
@media (min-width:1081px){
  .nav>ul>li.menu-item-has-children{display:flex;align-items:center;gap:2px}
  .submenu-toggle{display:inline-flex;width:22px;height:28px;color:var(--muted)}
  .nav .sub-menu{display:none;top:calc(100% + 14px);left:-18px;padding:8px 0;border-radius:10px;box-shadow:0 12px 32px rgba(15,20,25,.14)}
  /* Invisible bridge so the dropdown stays open while the mouse moves down to it. */
  .nav .sub-menu::before{content:"";position:absolute;left:0;right:0;top:-16px;height:16px}
  .nav li.is-open>.sub-menu,
  .nav li:focus-within>.sub-menu{display:flex}
  .nav .sub-menu a{padding:10px 18px;font-weight:500;line-height:1.35}
  .nav .sub-menu a:hover,.nav .sub-menu a:focus-visible{background:var(--bg);color:var(--accent)}
  .nav .sub-menu .current-menu-item>a{color:var(--accent)}
  .nav .sub-menu li+li{border-top:1px solid #f0f2f4}
}
@media (min-width:1081px) and (hover:hover){
  .nav li:hover>.sub-menu{display:flex}
}
@media (min-width:1081px){
  /* Escape closes a dropdown even while its link keeps keyboard focus. */
  .nav li.is-closed>.sub-menu{display:none!important}
}

/* ==========================================================================
   Menu: phone and tablet panel
   ========================================================================== */
@media (max-width:1080px){
  .menu-toggle{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;padding:0;border-radius:8px}
  .menu-toggle:focus-visible{outline:3px solid var(--accent)}
  .nav{display:none;position:fixed;left:0;right:0;top:var(--nav-top,76px);bottom:0;z-index:49;background:#fff;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;border-top:1px solid var(--line);padding:0 0 calc(28px + env(safe-area-inset-bottom,0px))}
  .nav.open{display:block}
  .nav>ul{display:block;max-width:var(--max);margin:0 auto}
  .nav li{display:grid;grid-template-columns:1fr auto;align-items:stretch;border-bottom:1px solid var(--line)}
  .nav li>a{display:flex;align-items:center;min-height:54px;padding:0 20px;font-size:1.02rem;font-weight:600;border:0}
  .nav li.menu-item-has-children>.submenu-toggle{display:inline-flex;width:58px;border-left:1px solid var(--line);border-radius:0;color:var(--ink-2)}
  .nav li.is-open>.submenu-toggle{color:var(--accent);background:var(--bg)}
  .nav .sub-menu{display:none;grid-column:1/-1;position:static;border:0;border-radius:0;box-shadow:none;padding:0;min-width:0;background:var(--bg)}
  .nav li.is-open>.sub-menu{display:block}
  .nav .sub-menu li{display:block;border-bottom:1px solid #e9ecef}
  .nav .sub-menu li:last-child{border-bottom:0}
  .nav .sub-menu a{min-height:48px;padding:0 20px 0 34px;font-size:.95rem;font-weight:500;color:var(--ink-2)}
  .nav .sub-menu li:first-child a{font-weight:700}
  .nav .sub-menu .current-menu-item>a{color:var(--accent)}
  .nav-cta{display:grid;gap:10px;max-width:var(--max);margin:22px auto 0;padding:0 20px}
  .nav-cta .btn{padding:15px}
  .nav-cta-phone{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;text-decoration:none;font-weight:600;color:var(--ink-2)}
  .nav-cta-phone .apex-icon{width:18px;height:18px;color:var(--accent)}
  .nav-cta-hours{text-align:center;color:var(--muted);font-size:.85rem;margin:0}
  body.menu-open{overflow:hidden}
  body.menu-open .wa-float,body.menu-open .mobile-actions{display:none}
}

/* ==========================================================================
   Phone action bar (Call, WhatsApp, Get a Quote)
   ========================================================================== */
.mobile-actions{display:none}
@media (max-width:768px){
  .mobile-actions{display:grid;grid-template-columns:1fr 1fr 1.25fr;position:fixed;left:0;right:0;bottom:0;z-index:70;background:#fff;border-top:1px solid var(--line);box-shadow:0 -4px 18px rgba(15,20,25,.08);padding-bottom:env(safe-area-inset-bottom,0px)}
  .mobile-actions a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:60px;text-decoration:none;font-size:.74rem;font-weight:700;color:var(--ink-2);letter-spacing:.02em}
  .mobile-actions a+a{border-left:1px solid var(--line)}
  .mobile-actions .apex-icon{width:22px;height:22px}
  .mobile-actions .is-wa .apex-icon{color:var(--wa)}
  .mobile-actions .is-quote{background:var(--accent-dark);color:#fff}
  body{padding-bottom:calc(60px + env(safe-area-inset-bottom,0px))}
  .wa-float{display:none}
}

/* ==========================================================================
   Tablet and phone layout
   ========================================================================== */
@media (max-width:900px){
  /* 16px text in form fields stops iPhones zooming in when a field is tapped. */
  input,select,textarea,
  .form input,.form select,.form textarea,
  .woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea,.woocommerce form .form-row select,
  .woocommerce .quantity .qty,.shop-filters .woocommerce-product-search input[type=search],
  .woocommerce table.cart td.actions .coupon .input-text,.select2-container .select2-selection__rendered{font-size:16px!important}
}

@media (max-width:600px){
  .container{padding-left:16px;padding-right:16px}
  .topbar{display:none}
  .site-header .container{height:64px;gap:10px}
  .apex-logo-svg{height:38px}
  .custom-logo{max-height:44px}
  .header-actions{gap:4px}
  .cart-btn{width:46px;height:46px;align-items:center;justify-content:center;padding:0}

  h1{font-size:2.1rem}
  h2{font-size:1.75rem}
  h3{font-size:1.2rem}
  .section{padding:48px 0}
  .section--compact{padding:36px 0}
  .lead{font-size:1rem}
  .eyebrow{font-size:.72rem;margin-bottom:8px}
  .section-grid,.cat-grid{margin-top:24px}
  .section-cta{margin-top:24px}
  .section-cta .btn{width:100%}

  /* Hero */
  .hero{padding:44px 0 40px}
  .hero h1{font-size:2.2rem}
  .hero p{font-size:1rem}
  .hero-ctas{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:22px 0 24px}
  .hero-ctas .btn{padding:14px 10px;font-size:.92rem}
  .hero-ctas .btn-wa{grid-column:1/-1}
  .hero-points{flex-direction:column;gap:8px;font-size:.9rem}

  /* Trust strip: 2 x 2 */
  .trust .container{grid-template-columns:1fr 1fr;gap:14px 12px;padding-top:16px;padding-bottom:16px}
  .trust div{font-size:.78rem;gap:8px}
  .trust .apex-icon{width:24px;height:24px}

  /* Category cards: 2 columns */
  .cat-grid{grid-template-columns:1fr 1fr;gap:12px}
  .cat-card .cat-img{aspect-ratio:4/3}
  .cat-card .cat-img img{height:72px}
  .cat-card .cat-body{padding:12px 12px 14px}
  .cat-card h3,.cat-card h2{font-size:1.02rem;margin-bottom:6px}
  .cat-card p{font-size:.78rem;line-height:1.45;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .cat-card .more{font-size:.8rem}

  /* Card lists become swipeable rows (the next card peeks in to show there is more). */
  .section-grid:not(.steps){display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:12px;margin-left:-16px;margin-right:-16px;padding:4px 16px 14px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .section-grid:not(.steps)::-webkit-scrollbar{display:none}
  .section-grid:not(.steps)>*{flex:0 0 82%;scroll-snap-align:start}
  .card{padding:20px}
  .card .icon{width:44px;height:44px;margin-bottom:12px}

  /* Steps: 2 x 2 */
  .steps{grid-template-columns:1fr 1fr!important;gap:18px 14px}
  .step{padding-top:44px}
  .step::before{font-size:2rem}
  .step h3{font-size:1.05rem}
  .step p{font-size:.86rem}

  /* Split sections */
  .split{gap:26px}
  .split-visual{padding:20px;border-radius:12px}
  .split-visual .apex-illustration{max-height:150px}
  .split-visual .apex-photo{width:calc(100% + 40px);margin:-20px -20px 0}
  .split-visual .apex-photo:last-child{margin-bottom:-20px}
  .split-visual p{font-size:.9rem;margin-top:14px}
  .checklist li{font-size:.95rem;margin-bottom:10px}
  .btn-row{flex-direction:column}
  .btn-row .btn{width:100%}

  /* FAQ */
  .faq details{padding:14px 0}
  .faq summary{font-size:.98rem}

  /* CTA band */
  .cta-band{padding:26px 20px;border-radius:14px;gap:18px}
  .cta-band h2{font-size:1.6rem}
  .cta-band>.btn,.cta-band .btn-row{width:100%}
  .cta-band .btn{width:100%}

  /* Inner page title band */
  .page-hero{padding:32px 0 28px}
  .page-hero h1{font-size:1.9rem}
  .page-hero p{font-size:.98rem}
  .breadcrumb{font-size:.78rem;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  /* Forms and contact */
  .form-card{padding:20px;border-radius:12px}
  .contact-card{padding:22px}
  .map{height:280px;margin-top:28px}
  .landing-photo{margin-bottom:22px}
  .aside-card{padding:20px}

  /* Footer */
  .site-footer{padding-top:44px}
  .footer-grid{grid-template-columns:1fr 1fr;gap:28px 16px}
  .footer-grid>.footer-about,.footer-grid>div:last-child{grid-column:1/-1}
  .site-footer li{margin-bottom:0}
  .site-footer li a{display:inline-block;padding:7px 0}
  .footer-bottom{flex-direction:column;margin-top:30px;padding:18px 0;font-size:.8rem}

  /* ---------------- WooCommerce on phones ---------------- */
  .shop-layout{gap:18px}
  .shop-filters{padding:14px;border-radius:12px}
  .shop-filters h4{display:none}
  .shop-filters .woocommerce-product-search{margin-bottom:12px}
  .shop-cats{display:flex;gap:8px;overflow-x:auto;margin:0 -14px;padding:0 14px 2px;scrollbar-width:none}
  .shop-cats::-webkit-scrollbar{display:none}
  .shop-cats li{flex:0 0 auto}
  .shop-cats a{white-space:nowrap;background:#fff;border:1px solid var(--line);border-radius:999px;padding:9px 14px;font-size:.86rem}
  .shop-cats a span{display:none}
  .shop-help{display:none}
  .woocommerce .woocommerce-result-count,.woocommerce .woocommerce-ordering{float:none;margin:0 0 12px;font-size:.85rem}
  .woocommerce .woocommerce-ordering select{width:100%}

  .woocommerce ul.products,.woocommerce-page ul.products,.woocommerce ul.products.columns-4{grid-template-columns:1fr 1fr!important;gap:12px}
  .woocommerce ul.products li.product{padding-bottom:12px}
  .woocommerce ul.products li.product a img{margin-bottom:10px}
  .woocommerce ul.products li.product a img.apex-illustration{padding:14px}
  .woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:.86rem;padding:0 10px;line-height:1.3}
  .woocommerce ul.products li.product .price{font-size:1.2rem;padding:0 10px;margin-bottom:10px}
  .apex-price-note{display:block;font-size:.7rem}
  .woocommerce ul.products li.product .button,.woocommerce ul.products li.product .added_to_cart{margin:0 10px 6px;padding:10px 6px;font-size:.78rem}
  .woocommerce ul.products li.product .apex-wa-button .apex-icon{width:15px;height:15px}
  .apex-badge,.woocommerce ul.products li.product .onsale{top:8px;left:8px;font-size:.62rem;padding:3px 7px}
  .home-products{margin-top:24px}

  .apex-woo--product{padding-top:20px}
  .woocommerce div.product{gap:20px}
  .woocommerce div.product .product_title{font-size:1.65rem}
  .woocommerce div.product p.price,.woocommerce div.product span.price{font-size:1.8rem;margin-bottom:10px}
  .woocommerce div.product form.cart .button{min-width:0}
  .apex-single-illustration{padding:24px}
  .apex-single-illustration img{max-height:220px}
  .woocommerce div.product .woocommerce-tabs ul.tabs{flex-wrap:nowrap;overflow-x:auto}
  .woocommerce div.product .woocommerce-tabs ul.tabs li a{padding:10px 12px;white-space:nowrap}
  .woocommerce div.product .related>h2,.woocommerce div.product .upsells>h2{font-size:1.5rem}

  .woocommerce table.cart td.actions .coupon{display:flex;flex-direction:column;gap:8px;float:none}
  .woocommerce table.cart td.actions .coupon .input-text{width:100%}
  .woocommerce table.cart td.actions .button{width:100%}
  .woocommerce-cart .cart-collaterals .cart_totals{padding:18px}
  .woocommerce-checkout #payment{border-radius:10px}
}

@media (max-width:360px){
  h1,.hero h1{font-size:1.85rem}
  .hero-ctas{grid-template-columns:1fr}
  .woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:.8rem}
  .mobile-actions a{font-size:.75rem}
}

@media (prefers-reduced-motion:reduce){
  .submenu-toggle span{transition:none}
  .section-grid{scroll-behavior:auto}
}

/* Editable photos on phones */
@media (max-width:600px){
  .page-hero--photo{padding:44px 0 36px}
  .card--media>*:not(.card-media){margin-left:16px;margin-right:16px}
  .card--media>h3{margin-top:14px}
  .card--media>*:last-child{margin-bottom:16px}
  .contact-card-media{margin:-22px -22px 18px}
  .page-photo{margin-bottom:20px;border-radius:12px}
  .trust .trust-img{width:24px;height:24px}
}

/* Reviews on phones: homepage cards swipe like the other card rows */
@media (max-width:600px){
  .review-card{padding:20px}
  .review-grid--home.section-grid{display:flex}
  .review-grid--home .review-card{flex:0 0 86%}
}

/* 1.7.0: ten categories and the brand strip on phones */
@media (max-width:600px){
  .grid-5{grid-template-columns:1fr 1fr}
  .brands{padding:52px 0 40px}
  .brand-rows{gap:12px;margin-top:26px}
  .brand-strip{gap:12px;padding-right:12px}
  .brand-chip{min-width:150px;height:58px;padding:0 18px;border-radius:12px}
  .brand-name{font-size:1.1rem}
  .brand-dot{width:8px;height:8px}
  .brand--logo img{max-height:34px;max-width:110px}
  .btn-row--grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .btn-row--grid .btn{width:100%;padding-left:8px;padding-right:8px}
}

/* 1.7.2: phone polish. Every tap target at least 44px, nothing under 11px. */
@media (max-width:600px){
  .faq summary{min-height:44px;align-items:center;padding:6px 0}
  .faq details{padding:8px 0}
  .checks{gap:8px}
  .checks label{min-height:46px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;font-size:.95rem}
  .checks label:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
  .checks input,.woocommerce-form__input-checkbox,#apex-review-form input[type=checkbox]{width:20px;height:20px;flex:none;accent-color:var(--accent)}
  .woocommerce-form__label-for-checkbox{display:flex;align-items:center;gap:10px;min-height:44px}
  .woocommerce-pagination .page-numbers a,.woocommerce-pagination .page-numbers span,nav.woocommerce-pagination ul li a,nav.woocommerce-pagination ul li span{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  .card .more,.cat-card .more,.post-card .more{display:inline-flex;align-items:center;min-height:44px}
  .card--link h3 a{display:inline-block;padding:8px 0}
  .post-card h3 a{display:inline-block;padding:6px 0}
  .woocommerce a.remove,.woocommerce-cart a.remove{width:40px;height:40px;line-height:38px;font-size:1.6rem}
  .shipping-calculator-button{display:inline-flex;align-items:center;min-height:44px}
  .woocommerce-cart-form .product-name a{display:inline-block;padding:8px 0}
  .product_meta a{display:inline-block;padding:8px 2px}
  .contact-item a,.aside-list a,.side-card a[href^="tel"],.quote-aside a[href^="tel"]{display:inline-block;padding:10px 0}
  .site-footer .menu a{display:inline-block;padding:8px 0;min-width:44px}
  .apex-badge{font-size:.72rem;padding:5px 9px}
  .woocommerce nav.woocommerce-pagination ul li a,.woocommerce nav.woocommerce-pagination ul li span,.pagination .page-numbers{min-width:44px;min-height:44px;padding:0 10px;display:inline-flex;align-items:center;justify-content:center}
  .review-form .consent{display:flex;gap:10px;align-items:flex-start;padding:6px 0}
  .review-form .consent input{width:20px;height:20px;flex:none;margin-top:2px;accent-color:var(--accent)}
  .h-card a{display:inline-block;padding:8px 0}
  .mobile-actions a{font-size:.78rem}
  /* Brand band: same colors and motion, lighter on the phone's processor. */
  .brand-chip::before{animation:none;background:linear-gradient(135deg,var(--c),transparent 55%,var(--c))}
  .brands-glow{animation:none}
  .brand-track{will-change:transform}
}
/* Stop the brand animation while it is off screen (saves battery). */
.brands.is-offscreen .brand-track,.brands.is-offscreen .brand-chip::before,.brands.is-offscreen .brand-name,.brands.is-offscreen .brand-dot,.brands.is-offscreen .brands-glow{animation-play-state:paused}
@media (max-width:600px){
  .cat-card--text .cat-body{padding:14px 12px}
  .cat-card--text .cat-count{font-size:.72rem;margin-bottom:10px}
  .cat-card--text h3{font-size:1.15rem}
}
@media (max-width:760px){
  .split--solo .checklist{columns:1}
}
@media (max-width:600px){
  .promise-list li{padding:16px 14px 16px 62px}
  .promise-list li::before{left:12px;width:36px;height:36px;font-size:1.1rem}
}
