/*
Theme Name:     Sportfy Child Theme
Template:       sportfy
Theme URI:      http://radiustheme.com/demo/wordpress/themes/sportfy
Author:         RadiusTheme
Author URI:     http://radiustheme.com
Description:    Sportfy is an Responsive Sports Store WooCommerce WordPress Theme.
Version:        1.0.0
Tested up to: 	6.6
Requires PHP: 	7.4
Text Domain:    sportfy
Tags: 			blog, e-commerce, theme-options, featured-images, post-formats, grid-layout, one-column, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-header, editor-style, footer-widgets, full-width-template, rtl-language-support, sticky-post, style-variations, threaded-comments, translation-ready
License:   	  	Envato split License
License URI:  	https://themeforest.net/licenses/terms/regular
*/

/* ─── Fix 1.2a: Logo CLS ─────────────────────────────────────────────────────
   Logo img already has width/height attrs in HTML (300×90), so the browser
   already reserves space. This CSS is a fallback in case the attrs are removed
   and prevents overflow on narrow viewports.
   Validated: class .rt-site-logo confirmed on production (dark-logo / light-logo
   variants also inherit this). */
.rt-site-logo {
    width: 300px;
    height: 90px;
    aspect-ratio: 300 / 90;
    max-width: 100%;
}

/* ─── Fix 1.2b: Hero CLS — reserve height before video loads ─────────────────
   Production hero section: data-id="51b0c3e8", class="elementor-element-51b0c3e8"
   Uses e-con-full layout (no .e-con-inner wrapper — targets outer div directly).
   Hidden on mobile via elementor-hidden-mobile so min-height only applies desktop.
   CORRECTED from original plan: was [data-elementor-id="19365"] which is wrong
   attribute + wrong value; that ID does not exist on production. */
.elementor-element-51b0c3e8 {
    min-height: 100vh;
}

/* ─── Fix 1.2c: WooCommerce price placeholder CLS ────────────────────────────
   .wcpbc-placeholder animated dots reserve no space while loading, causing CLS.
   Validated: 78 occurrences on production homepage. */
.wcpbc-placeholder {
    display: inline-block;
    min-width: 60px;
    min-height: 1em;
}

/* ─── NOTE: visibility animation override removed ────────────────────────────
   Original plan included visibility:visible !important on .rtsb-grid-item etc.
   REMOVED: WOW.js scroll-reveal sets visibility:hidden as the initial hidden
   state before animating elements into view. Forcing visible:visible !important
   would disable all scroll-reveal animations site-wide — a UX regression.
   The non-composited animation jank (CLS audit item) is addressed separately
   in Fix 3.3 via will-change and keyframe replacements. */

/* ─── A-009: GPU-composited animation hints ──────────────────────────────────
   Lighthouse flags 129 elements using non-composited animations (background-position,
   visibility, width, etc.). Promote frequently-animated elements to their own
   compositor layer to reduce paint/layout cost.
   The gradient keyframes use background-position-x which can't be GPU-composited,
   but will-change at least isolates the repaint to this element's layer. */
.title-gradient-animation {
    will-change: background-position;
}
/* WOW.js / animate.css — elements animate opacity+transform on scroll.
   will-change: transform promotes them so the animation runs on compositor. */
.wow {
    will-change: transform, opacity;
}
/* Swiper slides re-layout on transition; promoting avoids full-page repaints. */
.swiper-slide {
    will-change: transform;
}

/* ─── F-004: font-display: swap for icon fonts ───────────────────────────────
   Prevents Flash of Invisible Text (FOIT) for FontAwesome, rt-fontello, and
   rtsb-font icon fonts. Lighthouse estimates up to 1,900 ms FCP improvement. */
@font-face { font-family: 'FontAwesome'; font-display: swap; }
@font-face { font-family: 'rt-fontello'; font-display: swap; }
@font-face { font-family: 'rtsb-font'; font-display: swap; }

/* ─── G-004: Neutralize theme h1 base styles inside Elementor rt-title widget ─
   Theme sets h1 { font-size: 44px; line-height: 54px } vs h2 { 36px / 42px }.
   Elementor overrides these with inline CSS, but to avoid any flash or specificity
   leak, we explicitly reset h1 inside rt-title widgets to inherit from Elementor. */
