/**
 * sf-public-header.css
 * =============================================================================
 * Einheitlicher Public Header für Seedfinity Storefront
 *
 * Wird geladen von:
 *   - Network Storefront (storefront.ejs Layout)
 *   - JTL Shop (header.tpl Override)
 *
 * Nutzt --sfb-* Design Tokens aus sf.css
 * Icons: Bootstrap Icons (via sf.css @import)
 * Kein FontAwesome, kein Bootstrap CSS
 * =============================================================================
 */


/* ═══════════════════════════════════════════════════════════════════════════
   HEADER BASE
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sf-header__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: var(--sf-header-height, 56px);
}


/* ═══════════════════════════════════════════════════════════════════════════
   LOGO
   ═══════════════════════════════════════════════════════════════════════════ */

#sf-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

#sf-header__logo img {
    height: 28px!important;
    width: auto;
}


/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION (Desktop)
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header__nav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.sf-header__nav-link {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--sfb-radius-sm, 6px);
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.sf-header__nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.sf-header__nav-link.--active {
    color: var(--sfb-color-primary, #FF9900);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SUCHE
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header__search {
    position: relative;
    flex: 0 1 320px;
}

.sf-header__search-input {
    width: 100%;
    height: 36px;
    padding: 0 2.25rem 0 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--sfb-radius-sm, 6px);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sf-header__search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.sf-header__search-input:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.sf-header__search-input:focus {
    border-color: var(--sfb-color-primary, #FF9900);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.15);
}

.sf-header__search-icon {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ACTIONS (Rechte Seite: Warenkorb, Wunschliste, User)
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.sf-header__action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--sfb-radius-sm, 6px);
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.2s, background 0.2s;
}

.sf-header__action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* Badge (Warenkorb-Count, Wunschliste-Count) */
.sf-header__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--sfb-color-primary, #FF9900);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sf-header__badge:empty {
    display: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   USER AVATAR (eingeloggt)
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
}

.sf-header__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ACCOUNT DROPDOWN (Desktop)
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header__account-dropdown {
    position: relative;
}

.sf-header__avatar-trigger {
    cursor: pointer;
}

.sf-header__dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: rgba(18, 18, 24, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--sfb-radius-md, 8px);
    padding: 0.5rem;
    z-index: 1100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.sf-header__account-dropdown.--open .sf-header__dropdown-menu {
    display: block;
}

/* User Info Link */
.sf-header__dropdown-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--sfb-radius-sm, 6px);
    text-decoration: none;
    color: #fff;
    transition: background 0.2s;
}

.sf-header__dropdown-user:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sf-header__avatar--lg {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.sf-header__dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sf-header__dropdown-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-header__dropdown-mail {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Divider */
.sf-header__dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.375rem 0;
}

/* Dropdown Links */
.sf-header__dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--sfb-radius-sm, 6px);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}

.sf-header__dropdown-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.sf-header__dropdown-link i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

/* Danger (Logout) */
.sf-header__dropdown-link--danger {
    color: var(--sfb-color-danger, #dc3545);
}

.sf-header__dropdown-link--danger:hover {
    color: #fff;
    background: rgba(220, 53, 69, 0.15);
}


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE MENU: Danger Link (Logout)
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header__mobile-link--danger {
    color: var(--sfb-color-danger, #dc3545) !important;
}

.sf-header__mobile-link--danger:hover {
    color: #fff !important;
    background: rgba(220, 53, 69, 0.15) !important;
}

.sf-header__mobile-link--danger i {
    opacity: 0.8;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE TOGGLE
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header__mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--sfb-radius-sm, 6px);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.2s, background 0.2s;
}

.sf-header__mobile-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* Burger / Close Icon Toggle */
.sf-header__mobile-toggle .bi-x {
    display: none;
}

.sf-header.--menu-open .sf-header__mobile-toggle .bi-list {
    display: none;
}

.sf-header.--menu-open .sf-header__mobile-toggle .bi-x {
    display: block;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE MENU (Offscreen)
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-header__mobile-menu {
    display: none;
    position: fixed;
    top: var(--sf-header-height, 56px);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(16px);
    z-index: 999;
    padding: 1.5rem;
    overflow-y: auto;
}

.sf-header.--menu-open .sf-header__mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sf-header__mobile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--sfb-radius-sm, 6px);
    transition: color 0.2s, background 0.2s;
}

.sf-header__mobile-link:hover,
.sf-header__mobile-link.--active {
    color: var(--sfb-color-primary, #FF9900);
    background: rgba(255, 255, 255, 0.04);
}

.sf-header__mobile-link i {
    font-size: 1.2rem;
    width: 1.5rem;
    text-align: center;
    opacity: 0.6;
}

.sf-header__mobile-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.5rem 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.sf-footer__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sf-footer-language-wrapper {
    display: flex;
    justify-content: center;
    font-size: 0.8rem;
}
/* ── Footer Columns ── */

.sf-footer__columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
}

.sf-footer__column-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 0.75rem;
}

.sf-footer__column-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sf-footer__column-links a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s;
}

.sf-footer__column-links a:hover {
    color: var(--sfb-color-primary, #FF9900);
}


/* ── Footer Payments ── */

.sf-footer__payments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sf-footer__payment-icon {
    display: inline-flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.sf-footer__payment-icon:hover {
    opacity: 0.8;
}

.sf-footer__payment-icon img {
    max-height: 24px;
    width: auto;
}


/* ── Footer Bottom Bar ── */

.sf-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: baseline;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.sf-footer__vat {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.6875rem;
}

.sf-footer__vat a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
}

.sf-footer__vat a:hover {
    color: rgba(255, 255, 255, 0.6);
}


/* ── Legacy: sf-footer__links & sf-footer__legal (kept for backwards compat) ── */

.sf-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.sf-footer__links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s;
}

.sf-footer__links a:hover {
    color: var(--sfb-color-primary, #FF9900);
}

.sf-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

.sf-footer__legal a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    transition: color 0.2s;
}

.sf-footer__legal a:hover {
    color: rgba(255, 255, 255, 0.7);
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tablet: Suche kleiner */
@media (max-width: 1024px) {
    .sf-header__search {
        flex: 0 1 200px;
    }
}

/* Mobile: Hamburger-Menu */
@media (max-width: 768px) {
    .sf-header__nav {
        display: none;
    }

    .sf-header__search {
        display: none;
    }

    .sf-header__mobile-toggle {
        display: inline-flex;
    }

    .sf-header__inner {
        padding: 0 1rem;
    }

    .sf-footer__inner {
        padding: 0 1rem;
    }

    .sf-footer__columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Hide desktop dropdown on mobile — avatar acts as direct /account link */
    .sf-header__dropdown-menu {
        display: none !important;
    }
}

/* Kleine Tablets: Suche verstecken */
@media (max-width: 900px) and (min-width: 769px) {
    .sf-header__search {
        flex: 0 1 160px;
    }
}
