/*
 * Theme Name: Narad-WP
 * Component: Global Headers
 * Description: Native Vanilla CSS styling for the 3 distinct header layouts.
 */

:root {
    --nrd-hdr-max-width: 1280px;
    --nrd-hdr-mag-primary: #4f46e5;
    /* indigo-600 */
    --nrd-hdr-agc-primary: #059669;
    /* emerald-600 */
    --nrd-hdr-shp-primary: #ff3366;
    /* pinkish-red */
    --nrd-nav-bg: #ffffff;
    --nrd-nav-text: #1f2937;
}

/* Base generic classes */
.narad-container {
    max-width: var(--nrd-hdr-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.narad-site-title {
    font-size: 2.25rem;
    font-weight: 900;
    color: #111827;
    /* gray-900 */
    text-decoration: none;
    line-height: 1.1;
}

/* Base Logo Constraints */
.narad-site-logo {
    display: inline-block;
}

.narad-site-logo img,
.custom-logo {
    max-height: 40px;
    /* Greatly reduced from 80px */
    width: auto;
    display: block;
}

/* WordPress Default Menu CSS Reset */
.narad-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
    height: 100%;
}

.narad-menu>li {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.narad-menu li a {
    text-decoration: none;
    font-weight: 700;
    color: var(--nrd-nav-text);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Dropdown Arrow for parent items */
.narad-menu li.menu-item-has-children>a::after {
    content: '\f078';
    /* FontAwesome chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    margin-left: 0.375rem;
    /* ml-1.5 */
    opacity: 0.7;
    transition: transform 0.3s ease;
}

/* Submenu reset */
.narad-menu li ul {
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    margin: 0;
    padding: 1rem;
    background: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
    border-radius: 0.25rem;
    min-width: 220px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.narad-menu li:hover>ul,
.narad-menu li.focus>ul,
.narad-menu li.focus-within>ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.narad-menu li ul li {
    display: block;
    height: auto;
    position: relative;
}

.narad-menu li ul li a {
    padding: 0.75rem 0;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    /* gray-700 */
    border-bottom: 1px solid #f8fafc;
    /* slate-50 */
    height: auto;
}

.narad-menu li ul li:last-child a {
    border-bottom: none;
}

.narad-menu li ul li a:hover {
    color: var(--nrd-hdr-mag-primary) !important;
}

/* Nested Sub-menus: Fly out to the right on desktop */
.narad-menu li ul li.menu-item-has-children>a::after {
    content: '\f054';
    /* FontAwesome chevron-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 9px;
    margin-left: auto;
    padding-left: 0.75rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.narad-menu li ul li.menu-item-has-children:hover>a::after {
    opacity: 1;
}

.narad-menu li ul ul {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 4px;
    z-index: 51;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

/* Mobile Toggle Button */
.narad-mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #111827;
}

/* Dynamic Mobile Menu Open State */
#site-navigation.toggled {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    border-top: none;
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    animation: narad-slide-right 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: left;
    overflow-y: auto;
}

@keyframes narad-slide-right {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Menu Inner Header (Logo + Close) */
#site-navigation.toggled .narad-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

#site-navigation.toggled .narad-mobile-brand {
    display: block;
    text-decoration: none;
    font-size: 1.5rem;
    /* Fallback for text title */
    font-weight: 900;
    color: #111827;
}

#site-navigation.toggled .narad-mobile-brand img {
    max-height: 40px;
    width: auto;
    display: block;
}

#site-navigation.toggled .narad-mobile-close-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    border: none;
    font-size: 1.25rem;
    color: #111827;
    cursor: pointer;
    transition: background 0.2s ease;
    margin: 0;
    /* Override old margins */
}

#site-navigation.toggled .narad-mobile-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

#site-navigation.toggled .narad-menu {
    flex-direction: column;
    gap: 0;
    padding: 0 1rem 2rem;
}

