/* EduFunny — mobile layer (≤ 640px, tuned for 360 / 390 / 430).
 * Loaded LAST on every page (functions.php → edufunny_mobile_assets) so it
 * only overrides the phone layout; desktop/tablet rules in the other
 * stylesheets are untouched. Goals: zero horizontal scroll, compact spacing,
 * ≥ 44px touch targets, readable type, 16px gutters. */

@media (max-width: 640px) {

	/* ------------------------------------------------------------------
	 * 0. GLOBAL
	 * ---------------------------------------------------------------- */
	body { font-size: 16px; line-height: 1.55; }
	:root { --ef-space-section: 2.2rem; }
	.ef-container { padding-inline: 16px; width: 100%; max-width: 100%; }
	.ef-section { padding-block: 2.2rem; }
	.ef-section-header { margin-bottom: 1.1rem; }
	.ef-section-header__title { font-size: 1.55rem; line-height: 1.2; }
	.ef-section-header__intro { font-size: 0.98rem; }
	.ef-eyebrow { font-size: 0.72rem; }
	h1 { font-size: 1.85rem; line-height: 1.15; }
	h2 { font-size: 1.5rem; line-height: 1.2; }
	h3 { font-size: 1.15rem; }
	p { margin-bottom: 0.85rem; }


	/* Buttons: comfortable, no accidental wraps (action groups already stack via main.css/kids.css). */
	.ef-btn { min-height: 46px; padding: 0.65rem 1.1rem; font-size: 0.95rem; }
	.ef-kids-hero__actions, .ef-kids-cta__actions, .ef-eduf-hero__actions, .ef-eduf-cta__actions, .ef-journal-article__cta-actions { gap: 0.55rem; }
	/* Decorative layers keep their design; the one glow that reached past the viewport (Kids programmes,
	 * right: -110px) is re-anchored inside the screen instead of being clipped. */
	.ef-programs-decor--b { right: 0; width: 240px; height: 240px; }
	.ef-programs-decor--a { left: 0; width: 220px; height: 220px; }



	/* ------------------------------------------------------------------
	 * 1. HEADER + MENU
	 * ---------------------------------------------------------------- */
	.ef-header { padding: 0.45rem 0; }
	.ef-header__inner { padding: 0.3rem 0.5rem 0.3rem 0.8rem; gap: 0.45rem; }
	.ef-brand__link { min-height: 44px; gap: 0.45rem; }
	.ef-brand__name { font-size: 1.02rem; }
	.ef-header__actions { gap: 0.4rem; }
	.ef-burger, .ef-cart { width: 44px; height: 44px; border-radius: 12px; }
	.ef-cart .ef-icon { width: 20px; height: 20px; }
	.ef-cart__count { top: -5px; right: -5px; min-width: 20px; height: 20px; font-size: 0.72rem; }
	.ef-nav { left: 12px; right: 12px; top: calc(100% + 6px); padding: 0.5rem; border-radius: 20px; }
	.ef-nav__list { gap: 0; }
	.ef-nav__link { padding: 0.8rem 0.9rem; min-height: 48px; font-size: 1rem; border-radius: 12px; }

	/* ------------------------------------------------------------------
	 * 2. HOME (hub)
	 * ---------------------------------------------------------------- */
	.ef-hero { padding-block: 0.6rem 0; }
	.ef-hero__card { border-radius: 18px; margin-inline: 0; width: 100%; }
	.ef-brand-intro { padding-block: 1.4rem 0.6rem; }
	.ef-brand-intro__logo { width: 72px; }

	.ef-brand-intro__line { font-size: 0.95rem; }
	.ef-worlds, .ef-ecosystem { padding-block: 1.8rem; }
	.ef-trust { padding-block: 0 2rem; }
	.ef-worlds__grid, .ef-ecosystem__grid { gap: 0.8rem; }
	.ef-card { padding: 1.15rem 1.1rem; border-radius: 22px; }
	.ef-card__title { font-size: 1.3rem; margin-bottom: 0.35rem; }
	.ef-card__eyebrow { font-size: 0.72rem; }
	.ef-card p { font-size: 0.95rem; }
	.ef-preview { padding: 1rem 1.05rem; border-radius: 20px; }
	.ef-preview__title { font-size: 1.1rem; }
	.ef-preview__text { font-size: 0.92rem; }
	.ef-trust__panel { padding: 1.2rem 1.1rem; border-radius: 22px; }
	.ef-trust__title { font-size: 1.3rem; }
	.ef-pills { gap: 0.5rem; }                     /* stays one column (main.css) — two columns wrapped the labels */
	.ef-pill { padding: 0.55rem 0.8rem; font-size: 0.9rem; min-height: 44px; }

	/* ------------------------------------------------------------------
	 * 3. WORLD PAGES (Kids / EduFunny / articles / contact)
	 * ---------------------------------------------------------------- */
	.ef-kids-hero, .ef-eduf-hero { padding-block: 1.8rem 1.6rem; }
	.ef-kids-hero__title, .ef-eduf-hero__title { font-size: 1.7rem; line-height: 1.18; }
	.ef-kids-hero__subtitle, .ef-eduf-hero__text { font-size: 0.98rem; }

	.ef-kids-blog__grid, .ef-eduf-blog__grid, .ef-eduf-steps__grid, .ef-eduf-values__grid,
	.ef-kids-services__grid, .ef-eduf-consult__grid { gap: 0.75rem; }
	.ef-kids-blogcard, .ef-eduf-post, .ef-eduf-consultcard, .ef-kids-about__panel, .ef-kids-cta__panel,
	.ef-eduf-cta__panel, .ef-eduf-intro__panel { padding: 1.1rem; border-radius: 20px; }
	.ef-kids-about__panel { gap: 0.8rem; }
	.ef-kids-programs .ef-progcat { margin-top: 1.4rem; }
	.ef-progcat__grid { grid-template-columns: repeat(3, 1fr) !important; gap: 0.6rem 0.5rem; }
	.ef-progcard { gap: 0.35rem; }
	.ef-progcard__media { max-width: 100% !important; border-radius: 14px; }
	.ef-progcard__name { font-size: 0.8rem; line-height: 1.2; }
	.ef-progcat__title { font-size: 1.2rem; }
	.ef-progcat__intro { font-size: 0.9rem; }
	.ef-kids-playzone__catgrid { grid-template-columns: 1fr 1fr !important; gap: 0.5rem; }
	.ef-kids-game__stage { aspect-ratio: 4 / 3; }
	.ef-contact__methods { gap: 0.7rem; }
	.ef-contact__method { padding: 1rem 0.8rem; }
	.ef-article-hero, .ef-journal-article__head { padding-block: 1.6rem 1rem; }
	.ef-article__title, .ef-journal-article__title { font-size: 1.6rem; }
	.ef-article__media, .ef-journal-article__media { aspect-ratio: 16 / 10; border-radius: 18px; }

	/* Generic page + legal documents. */
	.ef-page-content .ef-prose { padding: 1.1rem 1rem; border-radius: 20px; }
	.ef-legal p, .ef-legal li { font-size: 11pt; line-height: 1.55; }
	.ef-legal h2, .ef-legal h3 { font-size: 13pt; }
	.ef-legal__info th, .ef-legal__info td { padding: 0.4em 0.6em; font-size: 11pt; }

	/* ------------------------------------------------------------------
	 * 4. PRODUCTS PAGE
	 * ---------------------------------------------------------------- */
	.efp-hero { padding-block: 1.8rem 1.4rem; }
	.efp-hero__watermark { font-size: 4.4rem; right: 0; bottom: -0.22em; }   /* same engraved word, scaled to the phone hero */
	.efp-monogram { font-size: 0.58rem; letter-spacing: 0.14em; margin-bottom: 0.9rem; padding-bottom: 0.6rem; }   /* fits on one line at 360px */
	.efp-hero__title { font-size: 1.75rem; margin: 0.5rem 0 0.6rem; }
	.efp-hero__sub { font-size: 0.95rem; margin-bottom: 1.1rem; }
	.efp-btn { min-height: 44px; padding: 0.6rem 1rem; font-size: 0.9rem; }
	.efp-btn--lg { min-height: 48px; }
	.efp-cats__grid { grid-template-columns: 1fr 1fr !important; }
	.efp-cat { padding: 0.85rem 0.8rem; gap: 0.15rem; border-left: 0 !important; border-top: 1px solid var(--efp-line); }
	.efp-cat:nth-child(2n) { border-left: 1px solid var(--efp-line) !important; }
	.efp-cat:nth-child(-n+2) { border-top: 0; }
	.efp-cat__name { font-size: 0.92rem; }
	.efp-cat__desc { font-size: 0.78rem; line-height: 1.35; }
	.efp-cat__arrow { margin-top: 0.15rem; }
	.efp-spaces { padding: 1.6rem 0; }
	.efp-spaces__grid { grid-template-columns: 1fr 1fr !important; gap: 0.5rem; }
	.efp-spaces__item { border-radius: 12px; border-width: 2px; }
	.efp-section { padding-block: 1.8rem; }
	.efp-section__head { margin-bottom: 1rem; gap: 0.3rem; }
	.efp-gridhead h2 { font-size: 1.45rem; }
	.efp-gridhead p { font-size: 0.9rem; }
	.efp-grid, .efp-grid.efp-grid--ready { grid-template-columns: 1fr 1fr !important; gap: 0.6rem; }
	.efp-card { border-radius: 14px; }
	.efp-card:hover { transform: none; }
	.efp-product__media--contain { padding: 0.5rem; }
	.efp-card__body, .efp-grid--ready .efp-card__body { padding: 0.7rem 0.7rem 0.75rem; gap: 0.3rem; }
	.efp-product .efp-card__title, .efp-grid--ready .efp-card__title { font-size: 0.92rem; line-height: 1.25; }
	.efp-product .efp-card__desc { font-size: 0.78rem; line-height: 1.35; }
	.efp-product .efp-card__price, .efp-grid--ready .efp-card__price { font-size: 1rem; gap: 0.15rem 0.35rem; padding-top: 0.45rem; margin-top: 0.15rem; }
	.efp-product .efp-card__price span { font-size: 0.58rem; }
	.efp-card__price--ask a { font-size: 0.78rem; }
	.efp-card__actions { margin-top: 0.45rem; }
	.efp-card__actions .efp-btn { min-height: 42px; padding: 0.5rem 0.5rem; font-size: 0.8rem; }

	/* ------------------------------------------------------------------
	 * 5. CART
	 * ---------------------------------------------------------------- */
	.ef-shop--cart, .ef-shop--checkout { padding-top: 1.4rem; }
	.ef-shop__head { margin-bottom: 0.9rem; }
	.ef-shop__head .ef-section-header__title { font-size: 1.6rem; }
	.ef-cart-row { padding: 0.8rem; gap: 0.25rem 0.7rem; grid-template-columns: 72px 1fr auto; border-radius: 18px; margin-bottom: 0.7rem; }
	.ef-cart-row__media img { width: 72px; height: 72px; border-radius: 12px; }
	.ef-cart-row__name a { font-size: 0.98rem; }
	.ef-cart-row__price { font-size: 0.82rem; }
	.ef-qty { padding: 2px; }
	.ef-qty__btn { width: 40px; height: 40px; }
	.ef-qty__input { width: 38px; font-size: 0.95rem; }
	.ef-cart-remove { width: 40px; height: 40px; }
	.ef-cart-row__subtotal { font-size: 1rem; }
	.ef-cart-actions { gap: 0.5rem; }
	.ef-cart-coupon { width: 100%; margin: 0; flex-wrap: nowrap; }
	.ef-cart-coupon .input-text { flex: 1; min-width: 0; }
	.ef-cart-coupon .ef-btn { flex: none; white-space: nowrap; }
	.ef-cart-update { display: none; }               /* quantities auto-update (shop.js) */
	.ef-cart-continue { width: 100%; }
	.ef-cart-collaterals { margin-top: 0.9rem; }
	.ef-cart-totals { padding: 1rem; border-radius: 20px; }
	.ef-cart-totals__title { font-size: 1.1rem; margin-bottom: 0.5rem; }
	.ef-cart-totals__table th { white-space: nowrap; padding-right: 0.8rem; font-size: 0.92rem; }
	.ef-cart-totals__table td { font-size: 0.98rem; }
	.ef-cart-totals__total th, .ef-cart-totals__total td { font-size: 1.15rem; }
	.ef-cart-totals .woocommerce-shipping-methods li { font-size: 0.86rem; line-height: 1.35; }
	.ef-cart-totals .woocommerce-shipping-destination { font-size: 0.75rem; }
	.ef-cart-empty { padding: 1.6rem 1.1rem; border-radius: 22px; }

	/* ------------------------------------------------------------------
	 * 6. CHECKOUT
	 * ---------------------------------------------------------------- */
	.ef-checkout-steps { gap: 0.35rem; margin-top: 0.6rem; }
	.ef-checkout-steps li { padding: 0.3rem 0.65rem; font-size: 0.76rem; }
	.ef-checkout__layout { gap: 0.9rem; }
	.ef-checkout__card { padding: 1rem 0.9rem; border-radius: 20px; }
	.ef-checkout__details { gap: 0.9rem; }
	.ef-checkout__title { font-size: 1.05rem; margin-bottom: 0.7rem; gap: 0.5rem; }
	.ef-checkout__step { width: 26px; height: 26px; font-size: 0.75rem; }
	.ef-checkout__hint { margin: -0.3rem 0 0.7rem 0; font-size: 0.8rem; }
	.ef-checkout__section + .ef-checkout__section { margin-top: 1.1rem; padding-top: 1rem; }
	/* Two short fields per row keep the form compact even at 360px. */
	.ef-checkout .woocommerce-billing-fields__field-wrapper,
	.ef-checkout .woocommerce-shipping-fields__field-wrapper { grid-template-columns: 1fr 1fr !important; gap: 0 0.6rem; }
	.ef-checkout .form-row { margin-bottom: 0.7rem; }
	.ef-checkout .form-row-wide, .ef-checkout #billing_email_field, .ef-checkout #billing_phone_field,
	.ef-checkout #billing_company_field { grid-column: 1 / -1; }
	.ef-checkout .form-row label { font-size: 0.8rem; margin-bottom: 0.25rem; }
	.ef-checkout .input-text, .ef-checkout select, .ef-checkout textarea,
	.ef-checkout .select2-container .select2-selection--single { min-height: 46px; padding: 0.55rem 0.8rem; border-radius: 13px; font-size: 16px; /* prevents iOS zoom */ }
	.ef-checkout textarea { min-height: 88px; }
	.ef-invoice-type .woocommerce-input-wrapper { flex-direction: row !important; gap: 0.5rem; }
	.ef-invoice-type .woocommerce-input-wrapper > label.radio { padding: 0.6rem 0.7rem; font-size: 0.88rem; gap: 0.45rem; min-height: 46px; }
	.ef-checkout__summary .ef-checkout__title { font-size: 1.05rem; }
	.ef-review td, .ef-review th { padding: 0.5rem 0; }
	.ef-review__thumb img { width: 44px; height: 44px; border-radius: 10px; }
	.ef-review__product { gap: 0.55rem; }
	.ef-review__name { font-size: 0.88rem; }
	.ef-review__qty { font-size: 0.76rem; }
	.ef-review td.product-total, .ef-review tfoot td { font-size: 0.95rem; }
	.ef-review tfoot th { font-size: 0.9rem; }
	.ef-review tfoot .woocommerce-shipping-methods label { font-size: 0.84rem; }
	.ef-review__total th, .ef-review__total td { font-size: 1.1rem; padding-top: 0.7rem; }
	.ef-payment { margin-top: 0.9rem; padding-top: 0.8rem; }
	.ef-payment__title { font-size: 1rem; }
	.ef-payment__methods li.wc_payment_method > label { padding: 0.7rem 0.8rem; font-size: 0.9rem; min-height: 46px; }
	.ef-terms { margin: 0.4rem 0 0.8rem; }
	.ef-terms__row { margin-bottom: 0.5rem; }
	.ef-terms__row label { font-size: 0.83rem; line-height: 1.4; }
	.ef-check input[type="checkbox"] { width: 22px; height: 22px; }
	.ef-place-order__btn { min-height: 52px; font-size: 1rem; }
	.ef-place-order__secure { font-size: 0.72rem; }
	.ef-checkout .woocommerce-error, .ef-checkout .woocommerce-info, .ef-checkout .woocommerce-message { padding: 0.75rem 0.9rem; font-size: 0.86rem; border-radius: 14px; }

	/* ------------------------------------------------------------------
	 * 7. FOOTER
	 * ---------------------------------------------------------------- */
	.ef-footer { padding-block: 1.4rem 1.2rem; }
	.ef-footer__inner { padding: 1rem 0.9rem; gap: 0.7rem; border-radius: 20px; }
	.ef-footer__nav { gap: 0.4rem; width: 100%; }
	.ef-footer__list { justify-content: center; gap: 0.2rem 0.4rem; }
	.ef-footer__list a { display: inline-block; padding: 0.55rem 0.55rem; min-height: 44px; line-height: 1.3; font-size: 0.9rem; }
	.ef-footer__legal { font-size: 0.8rem; padding-top: 0.4rem; }
	.ef-footer__legal a { padding: 0.35rem 0.45rem; min-height: 36px; }
	.ef-footer__social { justify-content: center; gap: 0.4rem 0.8rem; }
	.ef-footer__social a { min-height: 44px; padding: 0.4rem 0.3rem; }
	.ef-footer__copy { font-size: 0.8rem; }
}

/* Narrow phones (≤ 360px): a touch tighter. */
@media (max-width: 360px) {
	.ef-brand__name { font-size: 0.98rem; }
	.efp-grid, .efp-grid.efp-grid--ready { gap: 0.45rem; }
	.efp-card__actions .efp-btn { font-size: 0.74rem; padding-inline: 0.35rem; }
	.efp-product .efp-card__price, .efp-grid--ready .efp-card__price { font-size: 0.95rem; }
	.ef-progcat__grid { gap: 0.45rem 0.35rem; }
	.ef-cart-row { grid-template-columns: 64px 1fr auto; }
	.ef-cart-row__media img { width: 64px; height: 64px; }
	.ef-checkout .woocommerce-billing-fields__field-wrapper #billing_postcode_field,
	.ef-checkout .woocommerce-shipping-fields__field-wrapper #shipping_postcode_field { grid-column: 1 / -1; }
}
