/*
 * Vendex Global Styles — loads on ALL pages
 * Contains: footer, mobile nav, toast, and a couple of site-wide utility
 * classes. The old header/menu-bar/language-switcher rules that used to
 * live here were removed — see css/header.css + template-parts/
 * custom-header.php for the current header.
 * Design tokens are output via wp_head in scripts-styles.php + inc/class-vx-colors.php
 */

/* ===== iOS AUTO-ZOOM PREVENTION =====
 * iOS Safari zooms in when a focused input has font-size < 16px.
 * Setting 16px on mobile prevents this without disabling user zoom. */
@media (max-width: 767px) {
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="number"],
    input[type="search"],
    input[type="password"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ===== BREAK OUT OF THEME WRAPPERS =====
 * .hp-announcement-bar / .hp-custom-header removed from these shared
 * selector groups — the new header (css/header.css) supersedes them and
 * they no longer render (see template-parts/custom-header.php). The
 * footer/mobile-nav selectors below MUST stay — they still render on
 * every page (template-parts/custom-footer.php). */
.hp-mobile-footer-nav,
.hp-trust-footer,
.hp-site-footer {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    box-sizing: border-box !important;
}

.hp-mobile-footer-nav,
.hp-trust-footer,
.hp-site-footer {
    font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}

/* Full-page loading overlay for language switch — the switcher control
 * itself is dead (no markup anywhere renders `.vx-lang-switcher`, see
 * template-parts/custom-footer.php), but THIS overlay div is still
 * unconditionally printed in the footer and defaults to hidden via the
 * `display: none` below; deleting this rule would make it show up as a
 * bare block on every page, so it stays. */
.vx-lang-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(var(--vx-color-ink-rgb, 11, 15, 20), 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}
.vx-lang-loading-overlay.vx-active {
    display: flex;
}
.vx-lang-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--vx-primary);
    border-radius: 50%;
    animation: vx-lang-spin 0.7s linear infinite;
}
.vx-lang-loading-text {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}
@keyframes vx-lang-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   TRUST FOOTER
   ======================================== */
.hp-trust-footer {
    background: var(--vx-dark);
    padding: 50px 30px;
}
.hp-trust-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.hp-trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 25px 15px;
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
}
.hp-trust-badge:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
}
.hp-trust-badge-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--vx-primary-glow-15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.hp-trust-badge-icon svg { width: 26px; height: 26px; fill: var(--vx-primary); }
.hp-trust-badge-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    direction: rtl;
}
.hp-trust-badge-desc {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    direction: rtl;
}

/* ========================================
   SITE FOOTER
   ======================================== */
.hp-site-footer {
    background: #001030;
    color: rgba(255,255,255,0.7);
    direction: rtl;
    padding: 40px 30px 20px;
}
.hp-footer-content {
    display: flex;
    gap: 60px;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hp-footer-col h4 { color: #fff; font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.hp-footer-col ul { list-style: none; margin: 0; padding: 0; }
.hp-footer-col ul li { margin-bottom: 8px; }
.hp-footer-col ul li a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.hp-footer-col ul li a:hover { color: var(--vx-primary); }
.hp-footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-top: 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}
.hp-footer-bottom span:first-child {
    font-weight: 700;
    color: rgba(255,255,255,0.6);
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.hp-added-notice {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--vx-dark);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    direction: rtl;
    font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
}
.hp-added-notice.hp-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ========================================
   MOBILE FOOTER NAV (hidden on desktop)
   ======================================== */
.hp-mobile-footer-nav { display: none; }

/* ========================================
   RESPONSIVE — 1080px
   ======================================== */
@media (max-width: 1080px) {
    .hp-mobile-footer-nav,
    .hp-trust-footer,
    .hp-site-footer {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    .hp-trust-badges {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   RESPONSIVE — 768px (mobile)
   ======================================== */
@media (max-width: 768px) {
    /* Trust badges mobile */
    .hp-trust-footer {
        padding: 30px 12px;
    }
    .hp-trust-badges {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .hp-trust-badge { padding: 18px 10px; }
    .hp-trust-badge-icon { width: 44px; height: 44px; margin-bottom: 10px; }
    .hp-trust-badge-icon svg { width: 22px; height: 22px; }
    .hp-trust-badge-title { font-size: 14px; }
    .hp-trust-badge-desc { font-size: 11px; }

    /* Footer mobile */
    .hp-footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
        padding: 0 20px 20px;
    }
    .hp-site-footer {
        padding: 30px 15px 90px;
    }

    /* Sticky mobile footer nav — always pinned to bottom, never moves */
    .hp-mobile-footer-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
        box-sizing: border-box;
        margin: 0;
        background: #fff;
        border-top: 1px solid #E5E5E5;
        z-index: 9990;
        padding: 8px 0 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
        /* No transition on transform — prevents jitter on iOS scroll */
        transition: none;
        transform: translateZ(0); /* GPU layer for smooth compositing */
        -webkit-transform: translateZ(0);
        will-change: auto; /* avoid will-change: transform which causes iOS jitter */
        font-family: "IBM Plex Sans Arabic", "Cairo", sans-serif;
    }
    .hp-mobile-footer-nav::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 200px;
        background: #ffffff;
        transform: translateY(100%);
        pointer-events: none;
    }
    .hp-mobile-footer-nav.hp-nav-hidden {
        /* Only hide opacity, never move with transform — stays in place */
        opacity: 0;
        pointer-events: none;
    }
    .hp-mobile-footer-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #666;
        font-size: 10px;
        font-weight: 600;
        gap: 3px;
        transition: color 0.2s;
        position: relative;
    }
    .hp-mobile-footer-nav a.hp-active,
    .hp-mobile-footer-nav a:hover {
        color: var(--vx-primary);
    }
    .hp-mobile-footer-nav svg {
        width: 24px;
        height: 24px;
    }
    .hp-mobile-nav-badge {
        position: absolute;
        top: -2px;
        right: calc(50% - 18px);
        background: var(--vx-primary);
        color: #fff;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        font-size: 9px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Move toast above mobile nav */
    .hp-added-notice { bottom: 80px; }
}

/* ============================================================
   PRODUCT CARD PRICE — site-wide (homepage, archive, trending, offers)
   Prevents the crossed-out original price from wrapping to a new
   line when a sale price is active. The del shrinks to 12 px and
   stays on the same baseline row as the sale price.
   ============================================================ */
.hp-product-price {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;   /* never let del drop to a second line */
    gap: 4px 6px;
    overflow: hidden;
}

.hp-product-price del {
    color: var(--hp-text-muted, #666);
    font-size: 11px;
    font-weight: 400;
    flex-shrink: 1;      /* can compress slightly if card is narrow */
    white-space: nowrap;
    min-width: 0;
}

.hp-product-price ins {
    text-decoration: none;
    flex-shrink: 0;      /* sale price never shrinks */
    white-space: nowrap;
}

/* ── Visually-hidden text for SEO/accessibility ──
   Used for SEO H1s on pages where the visual hero uses a different heading. */
.vx-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Language switcher (site is Arabic-only — VX_I18n hardcodes 'ar', see
 * CLAUDE.md) — removed. No markup anywhere renders `.vx-lang-switch`,
 * `.vx-lang-btn`, or toggles `.vx-lang-fr` on <html>, so the button styles
 * and the LTR-flip overrides below were fully dead. The loading-overlay
 * CSS for `.vx-lang-loading-overlay` earlier in this file stays — that
 * div is still unconditionally printed in the footer template. */