#site-navigation.toggled .narad-menu>li {
    width: 100%;
    padding: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#site-navigation.toggled .narad-menu>li>a {
    padding: 1rem 0.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 1.125rem;
    font-weight: 600;
}

#site-navigation.toggled .narad-menu li ul {
    position: static;
    box-shadow: none;
    border: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 0;
    margin: 0 0 1rem 0;
    background-color: rgba(0, 0, 0, 0.04);
    /* Subtle glass for submenus */
    border-radius: 0.5rem;
    display: none;
}

#site-navigation.toggled .narad-menu li ul li a {
    padding: 0.75rem 1rem;
    font-size: 0.95rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

#site-navigation.toggled .narad-menu li.focus>ul,
#site-navigation.toggled .narad-menu li.focus-within>ul,
#site-navigation.toggled .narad-menu li:hover>ul {
    display: block;
}

@media (min-width: 768px) {
    .narad-mobile-menu-toggle {
        display: none;
    }

    .narad-main-navigation {
        display: flex !important;
        position: static;
        width: auto;
        box-shadow: none;
        border: none;
    }

    .narad-mobile-menu-header {
        display: none !important;
    }
}

/* ==========================================================================
   1. The Magazine Header (Content & Structure)
   ========================================================================== */
.narad-header-magazine-wrapper {
    font-family: var(--nrd-font-sans, 'Inter', sans-serif);
    background-color: #ffffff;
}

.narad-header-magazine {
    position: relative;
}

/* Top Bar */
.narad-mag-topbar {
    background-color: #0f172a;
    /* slate-900 */
    color: #cbd5e1;
    /* slate-300 */
    font-size: 0.75rem;
    font-weight: 500;
}

.narad-mag-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.narad-mag-topbar-left,
.narad-mag-topbar-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.narad-mag-toplink {
    display: none;
}

@media (min-width: 768px) {
    .narad-mag-toplink {
        display: inline-block;
        border-left: 1px solid #334155;
        /* slate-700 */
        padding-left: 1rem;
    }
}

.narad-mag-toplink a,
.narad-mag-topbar-right a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.narad-mag-toplink a:hover,
.narad-mag-topbar-right a:hover {
    color: #ffffff;
}

/* Logo Area */
.narad-mag-logo-area {
    display: none;
    /* Hide entirely on mobile */
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    /* slate-100 */
}

@media (min-width: 768px) {
    .narad-mag-logo-area {
        display: block;
        /* Show on tablet/desktop */
    }
}

.narad-header-magazine .narad-site-title {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: -0.05em;
}

.narad-header-magazine .narad-site-logo img,
.narad-header-magazine .custom-logo {
    max-height: 60px;
    /* Magazine logo can be slightly larger */
    margin: 0 auto;
}

.narad-site-description {
    font-size: 0.875rem;
    color: #64748b;
    /* slate-500 */
    font-weight: 500;
    margin: 0.25rem 0 0 0;
}

/* Nav Bar */
.narad-mag-navbar-wrapper {
    background-color: #ffffff;
    border-bottom: 2px solid #0f172a;
    /* bold line */
}

.narad-mag-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
    /* h-16 */
}

.narad-main-navigation {
    display: none;
    /* Hidden on mobile by default */
    height: 100%;
}

.narad-header-magazine .narad-menu {
    gap: 2rem;
}

.narad-header-magazine .narad-menu>li>a {
    font-size: 0.875rem;
    color: #1f2937;
    /* gray-800 */
    border-bottom: 2px solid transparent;
}

.narad-header-magazine .narad-menu>li:hover>a,
.narad-header-magazine .narad-menu>li.current-menu-item>a {
    color: var(--nrd-hdr-mag-primary);
    border-bottom-color: var(--nrd-hdr-mag-primary);
}

