/* =========================================================
   CouponsHaven - Customer Header
   Protruding logo card + compact icon navigation
   ========================================================= */

.site-header {
    position: relative;
    z-index: 1000;
    isolation: isolate;
    width: 100%;
    overflow: visible;
    background:
        radial-gradient(ellipse 260px 125px at 0% 0%, rgba(255, 132, 55, 0.15), transparent 73%),
        radial-gradient(ellipse 300px 135px at 100% 100%, rgba(255, 106, 0, 0.11), transparent 73%),
        #fff;
    border-bottom: 1px solid #f1e6dd;
    box-shadow: 0 4px 16px rgba(40, 25, 12, 0.045);
}

.header-container {
    width: calc(100% - 20px);
    max-width: 1540px;
    min-height: 82px;
    height: 82px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-sizing: border-box;
}

/* Protruding logo card */
.site-logo {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    flex: 0 0 245px;
    width: 245px;
    height: 104px;
    box-sizing: border-box;
    margin: 0 0 -22px;
    padding: 8px 10px 10px;
    line-height: 0;
    text-decoration: none;
    background: #fff;
    border: 1.5px solid #ff8a35;
    border-top: 0;
    border-radius: 0 0 28px 28px;
    box-shadow:
        0 8px 18px rgba(255, 106, 0, 0.13),
        0 3px 9px rgba(26, 26, 26, 0.055);
}

.site-logo picture {
    display: block;
    width: 100%;
    height: 100%;
}

.site-logo-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

.site-logo:hover {
    text-decoration: none;
}

/* Navigation: icon is the visual anchor; text is slightly smaller */
.main-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
}

.main-navigation a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #374151;
    font-size: 14px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.main-navigation a .nav-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: #707986;
    stroke-width: 1.9;
    transition: color 0.2s ease, transform 0.2s ease;
}

.main-navigation a span {
    display: inline-block;
    font-size: 0.95em;
    line-height: 1.15;
}

.main-navigation a:hover {
    color: #ed6500;
    background: rgba(255, 246, 238, 0.94);
    border-color: #ffeadb;
    transform: translateY(-1px);
}

.main-navigation a:hover .nav-icon {
    color: #ed6500;
}

.main-navigation a.active {
    color: #ed6500;
    background: #fff3e9;
    border-color: #ffdfc7;
}

.main-navigation a.active .nav-icon {
    color: #ed6500;
}

/* Mobile menu button */
.mobile-menu-toggle {
    display: none;
    flex-shrink: 0;
    width: 43px;
    height: 43px;
    padding: 9px;
    border: 1px solid #f0d9c8;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.94);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(40, 25, 12, 0.045);
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    border-radius: 2px;
    background: #343a40;
}

/* Keyboard focus */
.site-logo:focus-visible,
.main-navigation a:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 2px solid #ff6a00;
    outline-offset: 3px;
}

/* Compact desktop and tablet */
@media (max-width: 1180px) and (min-width: 761px) {
    .header-container {
        width: calc(100% - 16px);
        gap: 8px;
    }

    .site-logo {
        flex-basis: 205px;
        width: 205px;
        height: 96px;
        margin-bottom: -18px;
        padding: 7px 8px 9px;
        border-radius: 0 0 23px 23px;
    }

    .main-navigation {
        gap: 1px;
    }

    .main-navigation a {
        gap: 4px;
        min-height: 40px;
        padding: 0 6px;
        font-size: 12px;
    }

    .main-navigation a .nav-icon {
        width: 17px;
        height: 17px;
        flex-basis: 17px;
    }

    .main-navigation a span {
        font-size: 0.94em;
    }
}

/* Mobile: keep the familiar clean logo and dropdown navigation */
@media (max-width: 760px) {
    .site-header {
        background:
            radial-gradient(ellipse 190px 85px at 0% 0%, rgba(255, 132, 55, 0.13), transparent 75%),
            radial-gradient(ellipse 190px 85px at 100% 100%, rgba(255, 106, 0, 0.09), transparent 75%),
            #fff;
    }

    .header-container {
        position: relative;
        width: calc(100% - 22px);
        min-height: 70px;
        height: 70px;
        gap: 12px;
    }

    .site-logo {
        align-self: center;
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        height: auto;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .site-logo picture {
        width: auto;
        height: auto;
    }

    .site-logo-image {
        width: auto;
        height: 48px;
        max-width: min(72vw, 290px);
        object-position: left center;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: -1px;
        right: -1px;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        padding: 9px;
        border: 1px solid #f0dfd2;
        border-top: 0;
        border-radius: 0 0 14px 14px;
        background: #fff;
        box-shadow: 0 14px 28px rgba(35, 25, 15, 0.11);
    }

    .main-navigation.is-open {
        display: flex;
    }

    .main-navigation a {
        width: 100%;
        min-height: 46px;
        box-sizing: border-box;
        justify-content: flex-start;
        gap: 7px;
        padding: 0 14px;
        border-radius: 9px;
        font-size: 14px;
    }

    .main-navigation a .nav-icon {
        width: 19px;
        height: 19px;
        flex-basis: 19px;
    }

    .main-navigation a span {
        font-size: 0.95em;
    }
}

@media (max-width: 420px) {
    .header-container {
        width: calc(100% - 18px);
        min-height: 64px;
        height: 64px;
    }

    .site-logo-image {
        height: 48px;
        max-width: 73vw;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .main-navigation a,
    .main-navigation a .nav-icon {
        transition: none;
    }
}
