/* =========================================
   Stealth Nano Header Pro - Core Styles
   ========================================= */

/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables - Defaults (overridden by admin settings via wp_head) */
:root {
    --shf-bg: rgba(5, 5, 5, 0.85);
    --shf-border: rgba(255, 255, 255, 0.1);
    --shf-text: #888888;
    --shf-text-active: #ffffff;
    --shf-accent: #00ff9d;
    --shf-font: 'Inter', sans-serif;
    --shf-nav-size: 12px;
    --shf-logo-size: 18px;
    --shf-btn-size: 11px;
    --shf-nav-gap: 40px;
    --shf-btn-padding: 0 20px;
    --shf-header-height: 60px;
    --shf-blur: 10px;
}

/* ============================================
   NANO HEADER CONTAINER
   ============================================ */
.shf-nano-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2147483647;
    min-width: 800px;
    max-width: 95vw;
    height: var(--shf-header-height, 60px);
    border-radius: 100px;
    padding: 0 10px 0 30px;

    /* Glassmorphism - background/border controlled by widget or wp_head CSS */
    /* background: var(--shf-bg); - REMOVED: Let Elementor control this */
    /* border: 1px solid var(--shf-border); - REMOVED: Let Elementor control this */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(var(--shf-blur, 10px));
    -webkit-backdrop-filter: blur(var(--shf-blur, 10px));

    display: flex;
    align-items: center;
    justify-content: space-between;

    pointer-events: none;
    /* Container passes clicks through */
    font-family: var(--shf-font, 'Inter', sans-serif);
    box-sizing: border-box;

    /* Default fallback colors - will be overridden by widget or wp_head */
    background: rgba(5, 5, 5, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shf-nano-header * {
    pointer-events: auto;
    /* Children capture clicks */
}

/* WordPress Admin Bar Compatibility */
body.admin-bar .shf-nano-header {
    top: 52px;
}

@media (max-width: 782px) {
    body.admin-bar .shf-nano-header {
        top: 66px;
    }
}

/* ============================================
   NANO FOOTER CONTAINER (NEW)
   ============================================ */
.shf-nano-footer {
    position: fixed;
    bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    top: auto !important;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2147483647;
    /* PHP_INT_MAX equivalent */
    min-width: 800px;
    max-width: 95vw;
    height: var(--shf-header-height);
    border-radius: 100px;
    padding: 0 30px;

    /* Glassmorphism */
    background: var(--shf-bg);
    border: 1px solid var(--shf-border);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(var(--shf-blur));
    -webkit-backdrop-filter: blur(var(--shf-blur));

    display: flex;
    align-items: center;
    justify-content: space-between;

    pointer-events: auto !important;
    font-family: var(--shf-font);
    box-sizing: border-box;
}

/* Ensure Custom Content is centered despite space-between */
.shf-nano-footer .shf-custom-content {
    margin: 0 auto;
}

/* Static (non-fixed) positioning override */
/* Static (non-fixed) positioning override */
.shf-nano-header.shf-nano-static,
.shf-nano-footer.shf-nano-static {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 20px auto;
}

/* ============================================
   LEFT SIDE (LOGO + NAV)
   ============================================ */
.shf-nano-left,
.shf-nano-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.shf-nano-left {
    gap: var(--shf-nav-gap);
}

/* ============================================
   LOGO
   ============================================ */
.shf-logo {
    font-weight: 800;
    color: var(--shf-text-active);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: var(--shf-logo-size);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.shf-logo:hover {
    opacity: 0.85;
    color: var(--shf-text-active);
}

.shf-logo-icon {
    width: 32px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' rx='5' fill='white'/%3E%3Cpath d='M12 2L20 6L12 10L4 6Z' fill='black'/%3E%3Cpath d='M4 11L12 15L20 11L20 8.5L12 12.5L4 8.5Z' fill='black'/%3E%3Cpath d='M4 16L12 20L20 16L20 13.5L12 17.5L4 13.5Z' fill='black'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.shf-logo-img {
    max-height: 36px;
    width: auto;
    display: block;
}

/* ============================================
   NAVIGATION (Slash Divider Style)
   ============================================ */
.shf-nav {
    display: flex;
    align-items: center;
}

.shf-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.shf-nav li {
    display: flex;
    align-items: center;
    position: relative;
}

.shf-nav li a {
    padding: 0 15px;
    font-size: var(--shf-nav-size);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--shf-text);
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
}

.shf-nav li a:hover {
    color: var(--shf-text-active);
}

/* Slash Divider - Applied to all items except first */
.shf-nav li:not(:first-child)::before {
    content: '/';
    color: var(--shf-border);
    margin-left: -5px;
    font-weight: 300;
    pointer-events: none;
}

/* Option to hide dividers */
.shf-nano-header.shf-no-dividers .shf-nav li:not(:first-child)::before {
    display: none;
}

/* Submenu Support */
.shf-nav li .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5, 5, 5, 0.95);
    border: 1px solid var(--shf-border);
    border-radius: 12px;
    padding: 10px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100000;
    list-style: none;
    margin: 10px 0 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.shf-nav li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
}

