/**
 * Ventra Sciences v3 — WordPress compatibility layer
 * Small, targeted tweaks to make the local design work inside WordPress + WooCommerce.
 * Does NOT override the main design — only fills gaps.
 */

/* ── LOGO: constrain to correct size (local expects max 42px tall logo) ── */
.main-nav .nav-logo-official img,
.main-nav-v5 .nav-logo-official img,
.nav-logo-official img {
    max-height: 42px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.footer .footer-logo img {
    max-height: 56px;
    width: auto;
    height: auto;
}

/* Ensure nav-links are centered between logo and actions */
.main-nav .nav-inner,
.main-nav-v5 .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 32px;
}
.main-nav .nav-links,
.main-nav-v5 .nav-links {
    flex: 1;
    justify-content: center;
}

/* ── Sale badge on WooCommerce loop cards (position for local layout) ── */
.woocommerce span.onsale {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    min-height: auto;
    min-width: auto;
    line-height: 1.2;
}

/* ── Woo product card sizing in our grids ── */
.product-card img,
.woocommerce ul.products li.product img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Hide default WooCommerce template bits we don't want */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2.woocommerce-loop-product__title {
    padding: 0;
    margin: 8px 0;
    font-size: 17px;
    font-weight: 700;
}
.woocommerce ul.products li.product .price {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #0A1F3D;
}
.woocommerce ul.products li.product .price del {
    opacity: 0.55;
    font-size: 15px;
}

/* ── COA Lightbox ── */
.vsv3-coa-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 31, 61, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    backdrop-filter: blur(6px);
}
.vsv3-coa-lightbox.open {
    display: flex;
}
.vsv3-lightbox-inner {
    position: relative;
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    overflow: auto;
}
.vsv3-lightbox-inner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}
.vsv3-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0A1F3D;
    color: #fff;
    border: 0;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vsv3-lightbox-close:hover {
    background: #38BDF8;
}

/* ── Search Overlay ── */
.vsv3-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(10, 31, 61, 0.95);
    padding: 80px 20px;
    backdrop-filter: blur(8px);
}
.vsv3-search-overlay.open {
    display: block;
}
.vsv3-search-overlay form {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    position: relative;
}
.vsv3-search-overlay input[type="search"] {
    flex: 1;
    padding: 18px 20px;
    font-size: 18px;
    border-radius: 12px;
    border: 0;
    background: #fff;
    color: #0A1F3D;
}
.vsv3-search-overlay button[type="submit"] {
    padding: 0 28px;
    background: #38BDF8;
    color: #fff;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
}
.vsv3-search-overlay button[type="button"] {
    position: absolute;
    top: -60px;
    right: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

/* ── Animated molecular-ish background for page headers ── */
.page-header {
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(56, 189, 248, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(14, 165, 233, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(56, 189, 248, 0.15) 0%, transparent 50%);
    animation: vsv3-molecular-float 25s ease-in-out infinite alternate;
    pointer-events: none;
}
.page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(56, 189, 248, 0.5) 1px, transparent 1.5px),
        radial-gradient(circle, rgba(56, 189, 248, 0.35) 1px, transparent 1.5px);
    background-size: 80px 80px, 120px 120px;
    background-position: 0 0, 40px 60px;
    opacity: 0.35;
    animation: vsv3-molecular-drift 40s linear infinite;
    pointer-events: none;
}
.page-header > .container {
    position: relative;
    z-index: 2;
}
@keyframes vsv3-molecular-float {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-20px, -15px) scale(1.05); }
    100% { transform: translate(20px, 10px) scale(1); }
}
@keyframes vsv3-molecular-drift {
    0%   { background-position: 0 0, 40px 60px; }
    100% { background-position: 80px 80px, 160px 180px; }
}

/* Apply same bg to hero */
.hero-v5.dark-section-mol,
.inner-circle.dark-section-mol {
    position: relative;
    overflow: hidden;
}
.hero-v5.dark-section-mol::after,
.inner-circle.dark-section-mol::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(56, 189, 248, 0.45) 1px, transparent 1.5px),
        radial-gradient(circle, rgba(56, 189, 248, 0.28) 1px, transparent 1.5px);
    background-size: 90px 90px, 140px 140px;
    background-position: 0 0, 45px 70px;
    opacity: 0.5;
    animation: vsv3-molecular-drift 45s linear infinite;
    pointer-events: none;
    z-index: 0;
}
.hero-v5.dark-section-mol > .container,
.inner-circle.dark-section-mol > .container {
    position: relative;
    z-index: 2;
}

