/* ============================================================
   GRECY HOMEWARE — Premium Custom Header
   Fully Responsive: Desktop → Tablet → Mobile
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --grecy-primary: #E84C3D;
    --grecy-primary-dark: #C0392B;
    --grecy-dark: #1a1a2e;
    --grecy-dark-alt: #16213e;
    --grecy-text: #2c3e50;
    --grecy-text-light: #7f8c8d;
    --grecy-white: #ffffff;
    --grecy-light-bg: #f8f9fa;
    --grecy-border: #e9ecef;
    --grecy-accent: #e67e22;
    --grecy-gradient: linear-gradient(135deg, #E84C3D 0%, #e67e22 100%);
    --grecy-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --grecy-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Hide old Elementor header completely */
header.site-header.tf-custom-header {
    display: none !important;
}

/* ===== HEADER WRAPPER ===== */
.grecy-header-wrap {
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TOP BAR ===== */
.grecy-topbar {
    background: var(--grecy-dark);
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    padding: 0;
    position: relative;
    z-index: 1001;
}

.grecy-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grecy-topbar-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.grecy-topbar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.3s ease;
}

.grecy-topbar-item:hover {
    color: var(--grecy-primary);
}

.grecy-topbar-item i {
    color: var(--grecy-primary);
    font-size: 14px;
}

.grecy-topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.grecy-topbar-social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.grecy-topbar-social a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.grecy-topbar-social a:hover {
    color: var(--grecy-white);
    background: var(--grecy-primary);
    transform: translateY(-2px);
}

/* ===== MAIN HEADER ===== */
.grecy-main-header {
    background: var(--grecy-white);
    box-shadow: var(--grecy-shadow);
    position: relative;
    z-index: 1000;
    font-family: 'Outfit', sans-serif;
}

.grecy-main-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 75px;
}

/* Logo */
.grecy-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.grecy-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.grecy-logo img {
    height: 55px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.grecy-logo:hover img {
    transform: scale(1.05);
}

/* Main Navigation */
.grecy-main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.grecy-main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.grecy-main-nav ul li {
    position: relative;
}

.grecy-main-nav ul li a {
    display: flex;
    align-items: center;
    padding: 26px 18px;
    color: var(--grecy-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.grecy-main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--grecy-gradient);
    transition: width 0.3s ease;
    border-radius: 3px 3px 0 0;
}

.grecy-main-nav ul li a:hover,
.grecy-main-nav ul li.grecy-active a {
    color: var(--grecy-primary);
}

.grecy-main-nav ul li a:hover::after,
.grecy-main-nav ul li.grecy-active a::after {
    width: 100%;
}

/* Products Dropdown */
.grecy-main-nav ul li.grecy-has-mega {
    position: static;
}

.grecy-main-nav ul li.grecy-has-mega > a .grecy-dropdown-arrow {
    margin-left: 5px;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.grecy-main-nav ul li.grecy-has-mega:hover > a .grecy-dropdown-arrow {
    transform: rotate(180deg);
}

/* Mega Menu Dropdown */
.grecy-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--grecy-white);
    box-shadow: var(--grecy-shadow-lg);
    border-top: 3px solid var(--grecy-primary);
    padding: 30px;
    display: none;
    z-index: 999;
    animation: grecySlideDown 0.3s ease;
}

@keyframes grecySlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.grecy-main-nav ul li.grecy-has-mega:hover .grecy-mega-menu {
    display: block;
}

.grecy-mega-menu-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.grecy-mega-menu-item a {
    display: flex !important;
    align-items: center;
    padding: 10px 16px !important;
    color: var(--grecy-text) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    border-radius: 8px;
    transition: all 0.3s ease !important;
    background: transparent;
    gap: 10px;
}

.grecy-mega-menu-item a::before {
    content: '\f105';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
    color: var(--grecy-primary);
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
}

.grecy-mega-menu-item a::after {
    display: none !important;
}

.grecy-mega-menu-item a:hover {
    background: var(--grecy-light-bg) !important;
    color: var(--grecy-primary) !important;
    padding-left: 12px !important;
}

