/* ===========================================================================
 * Amouria Header (All-in-One Widget)
 * ===========================================================================
 * - Top-Bar (links Text / mitte Shop-Status / rechts Phone+Email)
 * - Main Row (Logo / Nav / Mini-Cart / Burger)
 * - Off-Canvas Mobile-Menü (Tiles + Social)
 * - Cart-Drawer (slide-in von rechts)
 * - Transparent-Modus per body.amr-hero-page (vom JS gesetzt)
 * =========================================================================== */

/* Root-Container =========================================================== */
.amr-hdr {
    --amr-hdr-bg: #F3EFE9;
    --amr-hdr-color: #343434;
    --amr-hdr-accent: #B8956A;
    --amr-hdr-radius: 4px;
    --amr-hdr-pad: 1em 1.5em;
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--amr-hdr-color);
    width: 100%;
    box-sizing: border-box;
}

.amr-hdr-sticky-fixed {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9990;
}

/* Body bekommt vom JS Padding-Top damit Content nicht unter dem fixed Header beginnt */
body.amr-hdr-has-fixed { padding-top: var(--amr-hdr-height, 0); }

/* Top-Bar ================================================================== */
.amr-hdr-topbar {
    background: #2d2d2d;
    color: #F3EFE9;
    font-size: 0.85em;
    letter-spacing: 0.04em;
    transition: background 0.4s ease;
}
.amr-hdr-topbar a { color: inherit; text-decoration: none; }
.amr-hdr-topbar a:hover { color: var(--amr-hdr-accent); }

.amr-hdr-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    padding: 0.4em 1.5em;
    max-width: 100%;
    box-sizing: border-box;
}

.amr-hdr-tb-left,
.amr-hdr-tb-right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 1em;
    min-width: 0;
}
.amr-hdr-tb-right { justify-content: flex-end; }

.amr-hdr-tb-phone,
.amr-hdr-tb-email {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    white-space: nowrap;
}

