/**
 * Vision Research - Custom Header Styles
 */

/* ============================================
   RESET / OVERRIDE BLOCKSY STYLES
   ============================================ */

/* Hide Blocksy header if still showing */
[data-header],
.ct-header,
header.ct-header {
    display: none !important;
}

/* Ensure our elements have proper box-sizing */
.vr-topbar,
.vr-topbar *,
.vr-header,
.vr-header *,
.vr-mobile-menu,
.vr-mobile-menu *,
.vr-search-overlay,
.vr-search-overlay * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Reset links */
.vr-header a,
.vr-mobile-menu a {
    text-decoration: none;
}

/* ============================================
   TOP BAR
   ============================================ */
.vr-topbar {
    background: linear-gradient(135deg, #1a5276 0%, #2980b9 100%) !important;
    color: #ffffff;
    font-size: 13px;
    position: relative;
    z-index: 999;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hide topbar when scrolled (optional - enable with JS class) */
.vr-topbar.vr-topbar--hidden {
    transform: translateY(-100%);
    opacity: 0;
    position: absolute;
    width: 100%;
}

.vr-topbar__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 24px;
}

.vr-topbar__items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.vr-topbar__item {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.95;
}

.vr-topbar__item svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* ============================================
   MAIN HEADER — fixed sticky
   ============================================ */
.vr-header {
    background: #ffffff !important;
    border-bottom: 1px solid var(--vr-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

/* Scrolled state - enhanced shadow */
.vr-header.vr-header--scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Spacer to prevent content from hiding behind fixed header */
.vr-header-spacer {
    height: 71px; /* matches header height; JS adjusts dynamically */
}

/* Override any theme styles */
.vr-header,
.vr-header * {
    box-sizing: border-box;
}

.vr-topbar {
    position: relative;
    z-index: 1001;
}

.vr-header__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #ffffff;
}

/* ============================================
   LOGO
   ============================================ */
.vr-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    flex-shrink: 0;
}

.vr-header__logo img,
.vr-header__logo .custom-logo,
.vr-header__logo .vr-logo-img {
    height: 44px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.vr-logo-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.vr-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.vr-logo-text strong {
    font-size: 18px;
    font-weight: 700;
    color: #1a5276 !important;
    letter-spacing: 1px;
}

.vr-logo-text small {
    font-size: 10px;
    color: #64748b !important;
    letter-spacing: 2px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.vr-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.vr-nav__item {
    position: relative;
}

.vr-nav__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b !important;
    text-decoration: none !important;
    border-radius: 10px;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.vr-nav__link svg {
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: color 0.2s;
    flex-shrink: 0;
}

.vr-nav__link span {
    color: #1e293b;
}

.vr-nav__link:hover {
    background: #f1f5f9;
    color: var(--vr-primary) !important;
}

.vr-nav__link:hover svg,
.vr-nav__link:hover span {
    color: var(--vr-primary);
}

.vr-nav__link--dropdown {
    padding-right: 12px;
}

.vr-nav__chevron {
    width: 14px !important;
    height: 14px !important;
    margin-left: -4px;
    transition: transform 0.2s;
}

.vr-nav__dropdown:hover .vr-nav__chevron,
.vr-nav__dropdown.active .vr-nav__chevron {
    transform: rotate(180deg);
}

/* Active state */
.vr-nav__link--active,
.vr-nav__dropdown:hover .vr-nav__link,
.vr-nav__dropdown.active .vr-nav__link {
    background: #e0f2fe;
    color: var(--vr-primary);
}

.vr-nav__link--active svg,
.vr-nav__dropdown:hover .vr-nav__link svg,
.vr-nav__dropdown.active .vr-nav__link svg {
    color: var(--vr-primary);
}

/* ============================================
   MEGA MENU
   ============================================ */
.vr-megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
}

.vr-nav__dropdown:hover .vr-megamenu,
.vr-nav__dropdown.active .vr-megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vr-megamenu__container {
    background: white;
    border: 1px solid var(--vr-header-border);
    border-radius: 16px;
    padding: 28px;
    display: grid;
    grid-template-columns: 200px 220px;
    gap: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.vr-megamenu__title {
    font-size: 11px;
    font-weight: 600;
    color: var(--vr-primary);
    letter-spacing: 0.5px;
    margin: 0 0 16px;
}

.vr-megamenu__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vr-megamenu__list a {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--vr-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
}

.vr-megamenu__list a:hover {
    background: #f1f5f9;
    color: var(--vr-primary);
}

.vr-megamenu__badge {
    margin-top: 20px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--vr-primary) 0%, var(--vr-primary-dark) 100%);
    border-radius: 12px;
    color: white;
}

.vr-megamenu__badge strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.vr-megamenu__badge span {
    font-size: 12px;
    opacity: 0.9;
}

/* ============================================
   HEADER ACTIONS
   ============================================ */
.vr-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.vr-header__action {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: #1e293b;
    text-decoration: none !important;
}

.vr-header__action svg {
    width: 22px;
    height: 22px;
    color: #1e293b;
}

.vr-header__action:hover {
    background: #f1f5f9;
}

.vr-header__action:hover svg {
    color: var(--vr-primary);
}

/* Cart Count Badge */
.vr-header__cart-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--vr-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Burger Menu */
.vr-header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 12px;
}