.grecy-mega-menu-item a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Contact Us Button */
.grecy-header-cta {
    margin-left: 15px;
}

.grecy-header-cta a {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 24px !important;
    background: var(--grecy-gradient) !important;
    color: var(--grecy-white) !important;
    border-radius: 50px;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 76, 61, 0.35);
    text-decoration: none;
}

.grecy-header-cta a::after {
    display: none !important;
}

.grecy-header-cta a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 76, 61, 0.45);
}

.grecy-header-cta a i {
    font-size: 12px;
}

/* ===== MOBILE MENU TOGGLE (Hamburger) ===== */
.grecy-mobile-toggle {
    display: none;
    background: transparent !important;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 1050;
    position: relative;
}

.grecy-mobile-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--grecy-dark);
    border-radius: 3px;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.grecy-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
    background: var(--grecy-primary);
}

.grecy-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.grecy-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
    background: var(--grecy-primary);
}

/* ===== MOBILE OVERLAY ===== */
.grecy-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1009;
    transition: background 0.4s ease;
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
}

.grecy-mobile-overlay.active {
    display: block;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

/* ===== STICKY HEADER ===== */
.grecy-main-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    animation: grecyStickyIn 0.4s ease;
    box-shadow: var(--grecy-shadow-lg);
}

.grecy-main-header.sticky + * {
    margin-top: 75px;
}

@keyframes grecyStickyIn {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ================================================================
   RESPONSIVE — TABLET (max 1200px)
   ================================================================ */
@media (max-width: 1200px) {
    .grecy-main-nav ul li a {
        padding: 26px 12px;
        font-size: 13px;
    }
}

/* ================================================================
   RESPONSIVE — TABLET PORTRAIT + MOBILE (max 1024px)
   ================================================================ */
@media (max-width: 1024px) {

    /* --- Top Bar: Custom layout for mobile --- */
    .grecy-topbar-inner {
        flex-direction: column;
        gap: 8px;
        padding: 10px 16px;
        text-align: center;
    }

    .grecy-topbar-left {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        gap: 5px;
    }

    .grecy-topbar-left .grecy-topbar-item {
        font-size: 11px;
    }

    .grecy-topbar-left .grecy-topbar-item span {
        white-space: nowrap;
    }

    .grecy-topbar-right {
        justify-content: center;
        width: 100%;
    }

    /* --- Main Header --- */
    .grecy-main-header-inner {
        padding: 0 16px;
        min-height: 65px;
    }

    .grecy-logo {
        margin-left: 32px;
    }

    .grecy-logo img {
        height: 45px;
    }

    /* --- Show Hamburger --- */
    .grecy-mobile-toggle {
        display: flex;
    }

    /* --- Slide-in Side Panel Nav --- */
    .grecy-main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: var(--grecy-white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 150px 0 0;
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 1010;
        -webkit-overflow-scrolling: touch;
    }

    .grecy-main-nav.mobile-open {
        right: 0;
    }

    /* --- Mobile Nav: Menu List --- */
    .grecy-main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0;
        margin: 0;
    }

    .grecy-main-nav ul li {
        border-bottom: 1px solid var(--grecy-border);
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 20px 24px;
        font-size: 14px;
        font-weight: 600;
        color: var(--grecy-text);
        position: relative;
    }

    .grecy-main-nav ul li:last-child {
        border-bottom: none;
    }

    .grecy-main-nav ul li a {
        color: inherit;
        text-decoration: none;
        display: flex !important;
        justify-content: space-between;
        width: 100%;
    }

    .grecy-main-nav ul li a::after {
        display: none !important;
    }

    .grecy-main-nav ul li a:hover,
    .grecy-main-nav ul li.grecy-active a {
        color: var(--grecy-primary) !important;
        background: rgba(232, 76, 61, 0.04) !important;
    }

    /* --- Products: Left border accent --- */
    .grecy-main-nav ul li.grecy-active a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--grecy-gradient);
        border-radius: 0 4px 4px 0;
    }

    /* --- Mobile Dropdown Arrow --- */
    .grecy-main-nav ul li.grecy-has-mega > a .grecy-dropdown-arrow {
        transition: transform 0.3s ease;
        font-size: 12px;
        margin-left: auto;
        padding-left: 10px;
    }

    .grecy-main-nav ul li.grecy-has-mega.mobile-open > a .grecy-dropdown-arrow {
        transform: rotate(180deg);
    }

    /* --- Mega Menu inside Side Panel --- */
    .grecy-mega-menu {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        box-shadow: none;
        border-top: none;
        padding: 0;
        display: none;
        animation: none;
        background: var(--grecy-light-bg);
        border-radius: 0;
    }

    .grecy-main-nav ul li.grecy-has-mega.mobile-open .grecy-mega-menu {
        display: block;
    }

    .grecy-mega-menu-inner {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 6px 0;
    }

    .grecy-mega-menu-item a {
        padding: 13px 20px 13px 36px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        color: var(--grecy-text-light) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
        border-radius: 0 !important;
    }

    .grecy-mega-menu-item a::before {
        content: '\f105';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 10px;
        color: var(--grecy-primary);
        opacity: 1;
        transform: none;
        margin-right: 8px;
        flex-shrink: 0;
    }

    .grecy-mega-menu-item a:hover,
    .grecy-mega-menu-item a:active {
        background: rgba(232, 76, 61, 0.06) !important;
        color: var(--grecy-primary) !important;
    }

    .grecy-mega-menu-item:last-child a {
        border-bottom: none !important;
    }

    /* --- CTA Button in Side Panel --- */
    .grecy-header-cta {
        margin: auto 20px 30px;
        width: auto;
    }

    .grecy-header-cta a {
        justify-content: center;
        width: 100%;
        padding: 14px 24px !important;
        font-size: 14px !important;
        border-radius: 12px;
    }
}