.amr-hdr-tb-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.2em 0.8em;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.78em;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}
.amr-hdr-tb-status-dot {
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    display: inline-block;
}
.amr-hdr-tb-status-open .amr-hdr-tb-status-dot {
    background: #67c267;
    box-shadow: 0 0 6px rgba(103,194,103,0.6);
    animation: amrHdrPulse 2s ease-in-out infinite;
}
.amr-hdr-tb-status-paused .amr-hdr-tb-status-dot { background: #d68d3a; }
.amr-hdr-tb-status-closed .amr-hdr-tb-status-dot { background: #d63638; }

/* Status-Badge: Label + Stunden */
.amr-hdr-tb-status-sep { opacity: 0.5; margin: 0 0.1em; }
.amr-hdr-tb-status-hours {
    font-variant-numeric: tabular-nums;
    font-weight: 400;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

@keyframes amrHdrPulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* Top-Bar Mobile-Varianten */
@media (max-width: 1024px) {
    .amr-hdr-tb-email-text { display: none; }
    .amr-hdr-tb-left { font-size: 0.92em; }
}
/* Auf sehr engen Phones: Status-Hours kürzer / kein Label */
@media (max-width: 480px) {
    .amr-hdr-tb-status { font-size: 0.7em; padding: 0.18em 0.6em; }
    .amr-hdr-tb-status-sep { display: none; }
    .amr-hdr-tb-status-hours { display: block; font-size: 0.95em; margin-top: 0.05em; }
}
@media (max-width: 767px) {
    .amr-hdr-tbmobile-hidden .amr-hdr-topbar { display: none; }

    .amr-hdr-tbmobile-status .amr-hdr-tb-left,
    .amr-hdr-tbmobile-status .amr-hdr-tb-right { display: none; }
    .amr-hdr-tbmobile-status .amr-hdr-tb-status { margin: 0 auto; }

    .amr-hdr-tbmobile-reduced .amr-hdr-tb-left { display: none; }
    .amr-hdr-tbmobile-reduced .amr-hdr-tb-phone-text,
    .amr-hdr-tbmobile-reduced .amr-hdr-tb-email-text { display: none; }
    .amr-hdr-tbmobile-reduced .amr-hdr-tb-email { display: none; }
    .amr-hdr-tbmobile-reduced .amr-hdr-tb-right { flex: 0 0 auto; }

    .amr-hdr-topbar-inner { padding: 0.35em 1em; }
}

/* Main Row ================================================================= */
.amr-hdr-main {
    background: var(--amr-hdr-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    padding: var(--amr-hdr-pad);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.amr-hdr-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.amr-hdr-logo img {
    display: block;
    height: auto;
    width: 160px;
    max-width: 100%;
}
/* Logo-Toggle hell/dunkel je nach State */
.amr-hdr-logo-light { display: none; }
.amr-hdr-logo-dark  { display: block; }
body.amr-hero-page:not(.amouria-scrolled) .amr-hdr-logo-light { display: block; }
body.amr-hero-page:not(.amouria-scrolled) .amr-hdr-logo-dark  { display: none; }
/* Wenn kein Light-Logo existiert, fällt das dunkle ein */
.amr-hdr-logo:not(:has(.amr-hdr-logo-light)) .amr-hdr-logo-dark { display: block !important; }

/* Logo komplett ausblenden bei transparentem Header (wenn Widget-Setting aktiv).
   Trifft auch auf Mobile zu wenn dort kein amr-hero-page gesetzt ist – dann ist
   das Logo immer sichtbar weil Header dort opak ist. */
.amr-hdr.amr-hdr-logo-hide-trans .amr-hdr-logo {
    opacity: 1;
    transition: opacity 0.4s ease;
}
body.amr-hero-page:not(.amouria-scrolled) .amr-hdr.amr-hdr-logo-hide-trans .amr-hdr-logo {
    opacity: 0;
    pointer-events: none;
}

/* Nav (Desktop) */
.amr-hdr-nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}
.amr-hdr-nav-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    gap: 2em;
}
.amr-hdr-nav-list a {
    color: var(--amr-hdr-color);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.92em;
    position: relative;
    padding: 0.4em 0;
    transition: color 0.2s ease;
}
.amr-hdr-nav-list a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px;
    background: var(--amr-hdr-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
.amr-hdr-nav-list a:hover::after { transform: scaleX(1); }

@media (max-width: 1024px) {
    .amr-hdr-nav { display: none !important; }

    /* Mobile-Layout: bulletproof – !important damit weder Hello-Elementor noch
       Inline-Styles vom Widget reinpfuschen. */
    .amr-hdr-main {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5em !important;
    }

    /* Logo immer flex-shrink: 0 + max-width Cap damit es nie übern Rand wächst */
    .amr-hdr-logo {
        flex: 0 0 auto !important;
        max-width: 60% !important;
        margin: 0 !important;
    }
    .amr-hdr-logo img {
        max-width: 100% !important;
        display: block;
    }

    /* „left": Logo bündig links, Right-Cluster wird per margin-left:auto an den
       rechten Rand gepusht. Funktioniert unabhängig von justify-content. */
    .amr-hdr-mlogo-left .amr-hdr-main {
        justify-content: flex-start !important;
    }
    .amr-hdr-mlogo-left .amr-hdr-right {
        margin-left: auto !important;
    }

    /* „center": 3-Spalten-Grid → Logo mittig, Right rechts.
       Hier kein flex sondern grid; right-cluster wird per justify-self positioniert. */
    .amr-hdr-mlogo-center .amr-hdr-main {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        gap: 0.5em !important;
        justify-content: stretch !important;
    }
    .amr-hdr-mlogo-center .amr-hdr-logo {
        grid-column: 2 !important;
        justify-self: center !important;
    }
    .amr-hdr-mlogo-center .amr-hdr-right {
        grid-column: 3 !important;
        justify-self: end !important;
        margin: 0 !important;
    }
}

/* Echte Phones: Logo nochmal etwas kleiner cappen */
@media (max-width: 480px) {
    .amr-hdr-logo { max-width: 50% !important; }
}

/* Right cluster (Cart + Burger) */
.amr-hdr-right {
    display: flex;
    align-items: center;
    gap: 0.8em;
    flex-shrink: 0;
}

/* Mini-Cart */
.amr-hdr-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--amr-hdr-color);
    text-decoration: none;
    padding: 0.4em;
    transition: color 0.2s ease;
}
.amr-hdr-cart:hover { color: var(--amr-hdr-accent); }
.amr-hdr-cart-badge {
    position: absolute;
    top: -0.15em; right: -0.3em;
    min-width: 1.4em; height: 1.4em;
    padding: 0 0.35em;
    border-radius: 999px;
    background: var(--amr-hdr-accent);
    color: #FFFFFF;
    font-size: 0.72em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.amr-hdr-cart-badge:empty,
.amr-hdr-cart-badge[data-amr-cart-count="0"] {
    display: none;
}

/* Burger (nur Mobile/Tablet) */
.amr-hdr-burger {
    display: none;
    flex-direction: column;
    gap: 0.32em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4em;
    position: relative;
    z-index: 2;
}
.amr-hdr-burger span {
    display: block;
    width: 1.6em;
    height: 2px;
    background: var(--amr-hdr-color);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}
.amr-hdr-burger.amr-open span:nth-child(1) { transform: translateY(calc(0.32em + 2px)) rotate(45deg); }
.amr-hdr-burger.amr-open span:nth-child(2) { opacity: 0; }
.amr-hdr-burger.amr-open span:nth-child(3) { transform: translateY(calc(-0.32em - 2px)) rotate(-45deg); }

@media (max-width: 1024px) {
    .amr-hdr-burger { display: flex; }
}

/* Transparent Mode ========================================================= */
body.amr-hero-page:not(.amouria-scrolled) .amr-hdr-main {
    background: transparent !important;
    box-shadow: none !important;
}
body.amr-hero-page.amouria-scrolled .amr-hdr-main {
    background: var(--amr-hdr-bg);
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

/* Off-Canvas =============================================================== */
.amr-hdr-oc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.amr-hdr-oc-overlay.amr-open {
    opacity: 1;
    visibility: visible;
}

.amr-hdr-oc {
    position: fixed;
    top: 0; right: 0;
    width: min(88vw, 22em);
    height: 100dvh;
    background: #F3EFE9;
    z-index: 9999;
    transform: translateX(102%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    padding: 1.2em 1.2em 2em;
    overflow-y: auto;
    box-shadow: -4px 0 28px rgba(0,0,0,0.13);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.amr-hdr-oc.amr-open { transform: translateX(0); }

.amr-hdr-oc-close {
    position: absolute;
    top: 1em; right: 1em;
    background: none;
    border: none;
    cursor: pointer;
    color: #343434;
    padding: 0.4em;
    transition: color 0.2s ease;
}
.amr-hdr-oc-close:hover { color: var(--amr-hdr-accent); }

.amr-hdr-oc-logo {
    text-align: center;
    padding: 2.5em 1em 1em;
}
.amr-hdr-oc-logo img {
    width: 8em;
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.amr-hdr-oc-divider {
    width: 2.5em;
    height: 1px;
    background: var(--amr-hdr-accent);
    margin: 1em auto 1.4em;
    opacity: 0.55;
}

.amr-hdr-oc-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55em;
}
.amr-hdr-oc-tile {
    display: block;
    text-decoration: none;
    border-radius: 0.55em;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
    background: #E8DFD3;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.amr-hdr-oc-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.amr-hdr-oc-tile-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.35s ease;
}
.amr-hdr-oc-tile:hover .amr-hdr-oc-tile-bg { transform: scale(1.04); }
.amr-hdr-oc-tile-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.6em;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0) 100%);
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 0.95em;
    font-style: italic;
    color: #FFFFFF;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    line-height: 1.3;
}

/* Zusätzliche Text-Links unter den Tiles */
.amr-hdr-oc-links {
    list-style: none;
    margin: 1.4em 0 0;
    padding: 1em 0 0;
    border-top: 1px solid rgba(184,149,106,0.3);
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}
.amr-hdr-oc-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    padding: 0.7em 0.4em;
    text-decoration: none;
    color: #2d2d2d;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}
.amr-hdr-oc-link:hover {
    background: rgba(184,149,106,0.1);
    color: var(--amr-hdr-accent);
}
.amr-hdr-oc-link-hl {
    color: var(--amr-hdr-accent);
    font-weight: 600;
    border: 1px solid var(--amr-hdr-accent);
    padding: 0.7em 0.9em;
    margin-bottom: 0.3em;
}
.amr-hdr-oc-link-hl:hover {
    background: var(--amr-hdr-accent);
    color: #FFFFFF;
}
.amr-hdr-oc-link svg { opacity: 0.7; transition: transform 0.2s ease; }
.amr-hdr-oc-link:hover svg { transform: translateX(3px); opacity: 1; }

.amr-hdr-oc-social {
    margin-top: 1.4em;
    display: flex;
    justify-content: center;
    gap: 1.2em;
    padding-top: 1.1em;
    border-top: 1px solid rgba(184,149,106,0.3);
}
.amr-hdr-oc-social a {
    color: #7A7268;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}
.amr-hdr-oc-social a:hover { color: var(--amr-hdr-accent); }

@media (min-width: 768px) and (max-width: 1024px) {
    .amr-hdr-oc { width: min(60vw, 28em); }
}

/* Cart Drawer ============================================================== */
.amr-hdr-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.amr-hdr-drawer-overlay.amr-open {
    opacity: 1;
    visibility: visible;
}

.amr-hdr-drawer {
    position: fixed;
    top: 0; right: 0;
    width: min(94vw, 24em);
    height: 100dvh;
    background: #FFFFFF;
    z-index: 10001;
    transform: translateX(102%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 28px rgba(0,0,0,0.13);
}
.amr-hdr-drawer.amr-open { transform: translateX(0); }

.amr-hdr-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2em 1.4em;
    border-bottom: 1px solid #ebe5dc;
}
.amr-hdr-drawer-head h3 {
    margin: 0;
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 400;
    color: #2d2d2d;
    font-size: 1.3em;
}
.amr-hdr-drawer-close {
    background: none;
    border: none;
    font-size: 1.8em;
    line-height: 1;
    cursor: pointer;
    color: #74675a;
    padding: 0;
    width: 1.4em;
    height: 1.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}
.amr-hdr-drawer-close:hover { color: #2d2d2d; }

.amr-hdr-drawer-items {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1em 1.4em;
}
.amr-hdr-drawer-loading,
.amr-hdr-drawer-empty {
    text-align: center;
    color: #74675a;
    font-style: italic;
    padding: 2em 0;
}

.amr-hdr-drawer-item {
    display: grid;
    grid-template-columns: 4em 1fr auto;
    gap: 0.8em;
    align-items: center;
    padding: 0.8em 0;
    border-bottom: 1px solid #f3efe9;
}
.amr-hdr-drawer-item:last-child { border-bottom: none; }
.amr-hdr-drawer-item-img img {
    width: 4em;
    height: 4em;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.amr-hdr-drawer-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    min-width: 0;
}
.amr-hdr-drawer-item-name {
    color: #2d2d2d;
    text-decoration: none;
    font-weight: 500;
}
.amr-hdr-drawer-item-name:hover { color: var(--amr-hdr-accent); }
.amr-hdr-drawer-item-qty,
.amr-hdr-drawer-item-price {
    font-size: 0.88em;
    color: #74675a;
}
.amr-hdr-drawer-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #74675a;
    font-size: 1.4em;
    padding: 0.2em 0.5em;
    line-height: 1;
    transition: color 0.2s ease;
}
.amr-hdr-drawer-item-remove:hover { color: #d63638; }

.amr-hdr-drawer-foot {
    border-top: 1px solid #ebe5dc;
    padding: 1em 1.4em 1.4em;
}
.amr-hdr-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8em;
    color: #74675a;
}
.amr-hdr-drawer-subtotal strong {
    color: #2d2d2d;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.2em;
}
.amr-hdr-drawer-checkout {
    display: block;
    background: #2d2d2d;
    color: #FFFFFF;
    text-align: center;
    padding: 0.9em;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: background 0.2s ease;
}
.amr-hdr-drawer-checkout:hover { background: var(--amr-hdr-accent); }
