/* ============================================================
   101 Series — EMERGENCY LINK FIX v1.0
   Loaded LAST — ensures nothing blocks clicks or links
   ============================================================ */

/* ── 1. LAZY IMAGES — show by default, animate on load ── */
/* Remove the opacity:0 default that hides images before JS runs */
img[loading="lazy"] {
    opacity: 1 !important;
    transition: none !important;
}

/* ── 2. ALL FIXED OVERLAYS — ensure display:none by default ── */
/* Splash screen — hidden until JS explicitly shows it */
#s101-splash {
    display: none !important;
    pointer-events: none !important;
}
#s101-splash.s101-splash-active {
    display: flex !important;
    pointer-events: auto !important;
}

/* Exit intent — hidden until JS shows it */
#s101-exit-intent {
    display: none !important;
    pointer-events: none !important;
}
#s101-exit-intent.s101-ei-active {
    display: flex !important;
    pointer-events: auto !important;
}

/* Cart drawer — no pointer events until opened */
#s101-cart-drawer {
    pointer-events: none !important;
}
#s101-cart-drawer.s101-cd-open {
    pointer-events: all !important;
}

/* Zoom modal — hidden */
#s101-zoom-modal {
    display: none !important;
    pointer-events: none !important;
}

/* ── 3. ENSURE ALL LINKS ARE ALWAYS CLICKABLE ── */
a[href],
a[href] * {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* ── 4. PRODUCT CARDS — links always work ── */
.woocommerce-loop-product__link,
.ct-woo-card-wrapper a,
li.product a,
.wc-block-grid__product a,
.s101-sp-card,
.s101-rs-card {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 1 !important;
}

/* ── 5. LOGO LINK — always clickable ── */
.site-logo-container,
a[rel="home"],
.ct-header a[href="/"],
.ct-header a[href="https://101series.online/"],
.ct-header a[href="https://www.101series.online/"] {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 100 !important;
    position: relative !important;
}

/* ── 6. NAV LINKS — always clickable, white text ── */
.ct-header .ct-menu-link,
#header .ct-menu-link,
.ct-header nav a {
    pointer-events: auto !important;
    cursor: pointer !important;
    color: rgba(255,255,255,0.92) !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 100 !important;
    display: inline-flex !important;
}
.ct-header .sub-menu .ct-menu-link {
    color: #0D1B2A !important;
}

/* ── 7. PREVENT ANY ELEMENT FROM ACCIDENTALLY COVERING PAGE ── */
/* Any fixed element that covers inset:0 must start hidden */
#s101-exit-intent,
#s101-splash,
#s101-zoom-modal {
    inset: unset !important;
}
#s101-exit-intent.s101-ei-active,
#s101-splash.s101-splash-active,
#s101-zoom-modal[style*="flex"] {
    inset: 0 !important;
}

/* ── 8. MOBILE NAV — hamburger always works ── */
@media (max-width: 1024px) {
    .ct-header [data-id="trigger"],
    .ct-header button[aria-label*="enu"],
    #header .ct-toggle-dropdown-mobile {
        display: flex !important;
        pointer-events: auto !important;
        z-index: 9999 !important;
        position: relative !important;
    }
}

/* ── 9. REMOVE OVERLAY from hero strip / announcement bar ── */
#s101-hero-strip,
#s101-announcement-bar {
    position: relative !important;
    z-index: 10 !important;
}

/* ── 11. CRITICAL: .s101-fade MUST NEVER HIDE CONTENT ──
   The fade animation was incorrectly applied to .elementor-section
   causing the entire homepage to be opacity:0 and unclickable.
   This override ensures it can never happen again. */
.s101-fade,
.elementor-section.s101-fade,
.ct-woo-card-wrapper.s101-fade,
li.product.s101-fade,
.wc-block-grid__product.s101-fade {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* ── 12. ELEMENTOR SECTIONS always visible ── */
.elementor-section,
.elementor-top-section,
.elementor-inner-section,
.elementor-element,
.elementor-widget-container {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ── 13. SHARE PROGRESS MODAL — hidden until JS opens it ── */
/* batch12-features.css gives this display:flex by default = full-screen block! */
#s101-share-progress {
    display: none !important;
    pointer-events: none !important;
}
/* JS sets display:flex inline style when share button clicked — respect that */
#s101-share-progress[style*="flex"] {
    display: flex !important;
    pointer-events: auto !important;
}

/* ── 14. PREVENT ANY OTHER FIXED FULL-SCREEN OVERLAY ── */
/* Catch-all: any fixed element covering the full viewport must have pointer-events:none by default */
#s101-cmd-palette,
#s101-quick-view-modal {
    pointer-events: none !important;
}
#s101-cmd-palette.s101-cmd-open,
#s101-quick-view-modal.s101-qv-open {
    pointer-events: auto !important;
}