.vr-header__burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #1e293b;
    border-radius: 2px;
    transition: all 0.3s;
}

.vr-header__burger:hover {
    background: #f1f5f9;
}

.vr-header__burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.vr-header__burger.active span:nth-child(2) {
    opacity: 0;
}

.vr-header__burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   MOBILE MENU
   ============================================ */
.vr-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    height: 100dvh; /* Dynamic viewport height - ignores keyboard */
    z-index: 99999;
    pointer-events: none;
    visibility: hidden;
    overflow: hidden;
}

.vr-mobile-menu.active {
    pointer-events: auto;
    visibility: visible;
}

.vr-mobile-menu__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}

.vr-mobile-menu.active .vr-mobile-menu__overlay {
    opacity: 1;
}

.vr-mobile-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 2;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    /* Ensure panel doesn't extend beyond viewport */
    max-height: 100%;
}

.vr-mobile-menu.active .vr-mobile-menu__panel {
    transform: translateX(0);
}

/* Mobile Header */
.vr-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--vr-header-border);
}

.vr-mobile-menu__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.vr-mobile-menu__logo .vr-logo-icon {
    width: 28px;
    height: 28px;
}

.vr-mobile-menu__logo span {
    font-size: 16px;
    font-weight: 700;
    color: #1a5276;
    letter-spacing: 1px;
}

.vr-mobile-menu__close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 10px;
}

.vr-mobile-menu__close svg {
    width: 24px;
    height: 24px;
    color: var(--vr-text);
}

.vr-mobile-menu__close:hover {
    background: #f1f5f9;
}

/* Mobile Badges */
.vr-mobile-menu__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a5276 0%, #2980b9 100%);
}

.vr-mobile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    font-size: 12px;
    color: white;
}

.vr-mobile-badge svg {
    width: 14px;
    height: 14px;
}

/* Mobile Nav */
.vr-mobile-menu__nav {
    padding: 16px 20px;
}

.vr-mobile-nav__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--vr-text);
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.vr-mobile-nav__link svg:first-child {
    width: 20px;
    height: 20px;
    color: var(--vr-text-light);
}

.vr-mobile-nav__link span {
    flex: 1;
    text-align: left;
}

.vr-mobile-nav__arrow,
.vr-mobile-nav__chevron {
    width: 18px;
    height: 18px;
    color: #cbd5e1;
    transition: transform 0.2s;
}

.vr-mobile-nav__accordion.active .vr-mobile-nav__chevron {
    transform: rotate(90deg);
}

/* Mobile Submenu */
.vr-mobile-nav__submenu {
    display: none;
    padding: 8px 0 8px 34px;
}

.vr-mobile-nav__accordion.active .vr-mobile-nav__submenu {
    display: block;
}

.vr-mobile-nav__submenu a {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    color: var(--vr-text-light);
    text-decoration: none;
    border-bottom: 1px solid #f8fafc;
}

.vr-mobile-nav__submenu a:hover {
    color: var(--vr-primary);
}

/* Mobile Search */
.vr-mobile-menu .vr-mobile-menu__search {
    padding: 0 20px 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.vr-mobile-menu .vr-mobile-menu__search form {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--vr-header-border);
    border-radius: 12px;
}

.vr-mobile-menu .vr-mobile-menu__search form svg {
    width: 20px;
    height: 20px;
    color: var(--vr-text-light);
    flex-shrink: 0;
}

.vr-mobile-menu .vr-mobile-menu__search form input[type="search"],
.vr-mobile-menu .vr-mobile-menu__search form input[name="s"] {
    flex: 1 !important;
    border: none !important;
    background: transparent !important;
    font-size: 16px !important; /* 16px prevents iOS zoom on focus */
    color: var(--vr-text) !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: unset !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
}

.vr-mobile-menu .vr-mobile-menu__search form input[type="search"]:focus,
.vr-mobile-menu .vr-mobile-menu__search form input[name="s"]:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

.vr-mobile-menu .vr-mobile-menu__search form input[type="search"]::placeholder,
.vr-mobile-menu .vr-mobile-menu__search form input[name="s"]::placeholder {
    color: var(--vr-text-light) !important;
    opacity: 1 !important;
}

/* Mobile Actions */
.vr-mobile-menu__actions {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.vr-mobile-menu__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.vr-mobile-menu__btn svg {
    width: 20px;
    height: 20px;
}

.vr-mobile-menu__btn--primary {
    background: linear-gradient(135deg, var(--vr-primary) 0%, var(--vr-primary-dark) 100%);
    color: white;
}

.vr-mobile-menu__btn--primary:hover {
    opacity: 0.9;
}

.vr-mobile-menu__btn--outline {
    background: white;
    color: var(--vr-primary);
    border: 1px solid var(--vr-header-border);
}

.vr-mobile-menu__btn--outline:hover {
    border-color: var(--vr-primary);
}

/* Mobile Quality */
.vr-mobile-menu__quality {
    margin: 20px;
    margin-top: auto; /* Push to bottom using flexbox */
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--vr-header-border);
    border-radius: 12px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-shrink: 0;
}

