/**
 * Stiluri optimizate pentru header-ul ParfumLab
 * Corecții pentru problemele identificate
 */

/* Reset și stiluri generale */
.custom-header {
    padding-top: 0;
    margin-bottom: 0;
    font-family: 'Poppins', sans-serif;
}

.site-header {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    background: #fff !important;
}

.custom-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Top Bar */
.custom-header .topbar {
    background-color: #fff;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #333;
}

.custom-header .announcements {
    flex: 1;
    overflow: hidden;
}

.custom-header .announcement-static {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.custom-header .announcement-static i {
    font-size: 16px;
    color: #da3125;
}

.custom-header .announcement-static strong {
    font-weight: 700;
    color: #000;
}

.custom-header .announcement-static a {
    color: #da3125;
    text-decoration: none;
    font-weight: 600;
}

.custom-header .announcement-static a:hover {
    text-decoration: underline;
}

/* Social Media */
.custom-header .social-media {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    min-width: 150px;
}

.custom-header .social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #f2f2f2;
    border-radius: 50%;
    color: #333;
    transition: all 0.2s ease;
    text-decoration: none;
}

.custom-header .social-icon:hover {
    background-color: #da3125;
    color: #fff;
}

/* Main Header */
.custom-header .main-header {
    background-color: #fff;
    padding: 12px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.custom-header .site-branding {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0 !important;
    float: none !important;
}

.custom-header .logo-container {
    display: flex;
    align-items: center;
}

.custom-header .custom-logo {
    max-height: 45px;
    width: auto;
}

/* Mobile Menu Toggle */
.custom-header .mobile-menu-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-header .hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.custom-header .hamburger-icon .line {
    width: 100%;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
}

/* Mobile Menu activated state */
.custom-header.menu-open .hamburger-icon .line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.custom-header.menu-open .hamburger-icon .line:nth-child(2) {
    opacity: 0;
}

.custom-header.menu-open .hamburger-icon .line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu Sidebar */
.custom-header .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.custom-header.menu-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}

.custom-header .mobile-menu-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 9999999;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    overflow-y: auto;
}

.custom-header.menu-open .mobile-menu-sidebar {
    left: 0;
}

.custom-header .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.custom-header .mobile-menu-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.custom-header .mobile-menu-close {
    position: absolute;
    right: 20px;
    font-size: 22px;
    cursor: pointer;
    color: #333;
}

.custom-header .mobile-nav {
    padding: 25px 0;
}

.custom-header .mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-header .mobile-nav li {
    border-bottom: 1px solid #f5f5f5;
}

.custom-header .mobile-nav li:last-child {
    border-bottom: none;
}