/* ── 15. NAV MENU ITEMS — always visible, no accidental hide ── */
.ct-header .ct-menu,
.ct-header ul.ct-menu,
.ct-header nav ul {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* ── 16. BODY AND MAIN CONTENT — never pointer-events:none ── */
body,
#main,
.site-main,
main,
.entry-content,
.elementor,
#content {
    pointer-events: auto !important;
}

/* ══════════════════════════════════════════════════════════════
   101 Series — VISUAL UPGRADES v2.1
   Homepage fixes + Modern categories + Apple glass effects
   ════════════════════════════════════════════════════════════ */

/* ── 17. HIDE MID-PAGE CATEGORIES CAROUSEL ──
   Categories should only appear in header nav dropdown, not mid-page */
.s101-categories-carousel-hide {
    display: none !important;
}

/* ── 18. HIDE "COMING SOON" / out-of-stock overlays on new releases ──
   These books ARE available, so never show coming soon badges */
.elementor-container .woocommerce ul.products li.product .s101-coming-soon-badge,
.elementor-container .woocommerce ul.products li.product .s101-badge.coming-soon,
.elementor-container .woocommerce ul.products li.product .coming-soon-badge,
.e-container .woocommerce ul.products li.product .coming_soon,
.e-con .woocommerce ul.products li.product .coming-soon {
    display: none !important;
}

/* ── 19. MODERN HEADER NAV — Category dropdown redesign ──
   Apple-style glass morphism for the "Book Categories" mega dropdown */
.ct-header nav .sub-menu {
    background: rgba(13, 27, 42, 0.92) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.05) !important;
    padding: 12px 8px !important;
    min-width: 220px !important;
    overflow: hidden !important;
}
.ct-header nav .sub-menu li a {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: all 0.2s ease !important;
    position: relative !important;
}
.ct-header nav .sub-menu li a:hover {
    background: rgba(201, 168, 76, 0.15) !important;
    color: #C9A84C !important;
    padding-left: 22px !important;
}
.ct-header nav .sub-menu li a::before {
    content: '›' !important;
    color: #C9A84C !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    opacity: 0 !important;
    transition: opacity 0.2s, transform 0.2s !important;
    transform: translateX(-6px) !important;
    display: inline-block !important;
}
.ct-header nav .sub-menu li a:hover::before {
    opacity: 1 !important;
    transform: translateX(0) !important;
}
/* Parent "Book Categories" nav item styling */
.ct-header nav > ul > li:has(.sub-menu) > a {
    position: relative !important;
}

/* ── 20. APPLE GLASS PRODUCT CARDS ──
   Subtle glassmorphism on product cards site-wide */
.woocommerce ul.products li.product {
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
}
.woocommerce ul.products li.product:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.14) !important;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-weight: 700 !important;
}

/* ── 21. GLASS HERO SECTION ──
   Glassmorphism on the hero subscription box */
.ct-newsletter-hero .ct-newsletter-form {
    background: rgba(255,255,255,0.1) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 14px !important;
}

/* ── 22. ANIMATED SECTION HEADERS ──
   Subtle fade-up animation on section headings */
.elementor-heading-title {
    animation: s101fadeUp 0.6s ease both !important;
}
@keyframes s101fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── 23. GLASS NAV TOP BAR ──
   Make the main header look Apple-premium */
