:root {
    --elgatec-action-size: 46px;
    --elgatec-action-radius: 13px;
}

.site-header.elgatec-header-compact-actions .elgatec-header-actions {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 10px !important;
}

.site-header.elgatec-header-compact-actions .elgatec-header-actions > #elgatec-calendar-float {
    order: 1;
}

.site-header.elgatec-header-compact-actions .elgatec-header-actions > .elgatec-header-client {
    order: 2;
}

.site-header.elgatec-header-compact-actions .elgatec-header-actions > .elgatec-header-shop {
    order: 3;
}

.site-header.elgatec-header-compact-actions .elgatec-header-actions > .elgatec-header-cart,
.site-header.elgatec-header-compact-actions .elgatec-header-actions > [data-elgux-header-cart] {
    order: 4;
}

.site-header.elgatec-header-compact-actions .elgatec-header-shop-flip {
    position: relative !important;
    display: block !important;
    flex: 0 0 var(--elgatec-action-size) !important;
    width: var(--elgatec-action-size) !important;
    min-width: var(--elgatec-action-size) !important;
    height: var(--elgatec-action-size) !important;
    min-height: var(--elgatec-action-size) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: var(--elgatec-action-radius) !important;
    background: transparent !important;
    box-shadow: 0 9px 22px rgba(197, 145, 0, 0.18) !important;
    perspective: 620px;
    text-decoration: none !important;
}

.site-header .elgatec-header-shop-flip::after {
    display: none !important;
}

.elgatec-header-shop-flip .elgatec-shop-flipper {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: elgatec-shop-turn 8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.elgatec-header-shop-flip .elgatec-shop-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    box-sizing: border-box;
    border: 1px solid rgba(177, 127, 0, 0.2);
    border-radius: var(--elgatec-action-radius);
    color: #071522;
    background: linear-gradient(145deg, #ffe066, #ffd43b);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.elgatec-header-shop-flip .elgatec-shop-back {
    transform: rotateY(180deg);
}

.elgatec-header-shop-flip .elgatec-shop-face__icon {
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
}

.elgatec-header-shop-flip .elgatec-shop-face__icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.elgatec-header-shop-flip .elgatec-shop-face__label {
    display: block;
    font-size: 7.5px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.02em;
}

body #elgatec-calendar-float.elgatec-calendar-in-nav .back {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

body #elgatec-calendar-float.elgatec-calendar-in-nav .tick {
    flex: 0 0 auto;
    margin: 0 auto 1px !important;
}

body #elgatec-calendar-float.elgatec-calendar-in-nav .tick-text {
    display: block !important;
    width: calc(100% - 8px) !important;
    max-width: calc(100% - 8px) !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: 1 !important;
    white-space: nowrap;
    overflow: hidden !important;
    transform: none !important;
}

@keyframes elgatec-shop-turn {
    0%, 38% { transform: rotateY(0deg); }
    48%, 82% { transform: rotateY(180deg); }
    92%, 100% { transform: rotateY(360deg); }
}

@media (max-width: 1180px) {
    .site-header.elgatec-header-compact-actions .elgatec-header-actions {
        gap: 6px;
    }
}