.elementor-widget-rt-title h1 {
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
}
/* ─── Trustindex Google Reviews widget: center cards + side padding ───────────
   The Trustindex slider widget (ti-col-6) left-aligns review cards by default.
   Centers the flex row and adds horizontal padding for breathing room on all
   viewports. Applied globally — widget appears on "our story" pages (all langs). */
.ti-widget .ti-reviews-container-wrapper {
    display: flex;
    justify-content: center;
}
.ti-widget .ti-widget-container.ti-col-6 {
    padding: 0 2rem;
}

/* ─── Fix: static Our Story counter (replaces Odometer animation) ───
   The .rtsb-count-number element ID is preserved across all 6+ language
   variants of the Our Story page (Polylang Duplicate Content), so this
   single rule covers ES/EN/CA/FR/IT/DE/AR. Replaces the buggy 0→100
   animation that intermittently leaves users staring at "000". */
.elementor-element-12c8ed9 .rtsb-count-number {
    color: transparent !important;
    position: relative;
}
.elementor-element-12c8ed9 .rtsb-count-number::before {
    content: "100";
    color: #000;        /* match original counter color (dark on accent bg) */
    font: inherit;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* ─── Day-1 fix: homepage duplicate hero H1 (SEO §7.3) ───────────────────────
   Elementor renders two hero containers on the homepage — a desktop one
   (.elementor-element-51b0c3e8, class elementor-hidden-mobile) and a mobile
   one (.elementor-element-ee3cfd2, class elementor-hidden-desktop). Each
   contains an identical <h1>, so the DOM has two h1s. Elementor's own
   hidden-mobile/-desktop classes already display:none the inactive container
   at each breakpoint, BUT the duplicate <h1> still appears in the rendered
   markup that crawlers parse.
   This rule additionally hides the inactive H1 from the accessibility tree at
   each breakpoint. The PROPER fix is in Elementor's template (one container
   with two backgrounds, OR move one hero's heading widget to a non-h1 tag) —
   tracked as a follow-up. Until then, this CSS keeps the duplicate from being
   double-read by screen readers and reduces tool flags.
   Verified selectors via curl + grep on rendered HTML 2026-05-13. */
@media (min-width: 768px) {
    /* Desktop: hide the mobile-only H1. */
    .home .elementor-element-ee3cfd2 h1.main-title { display: none !important; }
}
@media (max-width: 767px) {
    /* Mobile: hide the desktop-only H1. */
    .home .elementor-element-51b0c3e8 h1.main-title { display: none !important; }
}

/* ─── SEO §6.3 + §7.3: visible shop / category / tag archive H1 ──────────────
   The novafit_shop_h1() helper in functions.php prints <h1 class="nf-shop-h1">
   on /tienda/, /en/shop/, /ca/botiga/, every product-category and product-tag
   archive. Make it visible (was screen-reader-only) and style consistently with
   the site's existing typography. */
.nf-shop-h1 {
    display: block;
    margin: 0 0 24px;
    padding: 0 16px;
    font-family: inherit;
    font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
    line-height: 1.2;
    font-weight: 700;
    color: #1a1a1a;
    text-wrap: balance;
}
@media (min-width: 992px) {
    .nf-shop-h1 { margin-bottom: 32px; padding: 0; }
}

/* 2026-05-13: Contact page H1 (screen-reader-only — preserves existing
   Elementor design while emitting a single H1 for crawlers + accessibility). */
.nf-contact-h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── 2026-07-30: "FINALIZAR COMPRA" unreachable on mobile ───────────────────
   Client report (Sara, 2026-07-30): the checkout button is cut off at the
   bottom of the screen on mobile. Reproduced with Chromium against production
   at iPhone SE (320×568) and iPhone 13 (390×664). Two independent defects. */

/* (a) ShopBuilder mini-cart drawer.
   shopbuilder-pro/assets/css/modules/mini-cart.css sets
   `.rtsb-minicart-drawer { height: 100vh; position: fixed }`. The panel itself
   never scrolls — only the inner item list has overflow-y:auto — so whatever
   `100vh` pushes past the visible area is unreachable. On iOS Safari `100vh`
   resolves to the chrome-retracted viewport, which is ~60–110px taller than
   what the user actually sees. Measured clearance below FINALIZAR COMPRA on
   iPhone SE: 22px, i.e. the whole button row lands under Safari's toolbar.

   REVISED 2026-07-31 after the client (iPhone 16 Pro, Safari) still could not
   reach the button with the first fix delivered and confirmed loading:

   - `100dvh` was the wrong unit. `dvh` tracks the CURRENT toolbar state, so
     with Safari's toolbars collapsed it equals the tall viewport and the panel
     fills it; the moment a tap re-expands the toolbar, the bottom of the panel
     is covered again. `svh` is the SMALL viewport height — the viewport with
     browser UI expanded — so a panel sized to it fits in every toolbar state.
     Slight cosmetic gap at the bottom when toolbars are hidden; always usable,
     which is the correct trade.
   - `env(safe-area-inset-bottom)` was resolving to 0. iOS only exposes non-zero
     safe-area insets when the page opts in with `viewport-fit=cover`, and this
     site's meta viewport is plain `width=device-width, initial-scale=1`. So the
     home-indicator clearance has to be a literal value; changing the site-wide
     meta viewport is not worth the layout risk for this. `max()` keeps the env
     value in play in case the meta tag ever gains viewport-fit=cover. */
.rtsb-minicart-drawer {
    height: 100vh;                    /* baseline */
    height: -webkit-fill-available;   /* iOS Safari < 15.4: no s/d/lvh units */
    height: 100svh;                   /* Safari 15.4+, Chrome 108+ — always fits */
}
/* Belt and braces: if the panel ever does overflow (older iOS falling back to
   100vh, or a future layout change), let it scroll instead of hiding content.
   With the panel correctly sized this is inert — nothing overflows. */
.rtsb-minicart-drawer {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
/* Clear the iPhone home indicator (~34px). The plugin rule is
   `padding: 0 16px 22px 24px`; only the bottom value is overridden, and only on
   mobile so the desktop drawer keeps its original spacing. */
@media (max-width: 1024px) {
    #rtsb-side-content-area-id .woocommerce-mini-cart__buttons.buttons {
        padding-bottom: max(34px, calc(22px + env(safe-area-inset-bottom, 0px)));
    }
}

/* (b) Theme's fixed mobile action bar.
   sportfy/assets/css/style.css:6102 sets
   `.mobile-action-button { position: fixed; bottom: 0; z-index: 99 }` (50px
   tall) with no compensating padding anywhere, so it permanently overlays the
   bottom 50px of every mobile view. Measured on /cesta/ at iPhone SE: the
   FINALIZAR COMPRA button overlapped the bar by 98px; on iPhone 13 the two
   were flush with zero margin. The bar is display:none from 1025px up, so the
   compensating padding is scoped to the same breakpoint.

   Page padding alone is NOT sufficient: it only guarantees nothing is hidden at
   maximum scroll, and the checkout button sits mid-page with the footer below
   it. Re-measured after deploying the padding, the button still overlapped the
   bar by 34px at rest. Since no CSS can keep a mid-page element clear of a
   fixed overlay at an arbitrary scroll position, the bar is instead removed on
   the two funnel pages where it obstructs the primary CTA. It is a duplicate
   nav shortcut (menu / wishlist / cart) and the header nav remains available,
   so nothing becomes unreachable. Revert by deleting this one rule. */
@media (max-width: 1024px) {
    body {
        padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-action-button {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .woocommerce-cart .mobile-action-button,
    .woocommerce-checkout .mobile-action-button {
        display: none !important;
    }
    /* No bar on those pages, so the compensating padding would leave a gap. */
    .woocommerce-cart,
    .woocommerce-checkout {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* (c) CookieYes "revisit consent" badge overlaps the same bottom-left corner
   (z-index 999999, measured sitting on top of the drawer's VER CARRITO button).
   Hide it while the mini-cart drawer is open, and lift it above the action bar
   everywhere else on mobile.

   The open state is `.show-sidebar` on the drawer itself. The plugin also
   defines `body.slidemenuon`, but that class was measured absent while the
   drawer was open, so it cannot be relied on — both are matched here. */
body:has(.rtsb-minicart-drawer.show-sidebar) .cky-btn-revisit-wrapper,
body.slidemenuon .cky-btn-revisit-wrapper {
    display: none !important;
}
@media (max-width: 1024px) {
    .cky-btn-revisit-wrapper {
        bottom: calc(65px + env(safe-area-inset-bottom, 0px)) !important;
    }
}