.ct-header {
    background: rgba(13, 27, 42, 0.88) !important;
    backdrop-filter: blur(24px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
}

/* ── 24. SMOOTH PAGE TRANSITIONS ──
   Fade-in the whole page on load */
body {
    animation: s101pageIn 0.4s ease !important;
}
@keyframes s101pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── 25. GOLD ACCENT HOVER on nav links ── */
.ct-header nav > ul > li > a {
    transition: color 0.2s ease !important;
    font-weight: 600 !important;
}
.ct-header nav > ul > li > a:hover {
    color: #C9A84C !important;
}

/* ── 26. MODERN CATEGORY SECTION — replaces old carousel ──
   Beautiful inline category pill tags visible only in shop/nav */
.s101-cat-nav-pills {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    padding: 16px 0 !important;
}
.s101-cat-pill {
    background: rgba(201,168,76,0.1) !important;
    border: 1px solid rgba(201,168,76,0.3) !important;
    color: #C9A84C !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 6px 16px !important;
    border-radius: 999px !important;
    text-decoration: none !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s !important;
}
.s101-cat-pill:hover {
    background: #C9A84C !important;
    color: #0D1B2A !important;
}

/* ── 27. ENSURE SHOP + BLOG visible in nav ── */
.ct-header nav > ul > li > a[href*="/shop/"],
.ct-header nav > ul > li > a[href*="/blog/"] {
    color: inherit !important;
    opacity: 1 !important;
    display: inline-flex !important;
}

/* ══════════════════════════════════════════════════════════════
   28. HIDE MOBILE OFFCANVAS CATEGORIES BLOCK & "Book Categories" TEXT
   The old icon-grid (content-block 1702) and label only live
   inside the mobile offcanvas drawer — hide both cleanly.
   ══════════════════════════════════════════════════════════════ */
/* "Book Categories:" header text element */
.ct-drawer-canvas .header-text-widget,
.ct-header-offcanvas .header-text-widget {
    display: none !important;
}

/* The tax-query category grid (content block 1702) */
.ct-drawer-canvas [data-id="content-block"],
.ct-header-offcanvas [data-id="content-block"],
.ct-drawer-canvas .wp-block-blocksy-tax-query,
.ct-header-offcanvas .wp-block-blocksy-tax-query {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   29. MODERN BOTTOM-ROW CATEGORY NAV  (menu-tertiary / menu_3)
   Replace the yellow pill buttons with clean, modern text links.
   Categories show as: Investing · AI · Business · etc.
   ══════════════════════════════════════════════════════════════ */

/* Base: bottom row itself */
.ct-header [data-row="bottom"] {
    background: rgba(10, 20, 32, 0.95) !important;
    border-top: 1px solid rgba(201, 168, 76, 0.15) !important;
}

/* Reset the type-3 pill style — make links look like modern text tabs */
.ct-header [data-id="menu-tertiary"] nav > ul > li > a,
.ct-header [data-id="menu-tertiary"] nav > ul > li > button {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    padding: 6px 14px !important;
    position: relative !important;
    transition: color 0.2s ease !important;
}

/* Hover: gold underline reveal */
.ct-header [data-id="menu-tertiary"] nav > ul > li > a::after,
.ct-header [data-id="menu-tertiary"] nav > ul > li > button::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 14px !important;
    right: 14px !important;
    height: 2px !important;
    background: #C9A84C !important;
    border-radius: 2px !important;
    transform: scaleX(0) !important;
    transition: transform 0.2s ease !important;
}
.ct-header [data-id="menu-tertiary"] nav > ul > li > a:hover,
.ct-header [data-id="menu-tertiary"] nav > ul > li > button:hover {
    color: #C9A84C !important;
}
.ct-header [data-id="menu-tertiary"] nav > ul > li > a:hover::after,
.ct-header [data-id="menu-tertiary"] nav > ul > li > button:hover::after {
    transform: scaleX(1) !important;
}
.ct-header [data-id="menu-tertiary"] nav > ul > li.current-menu-item > a,
.ct-header [data-id="menu-tertiary"] nav > ul > li.current-menu-ancestor > a {
    color: #C9A84C !important;
}
.ct-header [data-id="menu-tertiary"] nav > ul > li.current-menu-item > a::after,
.ct-header [data-id="menu-tertiary"] nav > ul > li.current-menu-ancestor > a::after {
    transform: scaleX(1) !important;
}

/* ── Category dropdown panel — modern Apple-glass style ── */
.ct-header [data-id="menu-tertiary"] .sub-menu {
    background: rgba(10, 20, 32, 0.96) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(201, 168, 76, 0.2) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    padding: 8px 0 !important;
    min-width: 180px !important;
}
.ct-header [data-id="menu-tertiary"] .sub-menu li a {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 10px 20px !important;
    border-radius: 0 !important;
    transition: all 0.15s ease !important;
    background: transparent !important;
    border: none !important;
}
.ct-header [data-id="menu-tertiary"] .sub-menu li a:hover {
    background: rgba(201, 168, 76, 0.12) !important;
    color: #C9A84C !important;
    padding-left: 26px !important;
}

/* ══════════════════════════════════════════════════════════════
   30. CART OFFCANVAS DRAWER — prevent dark overlay flash
   ══════════════════════════════════════════════════════════════ */

/* The semi-transparent page overlay that dims the page */
.ct-drawer-overlay {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(2px) !important;
}

/* The cart panel itself — modern dark glass */
.ct-mini-cart-panel,
.ct-drawer-canvas[data-id="cart-panel"] {
    background: rgba(13, 27, 42, 0.97) !important;
    backdrop-filter: blur(24px) !important;
    border-left: 1px solid rgba(201, 168, 76, 0.2) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ══════════════════════════════════════════════════════════════
   31. HIDE SELECT CATEGORY DROPDOWN in header search bar
   ══════════════════════════════════════════════════════════════ */
.ct-header .search-form .ct-select,
.ct-header .search-form select,
.ct-header [data-id="search-input"] .ct-select-container,
.ct-header [data-id="search-input"] select {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   32. HIDE OLD "CATEGORIES" OFFCANVAS PANEL if it appears
       (Blocksy woo-categories / ct-categories-button)
   ══════════════════════════════════════════════════════════════ */
.ct-categories-offcanvas,
.ct-categories-btn,
[data-id="woo-categories"],
.header-woo-categories-button {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   33. MODERN CATEGORY PILLS — for content block 1702 (mobile offcanvas)
       s101-modern-cats: a flex row of pill-style text links
   ══════════════════════════════════════════════════════════════ */
.s101-modern-cats {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 12px 0 !important;
}
.s101-cat-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 18px !important;
    background: rgba(201, 168, 76, 0.07) !important;
    border: 1px solid rgba(201, 168, 76, 0.18) !important;
    border-radius: 10px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}
.s101-cat-link:hover {
    background: rgba(201, 168, 76, 0.15) !important;
    border-color: rgba(201, 168, 76, 0.4) !important;
    color: #C9A84C !important;
    transform: translateX(4px) !important;
}
.s101-cat-link.s101-cat-all {
    background: rgba(201, 168, 76, 0.15) !important;
    border-color: #C9A84C !important;
    color: #C9A84C !important;
    font-weight: 700 !important;
    margin-top: 4px !important;
}
.s101-cat-link.s101-cat-all:hover {
    background: #C9A84C !important;
    color: #0D1B2A !important;
}

/* ══════════════════════════════════════════════════════════════
   34. NUCLEAR BLACK BOX FIX — ct-drawer-canvas panels
   The offcanvas drawers render at the top of <body> and show
   a dark background before JS hides them. We use display:none
   on the entire canvas until Blocksy opens a panel.
   Targeting ALL child elements ensures no dark bg bleeds through.
   ══════════════════════════════════════════════════════════════ */

/* STEP 1: Completely hide the wrapper and ALL panels until opened */
.ct-drawer-canvas,
.ct-drawer-canvas *,
#woo-cart-panel,
#woo-cart-panel * {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* STEP 2: Push closed panels fully off-screen and invisible */
.ct-drawer-canvas .ct-panel[inert],
.ct-drawer-canvas .ct-panel[inert=""],
#woo-cart-panel[inert],
#woo-cart-panel[inert=""] {
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translateX(110%) !important;
    pointer-events: none !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    z-index: -9999 !important;
}

/* STEP 3: Also hide ALL children of closed panels */
.ct-drawer-canvas .ct-panel[inert] *,
.ct-drawer-canvas .ct-panel[inert=""] *,
#woo-cart-panel[inert] *,
#woo-cart-panel[inert=""] * {
    background: transparent !important;
    background-color: transparent !important;
    visibility: hidden !important;
    opacity: 0 !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

/* STEP 4: The canvas wrapper — no visible background, tucked behind */
.ct-drawer-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    z-index: -9999 !important;
    pointer-events: none !important;
}

/* STEP 5: Restore panels when Blocksy opens them (inert removed) */
.ct-drawer-canvas .ct-panel:not([inert]) {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    z-index: 99999 !important;
    background: rgba(13, 27, 42, 0.97) !important;
    background-color: rgba(13, 27, 42, 0.97) !important;
    backdrop-filter: blur(24px) !important;
}
.ct-drawer-canvas .ct-panel:not([inert]) * {
    visibility: visible !important;
    opacity: 1 !important;
}
.ct-drawer-canvas:has(.ct-panel:not([inert])) {
    width: auto !important;
    height: auto !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
}

/* STEP 6: Cart panel — restore when opened */
#woo-cart-panel:not([inert]) {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    z-index: 99999 !important;
    background: rgba(13, 27, 42, 0.97) !important;
    background-color: rgba(13, 27, 42, 0.97) !important;
    backdrop-filter: blur(24px) !important;
    border-left: 1px solid rgba(201, 168, 76, 0.2) !important;
}
#woo-cart-panel:not([inert]) * {
    visibility: visible !important;
    opacity: 1 !important;
}

/* STEP 7: Backdrop overlay — only show when panel is open */
.ct-panel-overlay,
.ct-drawer-overlay,
.ct-overlay {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}
.ct-panel-overlay.ct-active,
.ct-drawer-overlay.ct-active,
.ct-overlay.ct-active,
body.ct-panel-open .ct-panel-overlay,
body.ct-panel-open .ct-drawer-overlay,
body.ct-panel-open .ct-overlay {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ── 35. ACCOUNT MODAL — HIDDEN BY DEFAULT ── */
#account-modal[inert],
#account-modal[inert=""] {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
    transform: translateY(-20px) !important;
}
#account-modal[inert] *,
#account-modal[inert=""] * {
    background: transparent !important;
    background-color: transparent !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
#account-modal:not([inert]) {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}
#account-modal:not([inert]) * {
    visibility: visible !important;
    opacity: 1 !important;
}