.custom-header .mobile-nav a {
    display: block;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-size: 17px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.custom-header .mobile-nav a:hover {
    background-color: #f9f9f9;
    color: #da3125;
}

.custom-header .mobile-nav .flash-deals {
    color: #da3125;
    font-weight: 600;
}

.custom-header .mobile-menu-social {
    display: flex;
    justify-content: center;
    padding: 30px 20px;
    gap: 20px;
    border-top: 1px solid #f0f0f0;
}

.custom-header .mobile-menu-social .social-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

/* Search Container Desktop */
.custom-header .search-container {
    display: none;
}

@media (min-width: 992px) {
    .custom-header .search-container.desktop-only {
        display: flex;
        align-items: center;
        flex: 1;
        min-width: 400px;
        max-width: 550px;
        margin: 0 30px;
    }
    
    .custom-header .search-form {
        width: 100%;
        margin-bottom: 0 !important;
    }
}

.custom-header .search-input-wrapper {
    display: flex;
    width: 100%;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.custom-header .search-input-wrapper:focus-within {
    border-color: #da3125;
    box-shadow: 0 0 0 2px rgba(218, 49, 37, 0.1);
}

.custom-header .search-field {
    width: 100%;
    height: 40px;
    border: none !important;
    padding: 0 15px !important;
    outline: none;
    font-size: 14px !important;
    background-color: #fff !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

.custom-header .search-submit {
    background-color: #da3125 !important;
    border: none !important;
    min-width: 40px !important;
    width: 40px !important;
    padding: 0 !important;
    cursor: pointer;
    color: white !important;
    flex-shrink: 0;
    position: relative;
    z-index: 5; /* Asigură că butonul este deasupra */
}

/* FIX: Textul din placeholder nu dispare */
.custom-header .search-field::placeholder {
    color: #999;
    opacity: 1;
}

.custom-header .search-field:focus::placeholder {
    color: #999;
    opacity: 1; /* Menține vizibilitatea placeholder-ului */
}

/* Mobile Search Container - Redesign */
.custom-header .mobile-search-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    padding: 15px;
    z-index: 9999998;
    border-bottom: 1px solid #eaeaea;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-header .mobile-search-container.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* FIX: Layout corect pentru bara de căutare și butonul de închidere */
.custom-header .mobile-search-container .container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-header .mobile-search-container .search-form {
    margin-bottom: 0 !important;
    width: calc(100% - 48px); /* Lăsăm spațiu pentru butonul X */
}

/* FIX: Butonul de închidere nu se mai suprapune */
.custom-header .close-search {
    width: 40px;
    height: 40px;
    background: #f2f2f2;
    border: none;
    border-radius: 4px;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.custom-header .close-search:hover {
    background-color: #e0e0e0;
    color: #da3125;
}

.custom-header .search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    font-size: 20px;
    transition: color 0.2s ease;
}

/* Header Icons */
.custom-header .header-actions {
    display: flex;
    gap: 18px;
}

.custom-header .cart-link, 
.custom-header .account-link,
.custom-header .search-toggle {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 20px;
}

.custom-header .cart-icon {
    position: relative;
}

.custom-header .cart-link:hover, 
.custom-header .account-link:hover,
.custom-header .search-toggle:hover {
    color: #da3125;
}

.custom-header .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #da3125;
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Main Menu (Desktop) */
.custom-header .main-menu {
    background-color: #000;
    border-bottom: 1px solid #222;
    padding: 12px 0;
}

.custom-header .main-menu nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.custom-header .main-menu nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    font-size: 15px;
    position: relative;
    padding: 6px 0;
}

.custom-header .main-menu nav a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #da3125;
    transition: width 0.3s ease;
}

.custom-header .main-menu nav a:hover {
    color: #da3125;
}

.custom-header .main-menu nav a:hover:after {
    width: 100%;
}

.custom-header .flash-deals {
    color: #da3125 !important;
    font-weight: 600;
}

/* Animație simplă pentru coș */
.custom-header .cart-link.pulse .cart-icon {
    animation: simple-pulse 0.5s;
}

@keyframes simple-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.custom-header .mobile-only {
    display: none;
}

.custom-header .desktop-only {
    display: none;
}

/* Responsive Styles */
/* Pentru desktop (992px și mai mare) */
@media (min-width: 992px) {
    .custom-header .mobile-menu-toggle,
    .custom-header .mobile-menu-sidebar,
    .custom-header .mobile-menu-overlay,
    .custom-header .mobile-only {
        display: none;
    }
    
    .custom-header .desktop-only {
        display: block;
    }
    
    .custom-header .search-container.desktop-only {
        display: flex;
    }
    
    /* FIX: Topbar aliniat la stânga pe desktop */
    .custom-header .topbar .container {
        justify-content: space-between;
    }
    
    .custom-header .social-media {
        min-width: 150px;
    }
}

/* Pentru tableta și mobile (max 991px) */
@media (max-width: 991px) {
    /* Ascunde pentru tableta și mobile */
    .custom-header .desktop-only {
        display: none;
    }
    
    .custom-header .mobile-only {
        display: flex;
    }
    
    /* Text centrat în topbar DOAR pe mobile și tableta */
    .custom-header .topbar .container {
        justify-content: center;
    }
    
    /* Fixeaza header pentru mobile și tablete */
    .custom-header .main-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 10px 0;
        background: #fff;
        z-index: 99999;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    body {
        padding-top: 50px;
    }
    
    body.admin-bar .custom-header .main-header {
        top: 46px;
    }
    
    .custom-header .mobile-search-container {
        top: 60px;
    }
    
    body.admin-bar .custom-header .mobile-search-container {
        top: 106px;
    }
    
    /* Logo la stânga cu padding */
    .custom-header .site-branding {
        justify-content: flex-start;
        padding-left: 20px;
        flex: 1;
    }
    
    /* Afiseaza search toggle pe mobile */
    .custom-header .search-toggle {
        display: flex;
    }
}

/* Pentru mobile (maxim 767px) */
@media (max-width: 767px) {
    /* Topbar fix pe mobile */
    .custom-header .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 99998;
        background: #fff;
        padding: 5px 0;
        font-size: 12px;
        line-height: 1.4;
    }
    
    /* Text centrat în topbar */
    .custom-header .topbar .container {
        justify-content: center;
    }
    
    .custom-header .announcement-static {
        width: 100%;
        text-align: center;
        justify-content: center; /* Centrat pe mobile */
    }
    
    /* Ajustare main header pentru a fi sub topbar */
    .custom-header .main-header {
        top: 30px;
    }
    
    body {
        padding-top: 50px;
    }
    
    body.admin-bar .custom-header .topbar {
        top: 0;
    }
    
    body.admin-bar .custom-header .main-header {
        top: 30px;
    }
    
    .custom-header .mobile-search-container {
        top: 90px;
    }
    
    body.admin-bar .custom-header .mobile-search-container {
        top: 90px;
    }
    
    #wpadminbar {
        display: none !important;
    }
    
    .custom-header .social-media {
        display: none;
    }
    
    .custom-header .site-branding {
        padding-left: 10px;
    }
    
    .custom-header .custom-logo {
        max-height: 35px;
    }
}