/* ── Mobile nav toggle ── */
@media (min-width: 901px) {
    .mobile-toggle { display: none !important; }
}
@media (max-width: 900px) {
    .main-nav .nav-links,
    .main-nav-v5 .nav-links {
        display: none;
    }
    .main-nav .nav-links.mobile-open,
    .main-nav-v5 .nav-links.mobile-open {
        display: flex;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        padding: 24px;
        flex-direction: column;
        gap: 4px;
        z-index: 100;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }
    .main-nav .nav-links.mobile-open > a,
    .main-nav-v5 .nav-links.mobile-open > a,
    .main-nav .nav-links.mobile-open .nav-dropdown > a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        width: 100%;
        display: block;
    }
    .main-nav .nav-links.mobile-open .dropdown-menu {
        position: static;
        display: block;
        box-shadow: none;
        padding: 0 0 0 16px;
        background: transparent;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
    }
    .mobile-toggle span {
        display: block;
        width: 26px;
        height: 2px;
        background: #0A1F3D;
        transition: all 0.3s;
    }
    .mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Shop sidebar stacks above products on mobile */
    .shop-layout { grid-template-columns: 1fr !important; gap: 24px !important; }
    .coa-layout { grid-template-columns: 1fr !important; gap: 24px !important; }
    .shop-sidebar, .coa-sidebar { position: static !important; max-height: none !important; }

    .shop-product-grid,
    .coa-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }
    .product-grid-8 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }
    .product-card { padding: 14px; }

    .hero-v5 .h5-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
    .h5-title { font-size: 38px !important; line-height: 1.15 !important; }
    .h5-buttons { flex-direction: column !important; gap: 12px !important; }
    .h5-btn-primary, .h5-btn-outline { width: 100% !important; text-align: center !important; justify-content: center !important; }
    .h5-stats { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }

    .trust-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 20px !important; }
    .test-grid, .why-grid { grid-template-columns: 1fr !important; }
    .footer-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
    .footer-bottom { flex-direction: column !important; gap: 14px !important; text-align: center !important; }
    .ic-perks { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
    .shop-product-grid,
    .coa-grid,
    .product-grid-8 {
        grid-template-columns: 1fr !important;
    }
    .trust-grid { grid-template-columns: 1fr !important; }
    .h5-title { font-size: 30px !important; }
}

/* ── WooCommerce single-product styling (keep clean white bg) ── */
body.single-product .woocommerce-main {
    padding-top: 40px;
    padding-bottom: 80px;
}
body.single-product .product .images img {
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
body.single-product .product_title {
    font-size: 32px;
    color: #0A1F3D;
    margin-top: 0;
}
body.single-product .summary .price {
    font-size: 26px;
    color: #0A1F3D;
    font-weight: 700;
    margin: 16px 0;
}
body.single-product .summary button[type="submit"].single_add_to_cart_button {
    background: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);
    color: #fff;
    border: 0;
    padding: 16px 40px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}
body.single-product .summary button[type="submit"].single_add_to_cart_button:hover {
    transform: translateY(-2px);
}

/* Single product: COA callout block */
.vsv3-coa-callout {
    background: linear-gradient(135deg, #F0F7FC 0%, #E6F1F9 100%);
    border-radius: 16px;
    padding: 30px;
    margin: 40px 0;
    text-align: center;
    border: 1px solid rgba(56, 189, 248, 0.2);
}
.vsv3-coa-callout h3 {
    color: #0A1F3D;
    margin: 0 0 12px;
}
.vsv3-coa-callout .btn {
    margin-top: 12px;
}

/* Account page + other WP core pages — soft styling */
body.page-account .page-header,
body.woocommerce-account .page-header {
    background: linear-gradient(135deg, #0A1F3D 0%, #0E2A50 100%);
    color: #fff;
    padding: 70px 0 60px;
}
body.page-account .page-header h1,
body.woocommerce-account .page-header h1 { color: #fff; }
body.page-account .page-header p,
body.woocommerce-account .page-header p { color: #94A3B8; }

body.woocommerce-account .woocommerce-MyAccount-navigation {
    background: #F5F8FC;
    border-radius: 14px;
    padding: 24px;
}
body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
body.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin: 0;
    border-bottom: 1px solid rgba(10, 31, 61, 0.08);
}
body.woocommerce-account .woocommerce-MyAccount-navigation ul li:last-child { border-bottom: 0; }
body.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    color: #0A1F3D;
    padding: 12px 0;
    display: block;
    text-decoration: none;
    font-weight: 500;
}
body.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
body.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    color: #38BDF8;
}

/* ── Dropdown menu polish ── */
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 12px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 50;
}
.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu a {
    padding: 10px 16px;
    border-radius: 8px;
    color: #0A1F3D !important;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.dropdown-menu a:hover {
    background: #F0F7FC;
    color: #38BDF8 !important;
}

/* Sticky nav scrolled state */
.main-nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.97);
}

/* Breadcrumbs on shop subpages — hide default WC ones to keep design clean */
.woocommerce-breadcrumb {
    display: none;
}

/* Dequeue-leftover fallback: hide WP emoji bloat */
img.wp-smiley, img.emoji { display: none; }
