/* ============================================================
   TERAPRINT HEADER v1.0
   Custom header replacing Kadence default.
   Brand: azure-blue #337ab7, vibrant-orange #f36f21
   ============================================================ */

/* ── Reset Kadence header styles ── */
#masthead,
#mobile-header,
#mobile-drawer,
#mobile-toggle,
.site-header,
.site-header-wrap,
.site-header-inner-wrap,
.site-mobile-header-wrap,
.popup-drawer,
.drawer-overlay,
.drawer-toggle,
.menu-toggle-open {
    display: none !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ── Variables (synced with design system in teraprint-frontend.css) ── */
:root {
    --tp-blue: #337ab7;
    --tp-orange: #f36f21;
    --tp-orange-dark: #e05e10;
    --tp-gray: #999;
    --tp-card-radius: 6px;
}

/* ── Header container — full width, card style bottom edge ── */
.tp-header {
    font-family: 'Roboto', -apple-system, sans-serif;
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    background: var(--tp-card-bg, #fff);
    box-shadow: var(--tp-card-shadow, 0 1px 4px rgba(0,0,0,0.06));
    border-bottom: var(--tp-card-border, 1px solid #dde3ea);
}

/* ── ROW 1: Logo + Trust Badges + Account ── */
.tp-header-row1 {
    background: var(--tp-card-bg, #fff);
    border-bottom: 1px solid var(--tp-border, #e8e8e8);
}

.tp-header-inner {
    max-width: var(--tp-max-w, 1400px);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    height: 68px;
}

/* Logo */
.tp-header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    margin-left: -15px;
}

.tp-logo-icon {
    width: 46px;
    height: 46px;
    background: var(--tp-blue, #337ab7);
    border-radius: var(--tp-card-radius, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 26px;
    flex-shrink: 0;
}

.tp-logo-icon-sm {
    width: 32px;
    height: 32px;
    font-size: 18px;
}

.tp-logo-text {
    display: flex;
    flex-direction: column;
}

.tp-logo-name {
    font-size: 30px;
    font-weight: 700;
    color: var(--tp-dark);
    line-height: 1;
    letter-spacing: -0.5px;
}

.tp-logo-orange {
    color: var(--tp-orange);
}

.tp-logo-reg {
    color: var(--tp-blue);
    font-size: 10px;
    vertical-align: super;
    margin-left: 1px;
}

.tp-logo-sub {
    font-size: 10px;
    color: var(--tp-gray);
    letter-spacing: 2.8px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Spacer */
.tp-header-spacer {
    flex: 1;
}

/* ── Trust Badges ── */
.tp-trust-badges {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-right: 24px;
}

.tp-trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tp-trust-icon {
    width: 28px;
    height: 28px;
    border: 1px solid #e0e0e0;
    border-radius: var(--tp-card-radius, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tp-trust-text {
    line-height: 1.2;
}

.tp-trust-text strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--tp-dark);
}

.tp-trust-text span {
    display: block;
    font-size: 10px;
    color: var(--tp-gray);
}

.tp-trust-stars {
    display: flex;
    gap: 1px;
    align-items: center;
}

.tp-trust-stars strong {
    display: inline;
    font-size: 10px;
    font-weight: 600;
    color: var(--tp-dark);
    margin-left: 3px;
}

.tp-trust-sep {
    width: 1px;
    height: 24px;
    background: var(--tp-border);
}

/* ── Account + Cart ── */
.tp-header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.tp-header-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    color: var(--tp-dark);
    text-decoration: none;
    position: relative;
}

.tp-header-action span {
    font-size: 10px;
    font-weight: 500;
}

.tp-header-action:hover {
    color: var(--tp-blue);
}

.tp-cart-count {
    position: absolute;
    top: -4px;
    right: 4px;
    background: var(--tp-orange);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── ROW 2: Blue Navigation ── */
.tp-header-row2 {
    background: var(--tp-blue, #337ab7);
    position: relative;
}

.tp-header-row2 .tp-header-inner {
    height: 44px;
}

/* PRODUKTE button */
.tp-nav-produkte {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 100%;
    background: #f36f21;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: -16px;
    border: none;
    font-family: inherit;
    transition: background 0.15s;
    user-select: none;
}

.tp-nav-produkte svg {
    stroke: #fff;
}
.tp-nav-produkte:hover,
.tp-nav-produkte[aria-expanded="true"] {
    background: #e05e10;
}

/* Nav links */
.tp-nav-links {
    display: flex;
    height: 100%;
}

.tp-nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 20px;
    height: 100%;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.12s ease;
    border-left: 1px solid rgba(255,255,255,0.2);
}
.tp-nav-link:last-child {
    border-right: 1px solid rgba(255,255,255,0.2);
}

.tp-nav-link:hover,
.tp-nav-link.tp-nav-active {
    background: rgba(255,255,255,0.12);
    font-weight: 600;
    color: #fff;
}
.tp-nav-link.tp-nav-active {
    border-bottom: 2px solid #f36f21;
}

/* EXPRESS badge */
.tp-nav-express {
    gap: 6px;
}

.tp-badge-24h {
    background: var(--tp-orange);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    letter-spacing: 0.5px;
    border-radius: 3px;
}

/* Search */
.tp-nav-search {
    flex-shrink: 0;
}

.tp-nav-search form {
    display: flex;
    align-items: center;
    height: 30px;
    background: #fff;
    border-radius: var(--tp-card-radius, 6px);
    width: 180px;
    transition: width 0.2s ease;
}

.tp-nav-search form:focus-within {
    width: 240px;
}

.tp-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 10px;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
    color: var(--tp-dark);
    height: 100%;
    letter-spacing: 0.5px;
    background: transparent;
}

.tp-search-input::placeholder {
    color: #aaa;
    letter-spacing: 0.5px;
}

.tp-search-btn {
    width: 30px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* Language */
.tp-nav-lang {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    cursor: pointer;
    padding: 0 6px;
    height: 100%;
}

.tp-nav-lang svg:first-child {
    border: 1px solid #ccc;
    flex-shrink: 0;
}

/* ── MEGA MENU ── */
.tp-mega-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 16px);
    max-width: 1400px;
    background: var(--tp-card-bg, #fff);
    z-index: 100;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    border-top: 3px solid var(--tp-orange);
    border-radius: 0 0 var(--tp-card-radius, 6px) var(--tp-card-radius, 6px);
    overflow: hidden;
}

.tp-mega-inner {
    max-width: var(--tp-max-w);
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.tp-mega-col {
    padding: 0 16px;
    border-right: 1px solid #eee;
}
.tp-mega-col:last-child {
    border-right: none;
}

.tp-mega-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--tp-dark, #5C5B5B);
    padding-bottom: 5px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--tp-orange);
    border-left: none;
    padding-left: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: color 0.15s;
}
.tp-mega-title:hover {
    color: var(--tp-blue);
}

.tp-mega-item {
    display: flex;
    align-items: center;
    font-size: 13.5px;
    color: #555;
    padding: 7px 0 7px 0;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.15s;
    text-decoration: none;
    border-left: none;
}
.tp-mega-item:last-child {
    border-bottom: none;
}

.tp-mega-item:hover {
    color: var(--tp-blue);
    padding-left: 4px;
}

.tp-mega-arrow {
    font-size: 12px;
    margin-right: 6px;
    color: var(--tp-orange);
    font-weight: 700;
    transition: transform 0.15s;
}
.tp-mega-item:hover .tp-mega-arrow {
    transform: translateX(2px);
}

.tp-mega-footer {
    border-top: 1px solid #e5e5e5;
    padding: 14px 24px;
    max-width: var(--tp-max-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafb;
    border-radius: 0 0 var(--tp-card-radius, 6px) var(--tp-card-radius, 6px);
}

.tp-mega-all {
    font-size: 14px;
    color: var(--tp-blue);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
}

.tp-mega-all:hover {
    color: var(--tp-orange);
    text-decoration: none;
}

.tp-mega-info {
    font-size: 12px;
    color: var(--tp-gray);
}

/* Mega overlay */
.tp-mega-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    background: rgba(0,0,0,0.35);
    z-index: 99;
}

/* ── MOBILE HEADER ── */
.tp-mobile-header {
    display: none;
    background: #fff;
    border-bottom: 1px solid var(--tp-border);
}

.tp-mobile-header .tp-header-inner {
    height: 56px;
}

.tp-mobile-menu-btn {
    background: none;
    border: none;
    padding: 10px;
    margin-left: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.tp-mobile-logo {
    margin-left: 0;
}

.tp-mobile-logo .tp-logo-name {
    font-size: 24px;
}

.tp-mobile-logo .tp-logo-sub {
    display: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
    .tp-trust-badges {
        display: none;
    }
}

@media (max-width: 768px) {
    .tp-header-row1,
    .tp-header-row2 {
        display: none;
    }

    .tp-mobile-header {
        display: block;
    }
}

/* ── Admin bar offset ── */
.admin-bar .tp-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .tp-header {
        top: 46px;
    }
}

/* ── Body padding for sticky header ── */
body.has-tp-header {
    padding-top: 0;
}

/* Kadence may add padding — override */
.site {
    padding-top: 0 !important;
}

/* Fix Kadence content margin when header is replaced */
.site-container .site-inner-wrap {
    margin-top: 0;
}

/* ══════════════════════════════════════
   MOBILE DROPDOWN NAVIGATION
   ══════════════════════════════════════ */
.tp-mobile-dropdown {
    background: #fff;
    border-top: 1px solid var(--tp-border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 70vh;
    overflow-y: auto;
}

/* Hauptnavi-Links (Startseite, Druckdaten, etc.) */
.tp-mdrop-nav {
    display: flex;
    flex-direction: column;
    border-bottom: 2px solid var(--tp-orange);
}
.tp-mdrop-nav a {
    display: block;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-dark);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}
.tp-mdrop-nav a:hover,
.tp-mdrop-nav a:active {
    background: #f5f8fc;
    color: var(--tp-blue);
}

/* Kategorie-Accordions */
.tp-mdrop-cats {
    padding: 0;
}
.tp-mobile-drawer__cat {
    border-bottom: 1px solid #f0f0f0;
}
.tp-mobile-drawer__cat-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-dark);
    cursor: pointer;
    text-align: left;
}
.tp-mobile-drawer__cat-btn:hover,
.tp-mobile-drawer__cat-btn:active,
.tp-mobile-drawer__cat-btn--active {
    background: var(--tp-blue);
    color: #fff;
}
.tp-mobile-drawer__chevron {
    font-size: 18px;
    color: #b0b0b0;
    transition: transform 0.2s;
}
.tp-mobile-drawer__cat-btn--active .tp-mobile-drawer__chevron {
    transform: rotate(90deg);
    color: #fff;
}
.tp-mobile-drawer__items {
    background: #fafafa;
}
.tp-mobile-drawer__item {
    display: block;
    padding: 10px 20px 10px 32px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}
.tp-mobile-drawer__item:hover,
.tp-mobile-drawer__item:active {
    color: var(--tp-blue);
    background: #edf4fb;
}

/* Quick-Links (Alle Kategorien, Mein Konto, Kontakt) */
.tp-mdrop-links {
    display: flex;
    flex-direction: column;
    padding: 8px 20px 12px;
    border-top: 2px solid #e8e8e8;
    background: #fafafa;
}
.tp-mdrop-links a {
    font-size: 14px;
    color: var(--tp-blue);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.tp-mdrop-links a:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .tp-mobile-drawer {
        display: block;
    }
    .tp-mobile-drawer-overlay {
        display: block;
    }
}