.narad-mag-nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.narad-mag-search-btn {
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.narad-mag-search-btn:hover {
    color: var(--nrd-hdr-mag-primary);
}

.narad-mag-subscribe-btn {
    display: none;
}

@media (min-width: 1024px) {
    .narad-mag-subscribe-btn {
        display: inline-block;
        background-color: #0f172a;
        color: #ffffff;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 0.5rem 1rem;
        border-radius: 0.125rem;
        text-decoration: none;
        transition: background-color 0.3s ease;
    }

    .narad-mag-subscribe-btn:hover {
        background-color: var(--nrd-hdr-mag-primary);
    }
}

/* Magazine Dropdown Search Block */
.narad-mag-search-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 90;
    padding: 1.5rem 0;
    border-top: 1px solid #e2e8f0;
    /* slate-200 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.narad-mag-search-wrapper.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.narad-search-form {
    display: flex;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.narad-search-field {
    width: 100%;
    background-color: #f1f5f9;
    /* slate-100 */
    border: 2px solid transparent;
    border-radius: 9999px;
    padding: 1rem 4rem 1rem 1.5rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    color: #1e293b;
    /* slate-800 */
}

.narad-search-field:focus {
    border-color: var(--nrd-hdr-mag-primary);
}

.narad-search-submit {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--nrd-hdr-mag-primary);
    color: #ffffff;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.narad-search-submit:hover {
    background: #4338ca;
    /* indigo-700 */
}


/* ==========================================================================
   2. The Agency Header (Clean, Pill-shaped)
   ========================================================================== */
.narad-header-agency-wrapper {
    font-family: var(--nrd-font-sans, 'Inter', sans-serif);
    position: relative;
    z-index: 50;
    padding-top: 1rem;
}

.narad-header-agency {
    position: relative;
}

/* Reset title & Logo for Agency to be smaller and left-aligned */
.narad-header-agency .narad-site-title {
    font-size: 1.5rem;
    margin: 0;
}

.narad-header-agency .narad-site-logo img,
.narad-header-agency .custom-logo {
    max-height: 40px;
    /* Small discrete logo */
}

.narad-agency-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 5rem;
    /* h-20 */
    background-color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    padding: 0 1.5rem;
    border: 1px solid #f1f5f9;
}

@media (min-width: 1024px) {
    .narad-agency-navbar {
        padding: 0 2rem;
    }
}

.narad-agency-navigation {
    display: none;
    height: 100%;
}

@media (min-width: 1024px) {
    .narad-agency-navigation {
        display: flex;
    }
}

.narad-header-agency .narad-menu {
    gap: 2.5rem;
}

.narad-header-agency .narad-menu>li>a {
    font-size: 0.875rem;
    color: #475569;
    /* slate-600 */
}

.narad-header-agency .narad-menu>li:hover>a,
.narad-header-agency .narad-menu>li.current-menu-item>a {
    color: var(--nrd-hdr-agc-primary);
}

.narad-agency-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.narad-agency-cta-btn {
    display: none;
}