/* ================================================================
   RESPONSIVE — SMALL MOBILE (max 600px)
   ================================================================ */
@media (max-width: 600px) {

    /* --- Top Bar: Compact --- */
    .grecy-topbar-inner {
        padding: 8px 8px;
        gap: 6px;
    }

    .grecy-topbar-left {
        flex-direction: row;
        gap: 2px;
    }

    .grecy-topbar-item {
        font-size: 10px;
        gap: 4px;
    }

    .grecy-topbar-item i {
        font-size: 12px;
    }

    .grecy-topbar-social a {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .grecy-topbar-social {
        gap: 6px;
    }

    /* --- Main Header: Compact --- */
    .grecy-main-header-inner {
        min-height: 56px;
        padding: 0 12px;
    }

    .grecy-logo {
        margin-left: 28px;
    }

    .grecy-logo img {
        height: 38px;
    }

    /* --- Side Panel wider relative to screen --- */
    .grecy-main-nav {
        width: 280px;
        max-width: 85vw;
    }

    .grecy-main-nav::before {
        min-height: 56px;
    }

    .grecy-main-nav ul li a {
        padding: 14px 18px;
        font-size: 13px;
    }

    .grecy-mega-menu-item a {
        padding: 11px 16px 11px 30px !important;
        font-size: 12px !important;
    }

    .grecy-header-cta {
        margin: 16px 16px 24px;
    }

    .grecy-header-cta a {
        padding: 12px 20px !important;
        font-size: 13px !important;
    }

    /* Sticky fix on small screens */
    .grecy-main-header.sticky + * {
        margin-top: 56px;
    }
}

/* ================================================================
   RESPONSIVE — VERY SMALL MOBILE (max 400px)
   ================================================================ */
@media (max-width: 400px) {
    .grecy-topbar-inner {
        padding: 6px 10px;
    }

    .grecy-topbar-item span {
        font-size: 10px;
    }

    .grecy-logo img {
        height: 34px;
    }

    .grecy-main-header-inner {
        min-height: 50px;
        padding: 0 10px;
    }

    .grecy-main-nav::before {
        min-height: 50px;
    }
}

/* ===== WordPress Admin Bar Fix ===== */
body.admin-bar .grecy-main-header.sticky {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .grecy-main-header.sticky {
        top: 46px;
    }
}