/**
 * Header Search Component - Lin Teas
 * Barre de recherche intégrée au header avec responsive design
 *
 * @package LinTeas
 * @since 1.0.0
 */

/* Conteneur de la barre de recherche */
.header-search {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 1.5rem;
}

/* Formulaire de recherche */
.woocommerce-product-search {
    position: relative;
    display: flex;
    align-items: center;
}

/* Champ de recherche */
.woocommerce-product-search .search-field {
    width: 250px;
    height: 40px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 2px solid #ACD7D2;
    border-radius: 20px;
    font-size: 14px;
    font-family: var(--font-secondary);
    transition: all 0.3s ease;
    background: #FFFFFF;
    color: #333333;
}

/* Focus sur le champ de recherche */
.woocommerce-product-search .search-field:focus {
    outline: none;
    border-color: #7FB3A3;
    width: 350px;
    box-shadow: 0 2px 8px rgba(172, 215, 210, 0.3);
}

/* Placeholder */
.woocommerce-product-search .search-field::placeholder {
    color: #999999;
}

/* Bouton de soumission */
.woocommerce-product-search .search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7FB3A3;
    transition: color 0.3s ease;
}

/* Hover sur le bouton */
.woocommerce-product-search .search-submit:hover {
    color: #D3AE27;
}

/* Icône SVG */
.woocommerce-product-search .search-submit svg {
    width: 20px;
    height: 20px;
}

/* Screen reader text (accessibilité) */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   RESPONSIVE - TABLET (768px - 1200px)
   ============================================ */
@media (max-width: 1200px) {
    .woocommerce-product-search .search-field {
        width: 200px;
    }
    
    .woocommerce-product-search .search-field:focus {
        width: 300px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (<768px)
   ============================================ */
@media (max-width: 768px) {
    .header-search {
        margin-right: 0.5rem;
    }
    
    /* Masquer le champ par défaut */
    .woocommerce-product-search .search-field {
        width: 0;
        padding: 0;
        border: none;
        opacity: 0;
        pointer-events: none;
        transition: none;
    }
    
    /* Bouton visible en permanence */
    .woocommerce-product-search .search-submit {
        position: static;
        transform: none;
        padding: 0.75rem;
    }
    
    /* Overlay mobile au clic */
    .header-search.active .woocommerce-product-search {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.8);
        z-index: 9999;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 2rem;
    }
    
    /* Champ visible dans l'overlay */
    .header-search.active .search-field {
        width: 90%;
        max-width: 500px;
        opacity: 1;
        pointer-events: all;
        border: 2px solid #ACD7D2;
        padding: 0.75rem 3rem 0.75rem 1rem;
        height: 50px;
        font-size: 16px;
    }
    
    /* Bouton dans l'overlay */
    .header-search.active .search-submit {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
}