@media (min-width: 768px) {
    .narad-agency-cta-btn {
        display: inline-block;
        background-color: #0f172a;
        color: #ffffff;
        font-size: 0.875rem;
        font-weight: 700;
        padding: 0.75rem 1.5rem;
        border-radius: 9999px;
        /* full */
        text-decoration: none;
        transition: all 0.2s ease;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .narad-agency-cta-btn:hover {
        background-color: var(--nrd-hdr-agc-primary);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }
}


/* ==========================================================================
   3. The Shop Header (Utility & Search Heavy)
   ========================================================================== */
.narad-header-shop-wrapper {
    font-family: 'Outfit', var(--nrd-font-sans, sans-serif);
    background-color: #ffffff;
}

.narad-header-shop {
    border-bottom: 4px solid #111827;
    /* gray-900 border */
    position: relative;
}

.narad-shop-utility-row {
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
    /* gray-100 */
}

.narad-shop-utility-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .narad-shop-utility-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.narad-shop-brand-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

@media (min-width: 768px) {
    .narad-shop-brand-area {
        width: auto;
        justify-content: flex-start;
        gap: 1rem;
    }
}

.narad-header-shop .narad-site-title {
    text-transform: none;
}

.narad-header-shop .narad-site-logo img,
.narad-header-shop .custom-logo {
    max-height: 48px;
}

.narad-shop-mobile-cart {
    display: flex;
    font-size: 1.25rem;
    color: #111827;
    position: relative;
    text-decoration: none;
}

@media (min-width: 768px) {
    .narad-shop-mobile-cart {
        display: none;
    }
}

.narad-shop-cart-count {
    background-color: var(--nrd-hdr-shp-primary);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: -0.25rem;
    right: -0.5rem;
}

/* Search Area */
.narad-shop-search-area {
    flex-grow: 1;
    display: none;
}

@media (min-width: 768px) {
    .narad-shop-search-area {
        display: block;
        max-width: 36rem;
        /* max-w-xl */
    }
}

@media (min-width: 1024px) {
    .narad-shop-search-area {
        max-width: 42rem;
    }
}

.narad-shop-search-form {
    display: flex;
    width: 100%;
    position: relative;
}

.narad-shop-search-field {
    background-color: #f3f4f6;
    /* gray-100 */
    height: 3rem;
    /* h-12 */
    padding: 0 3rem 0 1.25rem;
    border-radius: 9999px;
    /* full */
    font-size: 0.875rem;
    color: #4b5563;
    /* gray-600 */
    border: 1px solid transparent;
    width: 100%;
    outline: none;
    transition: border-color 0.3s ease;
}

.narad-shop-search-field:focus {
    border-color: var(--nrd-hdr-shp-primary);
}

.narad-shop-search-submit {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 1rem;
    background: transparent;
    border: none;
    color: #6b7280;
    /* gray-500 */
    cursor: pointer;
    transition: color 0.3s ease;
}

.narad-shop-search-submit i {
    border-left: 1px solid #d1d5db;
    /* border-gray-300 */
    padding-left: 1rem;
    margin-top: 0.25rem;
}

.narad-shop-search-submit:hover {
    color: var(--nrd-hdr-shp-primary);
}


/* User Actions (Desktop right side) */
.narad-shop-user-actions {
    display: none;
}

@media (min-width: 768px) {
    .narad-shop-user-actions {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
}

.narad-shop-action-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #374151;
    /* gray-700 */
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
    /* Needed since fallback might be divs */
}

.narad-shop-action-icon:hover {
    color: var(--nrd-hdr-shp-primary);
}

.narad-shop-action-icon i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.narad-shop-action-icon:hover i {
    transform: translateY(-2px);
}

.narad-shop-action-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Category Nav Below */
@media (max-width: 767px) {
    .narad-shop-cat-nav-wrapper {
        display: block;
    }

    .narad-shop-cat-navigation {
        display: none;
    }
}

@media (min-width: 768px) {
    .narad-shop-cat-nav-wrapper {
        display: block;
        height: 3rem;
        /* h-12 */
    }
}

.narad-shop-cat-navigation {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.narad-header-shop .narad-menu {
    gap: 2rem;
    justify-content: center;
}

.narad-header-shop .narad-menu>li>a {
    font-size: 0.875rem;
    color: #4b5563;
    /* gray-600 */
}

.narad-header-shop .narad-menu>li:hover>a,
.narad-header-shop .narad-menu>li.current-menu-item>a {
    color: var(--nrd-hdr-shp-primary);
}


/* ==========================================================================
   4. User Alert & Animations (Plugin Missing Fallback)
   ========================================================================== */

/* Shaking Animation for interactions when dependencies are missing */
@keyframes narad-shakeAlert {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
        color: #dc2626;
    }

    /* Shake left and turn red */
    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
        color: #dc2626;
    }

    /* Shake right and turn red */
}

/* 
 * Apply this class dynamically in PHP when WooCommerce is missing 
 * and attach it to the cart/account buttons.
 */
.narad-plugin-missing:active {
    animation: narad-shakeAlert 0.4s cubic-bezier(.36, .07, .19, .97) both;
}