/**
 * Pungescu Header Styles
 * 
 * @package Understrap
 */

/* ========== Header Wrapper ========== */
#wrapper-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========== Desktop Header ========== */
.pungescu-desktop-header {
    display: block;
}

.pungescu-mobile-header {
    display: none;
}

/* ========== Above Header Bar ========== */
.ast-above-header-bar {
    background-color: #f5f5f5;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.ast-builder-grid-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header-above-section-left,
.site-header-above-section-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ast-builder-menu-1 .main-header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
}

.ast-builder-menu-1 .menu-item a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.ast-builder-menu-1 .menu-item a:hover {
    color: #4caf50;
}

.header-contact-item {
    font-size: 14px;
}

.contact-icon-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-icon-link:hover {
    color: #4caf50;
}

.contact-icon-link img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.contact-icon-link .contact-text {
    font-size: 14px;
}

/* ========== Primary Header Bar ========== */
.ast-primary-header-bar {
    background-color: #ffffff;
    padding: 20px 0;
}

.site-header-primary-section-left {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.site-branding .custom-logo {
    max-height: 60px;
    width: auto;
}

.ast-builder-menu-3 {
    flex: 1;
}

.ast-builder-menu-3 .main-header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.ast-builder-menu-3 .menu-item a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 15px;
    display: block;
    transition: color 0.3s;
}

.ast-builder-menu-3 .menu-item a:hover,
.ast-builder-menu-3 .current-menu-item a {
    color: #4caf50;
}

.ast-builder-menu-3 .menu-item.menu-item-has-children {
    position: relative;
}

/* Arrow for menu items with submenu */
.ast-builder-menu-3 .menu-item.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #333;
    border-bottom: 1.5px solid #333;
    transform: rotate(-45deg);
    margin-left: 8px;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.ast-builder-menu-3 .menu-item.menu-item-has-children:hover > a::after {
    transform: rotate(45deg);
}

.ast-builder-menu-3 .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    border-top: 3px solid #4caf50;
}

.ast-builder-menu-3 .menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
}

.ast-builder-menu-3 .sub-menu .menu-item a {
    padding: 8px 20px;
    font-size: 14px;
}

.site-header-primary-section-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ast-header-account svg,
.ast-header-woo-cart svg {
    width: 24px;
    height: 24px;
    fill: #333;
    transition: fill 0.3s;
}

.ast-header-account a:hover svg,
.ast-header-woo-cart a:hover svg {
    fill: #4caf50;
}

.cart-container {
    position: relative;
    display: inline-block;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #4caf50;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* ========== Below Header Bar ========== */
.ast-below-header-bar {
    background-color: #2d2d2d;
    padding: 12px 0;
}

.site-header-below-section-left {
    flex: 1;
}

.ast-builder-menu-2 .main-header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
}

.ast-builder-menu-2 .menu-item a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.ast-builder-menu-2 .menu-item a:hover {
    color: #4caf50;
}

.site-header-below-section-right {
    max-width: 350px;
}

.woocommerce-product-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 5px;
}

.woocommerce-product-search .search-field {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.woocommerce-product-search .search-field::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.woocommerce-product-search .search-submit {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.woocommerce-product-search .search-submit:hover {
    opacity: 0.8;
}

.woocommerce-product-search .search-submit svg {
    stroke: #fff;
}

/* ========== Mobile Header ========== */
.menu-toggle {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    fill: #333;
}

/* Mobile icons row */
.mobile-icons-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.mobile-icons-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-contact-icons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-icon-link {
    display: flex;
    align-items: center;
}

.mobile-icon-link img {
    width: 24px;
    height: 24px;
}

.mobile-phone-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.mobile-phone-link img {
    width: 24px;
    height: 24px;
}

.mobile-phone-link:hover {
    color: #4caf50;
}

.ast-mobile-header-content {
    display: none;
    background: #fff;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ast-mobile-header-content.active {
    display: block;
}

.ast-builder-menu-mobile .main-header-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ast-builder-menu-mobile .menu-item {
    border-bottom: 1px solid #e0e0e0;
}

.ast-builder-menu-mobile .menu-item a {
    display: block;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    font-size: 15px;
}

.ast-builder-menu-mobile .menu-item a:hover {
    color: #4caf50;
}

/* ========== Responsive ========== */
@media (max-width: 991px) {
    .pungescu-desktop-header {
        display: none;
    }
    
    .pungescu-mobile-header {
        display: block;
    }
    
    .ast-above-header-bar {
        padding: 12px 0;
    }
    
    .site-branding .custom-logo {
        max-height: 50px;
    }
    
    .ast-primary-header-bar {
        padding: 12px 0;
    }
}

@media (max-width: 767px) {
    .site-branding .custom-logo {
        max-height: 40px;
    }
    
    .ast-header-account svg,
    .ast-header-woo-cart svg {
        width: 20px;
        height: 20px;
    }
}

/* ========== Search Autocomplete ========== */
.search-autocomplete-wrapper {
    position: relative;
    display: inline-block;
}

.search-autocomplete-wrapper .woocommerce-product-search {
    display: flex;
}

.search-autocomplete-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 350px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    margin-top: 5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.focused {
    background-color: #f8f9fa;
}

.search-result-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #1e3a5f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    font-size: 13px;
    color: #c0392b;
    font-weight: 600;
}

.search-result-price del {
    color: #999;
    font-weight: 400;
    margin-right: 5px;
}

.search-result-price ins {
    text-decoration: none;
}

.search-loading,
.search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* ========== Mini Cart Popup ========== */
.ast-header-woo-cart {
    position: relative;
}

.mini-cart-popup {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: -10px;
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    padding-top: 15px;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.mini-cart-popup::before {
    content: '';
    position: absolute;
    top: 7px;
    right: 30px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

/* Invisible bridge to keep hover state */
.mini-cart-popup::after {
    content: '';
    position: absolute;
    top: -20px;
    right: 0;
    width: 100%;
    height: 20px;
}

.ast-header-woo-cart:hover .mini-cart-popup {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
}

.mini-cart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
}

.mini-cart-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    display: none;
}

.mini-cart-items {
    max-height: 280px;
    overflow-y: auto;
    padding: 10px 0;
}

.mini-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f5f5f5;
}

.mini-cart-item:last-child {
    border-bottom: none;
}

.mini-cart-item-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.mini-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mini-cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.mini-cart-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #2d2d2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-cart-item-qty {
    font-size: 13px;
    color: #666;
}

.mini-cart-empty {
    padding: 30px 20px;
    text-align: center;
}

.mini-cart-empty p {
    color: #999;
    font-size: 14px;
    margin: 0;
}

.mini-cart-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #f0f0f0;
}

.mini-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 600;
    color: #2d2d2d;
}

.mini-cart-total-price {
    color: #4caf50;
}

.mini-cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: #4caf50;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
}

.mini-cart-checkout-btn:hover {
    background: #43a047;
    color: #ffffff;
}

.mini-cart-view-btn {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    color: #666;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mini-cart-view-btn:hover {
    background: #f5f5f5;
    color: #2d2d2d;
}
