@import './variables.scss';

.header {
  background-color: $header-bg;
  color: white;

  .header-top {
    height: 35px;
    width: 100%;

    .header-top-text {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 8px 10px;
      color: $highlight-color;
      height: 35px;
      text-align: center;
      font-size: 14px;

      @media (min-width: 768px) {
        font-size: 16px;
      }
    }
  }

  .header-middle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #2C2E3A;

    @media (min-width: 768px) {
      padding: 16px 52px;
    }

    .logo {
      height: 27px;
      width: 108px;
    }

    .search-bar-container {
      display: flex; // Remove 'display: none;' to make it visible on mobile
      flex: 1;
      max-width: 662px;
      height: 42px;
      border-radius: 10px;
      border: 1px solid #555;
      overflow: hidden;
      margin: 0 10px; // Adjust the margin for mobile
    
      @media (min-width: 768px) {
        margin: 0 20px; // Adjust margin for larger screens
      }
    }
    
    .search-bar {
      flex: 1;
      background-color: $search-bg;
      color: #ccc;
      border: none;
      outline: none;
      padding: 0 10px;
    
      &::placeholder {
        color: #888;
      }
    }
    
    .search-button {
      display: flex;
      align-items: center;
      padding: 10px 15px;
      background-color: #fff;
      color: $search-bg;
      font-size: 17px;
      cursor: pointer;
      border: none;
    
      .social-icon {
        width: 12px;
        height: 13px;
        margin-right: 10px;
        color: #888;
      }
    }
  }
  
  .header-icons {
    display: none;

    @media (min-width: 768px) {
      display: flex;
      font-size: 17px;
      align-items: center;
    }

    .login-register {
      display: flex;
      align-items: center;
      gap: 10px;
      padding-right: 20px;

      &:hover {
        color: $highlight-color;
      }
    }

    .icon {
      display: flex;
      align-items: center;
      margin-left: 15px;

      &:hover {
        svg {
          color: $highlight-color;
        }
      }
    }

    a.social-icon {
      color: white;
      font-size: 20px;
      transition: color 0.3s ease;
    }
  }

  .nav-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;

    @media (min-width: 768px) {
      display: none;
    }
  }

  .nav {
    display: none;
    background-color: #24252a;
    padding: 10px;
    flex-direction: column;
    align-items: flex-start;

    &.nav-visible {
      display: flex;
    }

    @media (min-width: 768px) {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      padding: 15px 30px;
      flex-wrap: wrap;
    }

    a {
      color: white;
      text-decoration: none;
      padding: 12px 15px;
      width: 100%;
      text-align: left;
      font-size: 16px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);

      &:last-child {
        border-bottom: none;
      }

      @media (min-width: 768px) {
        padding: 5px 10px;
        width: auto;
        margin: 5px;
        border: none;
        font-size: 14px;
      }

      &:hover {
        color: $highlight-color;
      }
    }
  }
}




import React, { useState } from 'react';
import { Link } from 'react-router-dom'; 
import '../Assets/Css/Header.scss';
import SocialIcon from '../Components/SocialIcon.jsx';
import { faHeart, faShoppingCart, faUserCircle, faSearch, faBars, faTimes } from '@fortawesome/free-solid-svg-icons';
import '@fortawesome/fontawesome-free/css/all.min.css';
import HeaderLogo from '../Assets/Image/HeaderLogo.png';

const Header = () => {
  const [isNavVisible, setIsNavVisible] = useState(false);

  const toggleNav = () => {
    setIsNavVisible(!isNavVisible);
  };

  const navLinks = [
    { name: 'LIPS', link: '/lips' },
    { name: 'EYES', link: '/eyes' },
    { name: 'FACE', link: '/face' },
    { name: 'NAILS', link: '/nails' },
    { name: 'SKINCARE', link: '/skincare' },
    { name: 'ACCESSORIES', link: '/accessories' },
    { name: 'GIFTING', link: '/gifting' },
    { name: 'BESTSELLERS', link: '/bestsellers' },
    { name: 'NEWLAUNCHES', link: '/newlaunches' },
    { name: 'OFFERS', link: '/offers' },
    { name: 'BLOG', link: '/blog' }
  ];

  return (
    <header className="header">
      <div className="header-top">
        <div className='header-top-text'>New Exfoliate & Detox Scalp Shampoo</div>
      </div>

      <div className="header-middle">
        <div className="logo">
          <img src={HeaderLogo} alt="COMIX LOGO" className="comix-logo"/>
        </div>

        <div className="search-bar-container">
          <input className="search-bar" type="text" placeholder="Try Liquid Lipstick" />
          <button className="search-button">
            <SocialIcon icon={faSearch} link="#"/> Search
          </button>
        </div>

        <div className="header-icons">
          <span className="login-register">
            <SocialIcon icon={faUserCircle} link="#"/> Login/Register
          </span>
          <span className="icon">
            <SocialIcon icon={faHeart} link="#"/>
          </span>
          <span className="icon">
            <SocialIcon icon={faShoppingCart} link="#"/>
          </span>
        </div>

        <button className="nav-toggle" onClick={toggleNav}>
          <SocialIcon icon={isNavVisible ? faTimes : faBars} />
        </button>
      </div>

      <nav className={`nav ${isNavVisible ? 'nav-visible' : ''}`}>
        {navLinks.map((navItem, index) => (
          <Link key={index} to={navItem.link} className="nav-link" onClick={toggleNav}>
            {navItem.name}
          </Link>
        ))}
      </nav>
    </header>
  );
};


export default Header;


the  seachbar not showing in mobile view fix that make it very responsive