.vr-mobile-menu__quality svg {
    width: 24px;
    height: 24px;
    color: var(--vr-primary);
    flex-shrink: 0;
}

.vr-mobile-menu__quality strong {
    display: block;
    font-size: 14px;
    color: var(--vr-text);
    margin-bottom: 2px;
}

.vr-mobile-menu__quality span {
    font-size: 13px;
    color: var(--vr-text-light);
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.vr-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.vr-search-overlay.active {
    transform: translateY(0);
}

.vr-search-overlay__container {
    max-width: 700px;
    margin: 0 auto;
}

.vr-search-form {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 2px solid var(--vr-header-border);
    border-radius: 16px;
}

.vr-search-form:focus-within {
    border-color: var(--vr-primary);
}

.vr-search-form svg {
    width: 24px;
    height: 24px;
    color: var(--vr-text-light);
    flex-shrink: 0;
}

.vr-search-form input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--vr-text);
    outline: none;
}

.vr-search-form input::placeholder {
    color: var(--vr-text-light);
}

.vr-search-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    color: var(--vr-text-light);
}

.vr-search-close:hover {
    background: #e2e8f0;
    color: var(--vr-text);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1100px) {
    .vr-nav__link span {
        display: none;
    }

    .vr-nav__link {
        padding: 10px 12px;
    }

    .vr-nav__chevron {
        display: none;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .vr-topbar__container {
        padding: 8px 16px;
    }

    .vr-topbar__items {
        gap: 16px;
        font-size: 12px;
    }

    .vr-topbar__item:last-child {
        display: none;
    }

    .vr-header__container {
        padding: 0 16px;
        height: 60px;
    }

    .vr-nav {
        display: none !important;
    }

    .vr-header__burger {
        display: flex !important;
    }

    .vr-header__action {
        width: 40px;
        height: 40px;
    }

    .vr-header__action svg {
        width: 20px;
        height: 20px;
    }

    /* Keep search + cart visible on mobile, hide login/account */
    .vr-header__login,
    .vr-header__account {
        display: none !important;
    }

    .vr-header__logo img,
    .vr-header__logo .vr-logo-img {
        height: 36px;
    }
}

@media (max-width: 480px) {
    .vr-topbar__items {
        justify-content: center;
    }

    .vr-topbar__item:nth-child(2) {
        display: none;
    }

    .vr-mobile-menu__panel {
        width: 100%;
        max-width: 100%;
    }

    /* Smaller shadow on mobile when scrolled */
    .vr-header.vr-header--scrolled {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }
}

/* ============================================
   BODY LOCK (when mobile menu is open)
   ============================================ */
body.vr-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
    /* Prevent horizontal scroll on iOS */
    max-width: 100vw;
    left: 0;
    right: 0;
}

/* Prevent iOS bounce/overscroll when menu is open */
body.vr-menu-open,
body.vr-menu-open html {
    overscroll-behavior: none;
    /* Additional iOS fixes */
    -webkit-overflow-scrolling: none;
}

/* Ensure html doesn't cause overflow issues */
html {
    overflow-x: hidden;
    max-width: 100%;
}

/* Fix for iOS Safari/Chrome issues */
@supports (-webkit-touch-callout: none) {
    .vr-mobile-menu {
        height: -webkit-fill-available;
        /* Prevent extending past viewport on iOS */
        max-width: 100vw;
        overflow-x: hidden;
    }

    .vr-mobile-menu__panel {
        max-height: -webkit-fill-available;
        /* iOS safe area for bottom notch/home indicator */
        padding-bottom: env(safe-area-inset-bottom, 0);
        /* Prevent horizontal overflow */
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Ensure actions stay at bottom on iOS */
    .vr-mobile-menu__actions {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
        /* Prevent any overflow issues */
        width: 100%;
        box-sizing: border-box;
    }

    /* Fix body scroll lock on iOS */
    body.vr-menu-open {
        position: fixed;
        left: 0;
        right: 0;
        overflow: hidden;
        -webkit-overflow-scrolling: none;
    }
}

/* Additional iOS Chrome specific fixes */
@media screen and (max-width: 768px) {
    .vr-mobile-menu {
        /* Use fixed positioning with explicit bounds */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }

    .vr-mobile-menu__panel {
        /* Contain within viewport */
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        height: 100%;
        /* Prevent content from extending beyond panel */
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vr-mobile-menu__actions {
        /* Ensure buttons don't overflow */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .vr-mobile-menu__btn {
        /* Prevent text/content overflow */
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Quality section should not overflow */
    .vr-mobile-menu__quality {
        width: calc(100% - 40px);
        max-width: calc(100% - 40px);
        box-sizing: border-box;
        flex-shrink: 0;
    }
}

.ct-footer .ct-widget:not(:first-child){
    margin-top: 10px!important;
}
.sale-price{
    justify-content: normal!important;
}