/**
 * Responsive overrides. Breakpoints:
 *   1440px+  — wide desktop (container caps out, nothing special needed)
 *   1024–1439px — laptop (default desktop layout, defined in component files)
 *   768–1023px — tablet (denser grids, sidebar filters collapse to a bar)
 *   481–767px  — mobile (bottom nav, off-canvas menu, single column, sticky PDP CTA)
 *   ≤480px     — small mobile (tighter type/spacing, 2-col product grid)
 *
 * Mobile is reworked per-component, not a blanket transform: scale().
 */

/* ---------- Tablet (≤1023px) ---------- */
@media (max-width: 1023px) {
	.apc-needs-grid { grid-template-columns: repeat(4, 1fr); }
	.apc-category-grid { grid-template-columns: repeat(2, 1fr); }
	.apc-product-grid { grid-template-columns: repeat(3, 1fr); }
	.apc-product-grid--4col { grid-template-columns: repeat(3, 1fr); }
	.apc-offers-grid { grid-template-columns: 1fr 1fr; }
	.apc-whyus-grid { grid-template-columns: repeat(3, 1fr); }
	.apc-testimonial-grid { grid-template-columns: repeat(2, 1fr); }
	.apc-footer__grid { grid-template-columns: 1fr 1fr 1fr; }
	.apc-shop__layout { grid-template-columns: 1fr; }
	.apc-filters { display: none; }
	.apc-mobile-filter-bar { display: flex; }
	.apc-shop__skeleton-grid { grid-template-columns: repeat(3, 1fr); }
	.apc-pdp__grid { grid-template-columns: 1fr; }
	.apc-cart-layout { grid-template-columns: 1fr; }
	.apc-account-layout { grid-template-columns: 1fr !important; }
	.apc-contact-grid { grid-template-columns: 1fr; }
	.apc-blog-grid { grid-template-columns: repeat(2, 1fr); }
	.apc-hero__title { font-size: 42px; }
}

/* ---------- Mobile (≤767px) ---------- */
@media (max-width: 767px) {
	.apc-topbar__right span:not(:first-child) { display: none; }
	.apc-header__main { flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
	.apc-header__search { order: 3; max-width: 100%; flex-basis: 100%; }
	.apc-header__actions { gap: 14px; }
	.apc-header__actions .apc-header__action .apc-action-label { display: none; }
	.apc-rx-cta span:not(.apc-rx-cta__icon-only) { display: none; }
	.apc-rx-cta { padding: 11px; border-radius: 999px; }
	.apc-primary-nav { display: none; }
	.apc-mobile-nav-toggle { display: inline-flex; }

	.apc-hero { padding: 40px 16px 56px; }
	.apc-hero__inner { flex-direction: column; gap: 32px; text-align: center; }
	.apc-hero__content { max-width: 100%; }
	.apc-hero__title { font-size: 32px; }
	.apc-hero__ctas { justify-content: center; }
	.apc-hero__ctas .apc-btn { flex: 1; min-width: 140px; }
	.apc-hero__float { display: none; }
	.apc-hero__media-placeholder, .apc-hero__media img { width: 100%; height: 240px; }

	.apc-section { padding: 36px 16px 6px; }
	.apc-needs-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
	.apc-category-grid { grid-template-columns: 1fr; }
	.apc-product-grid, .apc-product-grid--4col, .apc-product-grid--3col { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.apc-offers-grid { grid-template-columns: 1fr; }
	.apc-whyus-grid { grid-template-columns: repeat(2, 1fr); }
	.apc-testimonial-grid { grid-template-columns: 1fr; }
	.apc-mobile-bottom-nav { display: flex; }
	.apc-brand-grid { gap: 10px; }
	.apc-brand-chip { min-width: 46%; padding: 14px; }
	.apc-rx-band { padding: 28px 20px; gap: 28px; }
	.apc-rx-band__steps { grid-template-columns: 1fr 1fr; }
	.apc-newsletter { flex-direction: column; align-items: stretch; text-align: center; }
	.apc-newsletter__form { justify-content: center; }
	.apc-newsletter__form input[type="email"] { width: 100%; }

	.apc-footer__grid { grid-template-columns: 1fr 1fr; padding: 36px 16px 20px; }
	.apc-footer__bottom { flex-direction: column; text-align: center; }
	body.apnipharmacy.apc-has-bottom-nav { padding-bottom: 62px; }

	.apc-shop { padding: 16px 16px 70px; }
	.apc-shop__skeleton-grid { grid-template-columns: repeat(2, 1fr); }

	.apc-pdp { padding: 16px 16px 96px; }
	.apc-pdp__gallery-main { height: 300px; }
	.apc-pdp__title { font-size: 21px; }
	.apc-pdp__cta-row { display: none; } /* replaced by sticky mobile CTA */
	.apc-pdp__mobile-cta { display: flex; }
	.apc-pdp__related .apc-product-grid { grid-template-columns: repeat(2, 1fr); }

	.apc-cart-row { position: relative; padding-right: 30px; }
	.apc-cart-row__remove { position: absolute; top: 18px; right: 0; }
	.apc-cart-row__total { width: auto; text-align: left; }

	.apc-checkout-step__line { width: 32px; margin: 0 4px; }
	.apc-checkout-step__label { font-size: 10px; }

	.apc-blog-grid { grid-template-columns: 1fr; }
	.apc-article__title { font-size: 24px; }
	.apc-contact-grid { gap: 24px; }

	.apc-mega-menu__panel { top: 0; left: 0; right: 0; transform: none; width: 100%; max-height: 100vh; border-radius: 0; grid-template-columns: 1fr; }
}

/* ---------- Small mobile (≤480px) ---------- */
@media (max-width: 480px) {
	.apc-hero__title { font-size: 27px; }
	.apc-needs-grid { grid-template-columns: repeat(2, 1fr); }
	.apc-whyus-grid { grid-template-columns: 1fr 1fr; }
	.apc-footer__grid { grid-template-columns: 1fr; }
	.apc-otp-row input { width: 38px; height: 44px; font-size: 16px; }
	.apc-rx-upload-tiles { grid-template-columns: 1fr; }
}

/* Utility: hide/show helpers used by templates for device-specific chrome */
.apc-desktop-only { display: initial; }
.apc-mobile-only { display: none; }
@media (max-width: 767px) {
	.apc-desktop-only { display: none !important; }
	.apc-mobile-only { display: initial !important; }
}
