/* ══════════════════════════════════════════════════════════════
   Espresso Core — Header Styles (v4.0)
   ══════════════════════════════════════════════════════════════ */

[class^="md-espresso-"],
[class*=" md-espresso-"] {
    box-sizing: border-box;
}

.md-espresso-header img,
.md-espresso-header__fullmenu img {
    margin-bottom: 0 !important;
}

/* ── Header sticky ────────────────────────────────────────── */
.md-espresso-header {
    position: sticky;
    top: 0;
    z-index: 9998;
}

.admin-bar .md-espresso-header {
    top: 32px;
}

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

/* No tagDiv overrides needed in standalone theme */

/* ── Top Bar (RED) ───────────────────────────────────────── */
.md-espresso-header__topbar {
    background: #d51317;
    padding: 0;
}

.md-espresso-header__container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 64px;
}

.md-espresso-header__left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.md-espresso-header__center {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.md-espresso-header__right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    position: relative;
}

/* Hamburger — animated CSS lines → X */
.md-espresso-header__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
}

.md-espresso-header__hamburger-box {
    width: 24px;
    height: 18px;
    position: relative;
    display: block;
}

.md-espresso-header__hamburger-line {
    display: block;
    position: absolute;
    left: 0;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6),
                opacity 0.3s ease,
                top 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6),
                width 0.3s ease;
}

.md-espresso-header__hamburger-line:nth-child(1) {
    top: 0;
    width: 100%;
}

.md-espresso-header__hamburger-line:nth-child(2) {
    top: 8px;
    width: 70%;
}

.md-espresso-header__hamburger-line:nth-child(3) {
    top: 16px;
    width: 50%;
}

/* Hover: all lines same width */
.md-espresso-header__hamburger:hover .md-espresso-header__hamburger-line {
    width: 100%;
}

/* Active state: morph to X with bounce */
.md-espresso-header__hamburger.is-active .md-espresso-header__hamburger-line:nth-child(1) {
    top: 8px;
    width: 100%;
    transform: rotate(45deg);
}

.md-espresso-header__hamburger.is-active .md-espresso-header__hamburger-line:nth-child(2) {
    opacity: 0;
    width: 0;
    transform: translateX(-10px);
}

.md-espresso-header__hamburger.is-active .md-espresso-header__hamburger-line:nth-child(3) {
    top: 8px;
    width: 100%;
    transform: rotate(-45deg);
}

/* Date */
.md-espresso-header__date {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    line-height: 64px;
}

/* Logo */
.md-espresso-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 64px;
}

.md-espresso-header__logo-img {
    max-height: 42px;
    width: auto;
    display: block;
    margin-bottom: 0 !important;
}

.md-espresso-header__logo-text {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
}

/* Protoselida link */
.md-espresso-header__proto-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
}

.md-espresso-header__proto-link:hover {
    opacity: 0.8;
    border-color: rgba(255,255,255,0.6);
}

.md-espresso-header__proto-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 767px) {
    .md-espresso-header__proto-text {
        display: none;
    }

    .md-espresso-header__proto-link {
        padding: 6px;
        border: none;
    }
}

/* Search toggle */
.md-espresso-header__search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #fff;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.md-espresso-header__search-toggle:hover {
    opacity: 0.7;
}

/* ── Search Overlay ───────────────────────────────────────── */
.md-espresso-header__search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0,0,0,0.08) 0%, transparent 50%),
        linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    z-index: 10001;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.md-espresso-header__search-overlay.is-open {
    display: flex;
    opacity: 1;
}

.md-espresso-header__search-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.md-espresso-header__search-close:hover {
    opacity: 0.6;
}

.md-espresso-header__search-close svg {
    width: 28px;
    height: 28px;
}

.md-espresso-header__search-inner {
    width: 100%;
    max-width: 680px;
    padding: 0 24px;
    text-align: center;
}

.md-espresso-header__search-logo {
    margin-bottom: 40px;
}

.md-espresso-header__search-logo img {
    max-height: 40px;
    width: auto;
    margin-bottom: 0 !important;
}

.md-espresso-header__search-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 20px;
    display: block;
}

.md-espresso-header__search-form {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    padding: 0 20px;
    height: 60px;
}

.md-espresso-header__search-input {
    flex: 1;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    outline: none;
}

.md-espresso-header__search-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.md-espresso-header__search-submit {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    width: 36px;
    height: 36px;
    justify-content: center;
}

.md-espresso-header__search-submit:hover {
    opacity: 0.6;
}

.md-espresso-header__search-hint {
    margin-top: 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
}

.md-espresso-header__search-hint kbd {
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    font-family: inherit;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}