.shf-nav li .sub-menu li {
    display: block;
}

.shf-nav li .sub-menu li::before {
    display: none;
}

.shf-nav li .sub-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 11px;
}

.shf-nav li .sub-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   RIGHT SIDE BUTTONS (Cart + Account)
   ============================================ */
.shf-nano-right {
    gap: 10px;
}

.shf-btn-cart,
.shf-btn-account {
    background: rgba(255, 255, 255, 0.08);
    color: var(--shf-text-active);
    border: 1px solid var(--shf-border);
    border-radius: 100px;
    padding: var(--shf-btn-padding);
    height: 40px;
    font-size: var(--shf-btn-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    font-family: var(--shf-font);
    box-sizing: border-box;
    white-space: nowrap;
}

.shf-btn-cart:hover,
.shf-btn-account:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: var(--shf-text-active);
    transform: translateY(-1px);
}

.shf-btn-cart:active,
.shf-btn-account:active {
    transform: translateY(0);
}

/* ============================================
   STATUS DOT (Account Button)
   ============================================ */
.shf-dot {
    width: 6px;
    height: 6px;
    background-color: var(--shf-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--shf-accent);
    flex-shrink: 0;
}

.shf-dot.offline,
.shf-dot.shf-dot-dimmed {
    background: #555;
    box-shadow: none;
}

/* ============================================
   CUSTOM WIDGET ZONE
   ============================================ */