@media (max-width: 1100px) {
    .site-header.elgatec-header-compact-actions .elgatec-header-actions {
        order: 2;
        margin-left: auto !important;
    }

    .site-header.elgatec-header-compact-actions .nav-toggle {
        order: 3;
        margin-left: 0 !important;
    }

    .site-header.elgatec-header-compact-actions .site-nav {
        inset: var(--header-height) 12px auto !important;
        width: auto !important;
        max-height: calc(100dvh - var(--header-height) - 12px) !important;
        padding: 14px !important;
        overflow-y: auto;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid #b5d1d9 !important;
        border-top-color: #dcecef !important;
        border-radius: 0 0 22px 22px !important;
        background: linear-gradient(145deg, rgba(250,253,254,.98), rgba(238,248,250,.98)) !important;
        box-shadow: 0 24px 55px rgba(5,29,42,.2) !important;
    }

    .site-header.elgatec-header-compact-actions .site-nav.is-open {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        gap: 8px !important;
        animation: elgatec-mobile-menu-in .24s cubic-bezier(.2,.75,.25,1) both;
    }

    .site-header.elgatec-header-compact-actions .site-nav > a:not(.nav-account):not(.elgatec-header-shop),
    .site-header.elgatec-header-compact-actions .nav-dropdown > button {
        min-height: 48px !important;
        justify-content: space-between;
        padding: 0 15px !important;
        border: 1px solid #dce9ed !important;
        border-radius: 12px !important;
        color: #173746 !important;
        background: rgba(255,255,255,.92) !important;
        box-shadow: 0 5px 15px rgba(5,35,49,.043);
        font-size: 13px !important;
        font-weight: 800 !important;
        transition: transform .16s, border-color .16s, background-color .16s, box-shadow .16s !important;
    }

    .site-header.elgatec-header-compact-actions .site-nav > a:not(.nav-account):not(.elgatec-header-shop):hover,
    .site-header.elgatec-header-compact-actions .site-nav > a:not(.nav-account):not(.elgatec-header-shop):focus-visible,
    .site-header.elgatec-header-compact-actions .nav-dropdown > button:hover,
    .site-header.elgatec-header-compact-actions .nav-dropdown > button:focus-visible {
        transform: translateY(-1px);
        border-color: #78d4e5 !important;
        background: #fff !important;
        box-shadow: 0 8px 20px rgba(5,73,96,.1);
    }

    .site-header.elgatec-header-compact-actions .site-nav > a:not(.nav-account):not(.elgatec-header-shop)::after {
        position: static;
        display: block !important;
        flex: 0 0 7px;
        width: 7px;
        height: 7px;
        border-right: 2px solid #159dbf;
        border-bottom: 2px solid #159dbf;
        background: transparent;
        transform: rotate(-45deg);
    }

    .site-header.elgatec-header-compact-actions .site-nav > a:not(.nav-account):not(.elgatec-header-shop),
    .site-header.elgatec-header-compact-actions .site-nav > .nav-dropdown {
        grid-column: 1 / -1;
    }

    .site-header.elgatec-header-compact-actions .nav-dropdown__panel {
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
        gap: 6px !important;
        margin-top: 8px;
        padding: 8px !important;
        border: 1px solid #d7e8ed !important;
        border-radius: 14px !important;
        background: rgba(229,244,248,.92) !important;
    }

    .site-header.elgatec-header-compact-actions .nav-dropdown__panel a {
        min-width: 0;
        padding: 11px 12px !important;
        border: 1px solid transparent;
        border-radius: 10px !important;
        background: rgba(255,255,255,.7);
    }

    .site-header.elgatec-header-compact-actions .nav-dropdown__panel a:hover,
    .site-header.elgatec-header-compact-actions .nav-dropdown__panel a:focus-visible {
        border-color: #9adbea;
        background: #fff;
    }

    .site-header.elgatec-header-compact-actions .nav-dropdown__panel strong { font-size: 12px; }
    .site-header.elgatec-header-compact-actions .nav-dropdown__panel small { margin-top: 3px; font-size: 10px; }
}

@keyframes elgatec-mobile-menu-in {
    from { opacity: 0; transform: translateY(-8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
    :root {
        --elgatec-action-size: 38px;
        --elgatec-action-radius: 11px;
    }

    .site-header .site-header__inner {
        gap: 5px !important;
    }

    .site-header.elgatec-header-compact-actions .elgatec-header-actions {
        gap: 4px;
    }

    .site-header.elgatec-header-compact-actions .elgatec-header-client,
    .site-header.elgatec-header-compact-actions .elgatec-header-cart,
    .site-header.elgatec-header-compact-actions [data-elgux-header-cart],
    body #elgatec-calendar-float.elgatec-calendar-in-nav {
        flex: 0 0 var(--elgatec-action-size) !important;
        width: var(--elgatec-action-size) !important;
        min-width: var(--elgatec-action-size) !important;
        height: var(--elgatec-action-size) !important;
        min-height: var(--elgatec-action-size) !important;
        padding: 0 !important;
        border-radius: var(--elgatec-action-radius) !important;
    }

    .site-header.elgatec-header-compact-actions .elgatec-header-icon,
    .site-header.elgatec-header-compact-actions .elgux-header-cart__icon {
        width: 17px;
        height: 17px;
        flex-basis: 17px;
    }

    .site-header.elgatec-header-compact-actions .elgatec-header-icon svg,
    .site-header.elgatec-header-compact-actions .elgux-header-cart__icon svg {
        width: 17px;
        height: 17px;
    }

    .elgatec-header-shop-flip .elgatec-shop-face__icon,
    .elgatec-header-shop-flip .elgatec-shop-face__icon svg {
        width: 16px;
        height: 16px;
    }

    .elgatec-header-shop-flip .elgatec-shop-face__label {
        font-size: 6.5px !important;
    }

    body #elgatec-calendar-float.elgatec-calendar-in-nav .tick-text {
        font-size: 5.5px !important;
    }

    .site-header.elgatec-header-compact-actions .elgatec-header-cart > b {
        top: -6px;
        right: -6px;
        width: 18px;
        height: 18px;
        font-size: 8px;
    }

    .site-header .nav-toggle {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 620px) {
    .site-header.elgatec-header-compact-actions .nav-dropdown__panel {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 380px) {
    :root {
        --elgatec-action-size: 35px;
    }

    .site-header.elgatec-header-compact-actions .elgatec-header-actions {
        gap: 3px;
    }

    .site-header .elg-brand-mark {
        width: 34px;
        height: 34px;
    }

    .site-header .elg-brand-copy strong {
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .elgatec-header-shop-flip .elgatec-shop-flipper {
        animation: none !important;
    }
}
/* The compact action group replaces the legacy telephone CTA in the header. */
.site-header.elgatec-header-compact-actions .header-cta {
    display: none !important;
}

/* Preserve all header controls on narrow phones; scope only the header shell. */
@media (max-width: 360px) {
    .site-header .site-shell.site-header__inner {
        width: calc(100% - 10px);
        margin-inline: 5px;
    }
}