/* Mobile search */
@media (max-width: 767px) {
    .md-espresso-header__search-form {
        height: 50px;
        padding: 0 16px;
    }

    .md-espresso-header__search-input {
        font-size: 16px;
    }

    .md-espresso-header__search-label {
        font-size: 11px;
        letter-spacing: 3px;
        margin-bottom: 16px;
    }

    .md-espresso-header__search-logo {
        margin-bottom: 30px;
    }

    .md-espresso-header__search-logo img {
        max-height: 32px;
    }

    .md-espresso-header__search-hint {
        display: none;
    }
}

/* ── Navigation Bar (light gray) ─────────────────────────── */
.md-espresso-header__nav {
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    position: relative;
    z-index: 999;
    line-height: 1;
}

.md-espresso-header__nav .md-espresso-header__container {
    justify-content: center;
    height: auto;
    padding-top: 0;
    padding-bottom: 0;
}

.md-espresso-header__menu {
    display: flex;
    justify-content: center;
    align-items: stretch;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.md-espresso-header__menu-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.md-espresso-header__menu-item > a {
    display: flex;
    align-items: center;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    padding: 11px 14px;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.3px;
}

.md-espresso-header__menu-item > a:hover {
    color: #d51317;
}

/* ── Full-screen Menu (appended to body) ─────────────────── */
.md-espresso-header__fullmenu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-bar .md-espresso-header__fullmenu {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .md-espresso-header__fullmenu {
        top: 46px;
    }
}

.md-espresso-header__fullmenu.is-open {
    display: block;
}

/* Red top bar inside menu */
.md-espresso-header__fullmenu-topbar {
    background: #d51317;
}

.md-espresso-header__fullmenu-topbar-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.md-espresso-header__fullmenu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: opacity 0.2s;
}

.md-espresso-header__fullmenu-close:hover {
    opacity: 0.7;
}

.md-espresso-header__fullmenu-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.md-espresso-header__fullmenu-logo img {
    max-height: 42px;
    width: auto;
    margin-bottom: 0 !important;
}

/* Search inside menu */
.md-espresso-header__fullmenu-search {
    background: #f5f5f5;
    padding: 16px 20px;
}

.md-espresso-header__fullmenu-search-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 16px;
}

.md-espresso-header__fullmenu-search-form input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
}

.md-espresso-header__fullmenu-search-form input::placeholder {
    color: #999;
}

/* Menu body */
.md-espresso-header__fullmenu-body {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Category grid */
.md-espresso-header__fullmenu-cats {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    padding: 32px 0;
    border-bottom: 1px solid #eee;
}

.md-espresso-header__fullmenu-group {
    padding-right: 20px;
}

.md-espresso-header__fullmenu-group-title {
    font-size: 14px;
    font-weight: 800;
    color: #d51317;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #d51317;
}

.md-espresso-header__fullmenu-group-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.md-espresso-header__fullmenu-group-links li.is-main a {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    padding: 5px 0;
    display: block;
    transition: color 0.2s;
}

.md-espresso-header__fullmenu-group-links li.is-sub a {
    font-size: 12px;
    font-weight: 400;
    color: #777;
    text-decoration: none;
    padding: 3px 0 3px 10px;
    display: block;
    transition: color 0.2s;
}

.md-espresso-header__fullmenu-group-links li a:hover {
    color: #d51317;
}

/* Social section */
.md-espresso-header__fullmenu-social {
    padding: 28px 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.md-espresso-header__fullmenu-social-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
}

.md-espresso-header__fullmenu-social-icons {
    display: flex;
    gap: 16px;
}

.md-espresso-header__fullmenu-social-icons a {
    color: #555;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.md-espresso-header__fullmenu-social-icons a:hover {
    color: #d51317;
}

/* ── Sticky Header (handled by tagDiv) ────────────────────── */
.md-espresso-header__sticky {
    display: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1018px) {
    .md-espresso-header__nav {
        display: none;
    }

    .md-espresso-header__date {
        font-size: 11px;
    }

    .md-espresso-header__logo-img {
        max-height: 36px;
    }
}

@media (max-width: 767px) {
    .md-espresso-header__date {
        display: none;
    }

    .md-espresso-header__logo-img {
        max-height: 32px;
    }

    .md-espresso-header__container {
        padding: 0 12px;
        height: 54px;
    }

    .md-espresso-header__fullmenu-cats {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding: 24px 0;
    }

    .md-espresso-header__fullmenu-social {
        flex-direction: column;
        gap: 12px;
    }

    .md-espresso-header__search-input {
        font-size: 20px;
    }
}

@media (max-width: 1200px) {
    .md-espresso-header__fullmenu-cats {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .md-espresso-header__fullmenu-cats {
        grid-template-columns: repeat(3, 1fr);
    }
}