.shf-custom-widget {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shf-custom-widget .widgettitle {
    display: none;
}

/* ============================================
   TYPEWRITER EFFECT
   ============================================ */
.shf-typewriter {
    display: inline-block;
}

.shf-typing::after {
    content: '';
    display: inline-block;
    width: 1ch;
    animation: shf-cursor 0.8s infinite;
}

@keyframes shf-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1024px) {
    .shf-nano-header {
        min-width: 95vw;
        padding: 0 15px 0 20px;
    }

    .shf-nano-footer {
        min-width: 95vw;
        padding: 0 20px;
    }

    .shf-nano-left {
        gap: 20px;
    }

    .shf-nav li a {
        padding: 0 10px;
        font-size: 11px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .shf-nano-header {
        min-width: unset;
        width: calc(100% - 20px);
        height: 50px;
        padding: 0 10px 0 15px;
        top: 10px;
        border-radius: 50px;
    }

    .shf-nano-footer {
        min-width: unset;
        width: calc(100% - 20px);
        height: 50px;
        bottom: 10px;
        padding: 0 15px;
        border-radius: 50px;
    }

    body.admin-bar .shf-nano-header {
        top: 56px;
    }

    .shf-nano-left {
        gap: 15px;
    }

    .shf-logo {
        font-size: 14px;
    }

    .shf-logo-icon {
        width: 24px;
        height: 24px;
    }

    .shf-nav {
        display: none;
    }

    .shf-btn-cart,
    .shf-btn-account {
        height: 34px;
        padding: 0 12px;
        font-size: 10px;
    }

    .shf-nano-footer .shf-custom-content {
        font-size: 10px !important;
    }
}

/* ============================================
   ELEMENTOR EDITOR COMPATIBILITY
   ============================================ */
.elementor-editor-active .shf-nano-header,
.elementor-editor-active .shf-nano-footer {
    position: relative;
    top: 0;
    bottom: auto;
    left: 0;
    transform: none;
    margin: 20px auto;
}

/* Ensure buttons are interactive in Elementor */
.elementor-element .shf-btn-cart,
.elementor-element .shf-btn-account {
    pointer-events: auto !important;
}

/* ============================================
   MINI-CART DROPDOWN (Enhanced V2)
   ============================================ */
.shf-cart-wrapper {
    position: relative;
}

.shf-cart-container {
    position: relative;
    height: 40px;
}

.shf-mini-cart-dropdown,
.shf-mini-cart {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    background: #111111;
    /* Solid Dark Background */
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0;
    margin-top: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 100001;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: visible;
    /* Changed from hidden to visible */
}

/* Hover bridge */
.shf-cart-wrapper::after,
.shf-cart-container::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.shf-cart-wrapper:hover .shf-mini-cart-dropdown,
.shf-cart-wrapper:hover .shf-mini-cart,
.shf-cart-container:hover .shf-mini-cart-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* --- WOOCOMMERCE CART ITEMS STYLING --- */

.widget_shopping_cart_content {
    font-family: 'Inter', sans-serif !important;
}

.woocommerce-mini-cart {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

/* Cart Item Container */
.woocommerce-mini-cart-item {
    padding: 16px 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
    color: #fff !important;
    min-height: 50px;
}

/* Remove 'x' Button */
.woocommerce-mini-cart-item a.remove {
    position: absolute !important;
    left: 15px !important;
    top: 16px !important;
    color: #ff4444 !important;
    background: transparent !important;
    border: none !important;
    font-weight: 300;
    font-size: 18px;
    line-height: 1;
    width: 20px;
    height: 20px;
    text-align: center;
    padding: 0 !important;
    display: block !important;
    transition: color 0.2s;
    z-index: 10;
}

.woocommerce-mini-cart-item a.remove:hover {
    color: #ff0000 !important;
    background: transparent !important;
}

/* Product Images - Default VISIBLE, widget can hide with !important */
.woocommerce-mini-cart-item img {
    display: block;
    visibility: visible;
    object-fit: cover;
    border-radius: 6px;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin-right: 12px;
}

/* Product Name */
.woocommerce-mini-cart-item a:not(.remove) {
    color: #fff !important;
    font-weight: 600;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    padding-left: 24px;
    /* Space for remove button */
    display: block;
    width: 100%;
    margin-bottom: 4px;
}

/* Quantity & Price info */
.woocommerce-mini-cart-item .quantity {
    display: block;
    font-size: 11px !important;
    color: #888;
    padding-left: 24px;
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
}

.woocommerce-mini-cart-item .amount {
    color: #00ff9d !important;
    font-weight: 700;
}

/* Hide Variation Metadata (Billing, etc) */
.woocommerce-mini-cart-item dl.variation {
    display: none !important;
}

/* Image sizing is now controlled via Elementor widget inline styles */


/* Subtotal Section */
.woocommerce-mini-cart__total {
    padding: 16px 20px !important;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 !important;
    background: transparent;
    /* Fixed: Removed color mismatch */
}

.woocommerce-mini-cart__total strong {
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.woocommerce-mini-cart__total .amount {
    font-size: 15px;
    color: #fff !important;
    font-weight: 700;
}

/* Button Container */
.woocommerce-mini-cart__buttons {
    padding: 16px 20px !important;
    display: flex;
    gap: 12px;
    margin: 0 !important;
    background: transparent;
    /* Fixed: Removed color mismatch */
}

/* Button Styles */
.woocommerce-mini-cart__buttons .button {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    color: #fff !important;
    padding: 12px 0;
    border-radius: 8px;
    font-size: 11px !important;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
}

.woocommerce-mini-cart__buttons .button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.woocommerce-mini-cart__buttons .button.checkout {
    background: #fff;
    color: #000 !important;
    border-color: #fff;
}

.woocommerce-mini-cart__buttons .button.checkout:hover {
    background: #e5e5e5;
    border-color: #e5e5e5;
    color: #000 !important;
}

/* Scrollbar Styling - Global & Widget */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ensure no double scrollbar on body */
body {
    overflow-x: hidden;
}

.widget_shopping_cart_content::-webkit-scrollbar {
    width: 4px;
}

.widget_shopping_cart_content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.widget_shopping_cart_content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Mobile Mini Cart */
@media (max-width: 768px) {

    .shf-mini-cart-dropdown,
    .shf-mini-cart {
        width: 280px;
        right: -50px;
    }
}

/* ============================================
   STICKY & TEMPLATE UTILITIES
   ============================================ */
.shf-sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2147483647;
}

.shf-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2147483647;
}

body.shf-has-sticky-footer {
    padding-bottom: var(--shf-footer-height, 60px);
}

body.shf-has-sticky-header {
    padding-top: var(--shf-header-height, 60px);
}