/* ==========================================================
   HEADER
   ========================================================== */
.sl-header {
    background: rgba(248,244,239,0.96);
    border-bottom: 1px solid var(--sl-sand);
    position: sticky;
    top: 0;
    z-index: 200;
    transition: box-shadow 0.22s ease, background 0.22s ease;
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.sl-header.scrolled {
    background: rgba(248,244,239,0.98);
    box-shadow: 0 1px 0 rgba(30,28,26,0.06), 0 4px 20px rgba(30,28,26,0.07);
}

.sl-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 64px;
}

.sl-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: max-content;
}

/* Logo */
.sl-logo {
    flex-shrink: 0;
    font-family: var(--sl-font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--sl-charcoal);
    letter-spacing: 0.01em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.sl-logo img {
    max-height: 42px;
    width: auto;
    display: block;
}

/* Search */
.sl-header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.sl-header-search form,
.sl-header-search-mobile .sl-search-form,
.sl-mobile-search .sl-search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.sl-header-search input[type="search"],
.search-form input[type="search"] {
    width: 100%;
    min-height: 40px;
    padding: 8px 40px 8px 16px;
    border: 1px solid var(--sl-sand);
    border-radius: var(--sl-radius-pill);
    background: rgba(255,255,255,0.9);
    font-size: 13px;
    color: var(--sl-charcoal);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sl-header-search input[type="search"]:focus,
.search-form input[type="search"]:focus {
    border-color: var(--sl-sage);
    background: var(--sl-white);
    box-shadow: 0 0 0 3px rgba(92,122,94,0.1);
    outline: none;
}

.sl-header-search button[type="submit"],
.sl-header-search-mobile button[type="submit"],
.sl-mobile-search button[type="submit"] {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--sl-mist);
    padding: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.sl-header-search button[type="submit"]:hover { color: var(--sl-sage); }

/* Header Actions */
.sl-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.sl-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: background 0.15s ease;
    color: var(--sl-charcoal);
    font-size: 16px;
}

.sl-icon-btn:hover {
    background: var(--sl-cream-deep);
    color: var(--sl-charcoal);
}

.sl-cart-count {
    position: absolute;
    top: 3px;
    right: 3px;
    background: var(--sl-sage);
    color: var(--sl-white);
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--sl-cream);
}

/* Header WhatsApp button */
.sl-header-wa {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: var(--sl-radius-pill);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    gap: 5px;
    box-shadow: none;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sl-header-wa span[aria-hidden="true"] {
    font-size: 12px;
    line-height: 1;
}

/* Mobile menu toggle */
.sl-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sl-menu-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--sl-charcoal);
    border-radius: 2px;
    transition: all 0.25s ease;
}

/* Mobile header search */
.sl-header-search-mobile {
    display: none;
    padding: 10px 0 12px;
    border-top: 1px solid var(--sl-sand);
}

.sl-mobile-search {
    margin-bottom: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--sl-sand);
}

.sl-header-search-mobile input[type="search"],
.sl-mobile-search input[type="search"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--sl-sand);
    border-radius: var(--sl-radius-pill);
    background: var(--sl-cream);
    font-size: 14px;
}

/* ==========================================================
   HEADER REFINEMENT
   ========================================================== */
@media (max-width: 1024px) {
    .sl-header-inner {
        gap: 14px;
        height: 60px;
    }
}

/* ==========================================================
   PHASE 4 HEADER RESPONSIVE CLEANUP
   ========================================================== */
@media (max-width: 1023px) {
    .sl-header-inner {
        gap: 14px;
        height: 60px;
    }

    .sl-header-search {
        max-width: 320px;
    }

    .sl-header-wa {
        padding: 8px 12px;
    }
}

@media (max-width: 767px) {
    .sl-header-inner {
        height: 56px;
        gap: 12px;
    }

    .sl-header-left {
        gap: 12px;
        min-width: 0;
    }

    .sl-logo img {
        max-height: 36px;
    }

    .sl-header-actions {
        gap: 6px;
    }

    .sl-header-search {
        display: none;
    }

    .sl-header-search-mobile {
        display: block;
    }

    .sl-header-wa {
        display: none;
    }
}

/* ==========================================================
   PREMIUM HOMEPAGE PATCH — HEADER COMPRESSION
   ========================================================== */
@media (max-width: 767px) {
    .sl-header-inner {
        height: 52px;
        gap: 10px;
    }

    .sl-header-left {
        gap: 10px;
    }

    .sl-logo {
        font-size: 18px;
    }

    .sl-logo img {
        max-height: 32px;
    }

    .sl-icon-btn {
        width: 34px;
        height: 34px;
    }

    .sl-menu-toggle {
        width: 36px;
        height: 36px;
    }

    .sl-menu-toggle span {
        width: 20px;
    }

    .sl-header-search-mobile {
        padding: 8px 0 10px;
    }

    .sl-header-search-mobile input[type="search"] {
        min-height: 42px;
        font-size: 14px;
        padding: 10px 40px 10px 14px;
    }
}
