/* =========================
   1. Cấu trúc tổng quát
   ========================= */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #fff;
  background-attachment: fixed;
  width: 100%;
  overflow-x: hidden;
}

header {
  background-color: #b0e3e3;
  max-height: 70px;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed; /* Cố định header */
  top: 0; /* Đặt header ở đầu trang */
  width: 100%; /* Bao phủ toàn bộ chiều ngang */
  z-index: 1000; /* Đảm bảo header nằm trên các phần tử khác */
}

header .logo {
  font-size: 40px;
  font-weight: bold;
  color: #e30613;
}

#menu {
  display: none;
}
.logo img {
  height: 40px;
}

header nav {
  display: flex;
  gap: 20px;
  position: relative;
  font-weight: bold;
}

header nav a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  position: relative;
}

.content {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  width: 150%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 2;
}

nav a:hover {
  color: #e30613;
}

nav a:hover + .content,
.content:hover {
  display: grid;
}

.card1 {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s;
  width: 200px;
  margin: 5px auto;
  height: 180px;
}

.card1:hover {
  transform: scale(1.1);
}

.card1 img {
  width: 100%;
  height: 70%;
  margin: 0 auto;
  display: block;
}

.card1 .info {
  padding: 10px;
  text-align: center;
  font-weight: bold;
}
a {
  text-decoration: none;
}

/*------------------------------------------------------------------------*/
.search-and-icons {
  display: flex;
  align-items: center;
  justify-items: center;
  gap: 20px;
  width: 45%;
  margin-right: 10px;
}

.search-bar {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 5px 10px;
  background-color: #fff;
}

.search-bar input {
  border: none;
  outline: none;
  padding: 5px;
}

.search-bar i {
  color: #5f5a5a;
  font-size: 18px;
  cursor: pointer;
}

.search-bar i:hover {
  color: rgba(0, 0, 0, 0.6);
  transform: scale(1.1);
}

/*---------------------------------------------------------------*/

/*----------------------------------------------------------------------*/

.login {
  font-size: 18px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
}

.login a {
  font-size: 16px;
}

.icons {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-items: center;
  justify-content: center;
}

.icons a {
  text-decoration: none;
  color: #333;
}

.icons a:hover {
  color: #e30613;
  cursor: pointer;
}

.icons img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
}

.icons i {
  font-size: 16px;
}

.icons i:hover {
  transform: scale(1.2);
}

.login {
  font-size: 18px;
}

.add-to-cart {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  cursor: pointer;
  font-size: 18px;
}

.add-to-cart:hover {
  background-color: azure;
  color: #000;
}

/* =========================
   2. Sản phẩm (Products)
   ========================= */

.product {
  position: relative;
  display: inline-block;
  margin: 20px 10px;
  width: 230px;
  height: auto;
  border: 1px solid #ddd;
}
.product img {
  width: 230px;
  height: auto;
  margin-right: 10px;
}

.info {
  flex: 1;
}

.info p {
  margin: 0 50px 10px 75px;
  color: #e30613;
}

.info h3 {
  font-size: 16px;
  color: #333;
  margin-left: 8px;
  margin-right: 8px;
}

.price {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.price i {
  margin-left: 10px;
  font-size: 18px;
  color: #999;
  cursor: pointer;
}

.price i:hover {
  color: red;
}

/* =========================
   3. Hiệu ứng Hover cho sản phẩm
   ========================= */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 70%;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
}

.product:hover .overlay {
  opacity: 0.5;
}

.add-to-cart {
  color: #000;
  border: none;
  cursor: pointer;
}

/* =========================
   4. Giỏ hàng (Cart)
   ========================= */
.cart {
  position: fixed;
  top: 15px;
  right: 2%;
  color: #333;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
}

.cart .item-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  font-size: 12px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.cart-details {
  position: fixed;
  top: 60px;
  right: 10px;
  background: white;
  width: 500px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  display: none;
}

.cart-details .cart-item {
  display: grid;
  grid-template-columns: 50px auto 80px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.cart-details .cart-item img {
  width: 50px;
  height: auto;
}

.cart-details .cart-item .details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cart-details .cart-item .controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.cart-details .cart-item .controls button {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cart-details .cart-item .controls button:hover {
  background-color: #e0e0e0;
}

.cart-details .total {
  padding: 10px;
  font-weight: bold;
  text-align: right;
}

/* =========================
   5. Danh sách yêu thích (Favorites)
   ========================= */
.favorites {
  position: fixed;
  top: 15px;
  right: 5.5%;
  padding: 10px 4px 10px 25px;
  border-radius: 50%;
  cursor: pointer;
}

.favorites .item-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  font-size: 12px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.fa-heart {
  color: #333;
  cursor: pointer;
}

.fa-heart.favorited {
  color: red;
}

.favorites-details {
  position: fixed;
  top: 60px;
  right: 10px;
  background: white;
  width: 500px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  display: none;
}

.favorites-details .favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.favorites-details .favorite-item img {
  width: 50px;
  height: auto;
  margin-right: 10px;
}

/* =========================
   6. Các quy tắc khác
   ========================= */
.fa-cart-plus {
  font-size: 30px;
}

.remove {
  display: flex;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
}

.decrease {
  display: flex;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
}

.increase {
  display: flex;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
}

.add-to-favorites {
  top: 88%;
  background: none;
  border: none;
  color: #000;
  cursor: pointer;
  right: 60px;
}

.add-to-favorites .favorited {
  color: red;
}

.controls {
  cursor: pointer;
  gap: 20px;
  font-size: 18px;
  transition: transform 0.3s ease;
}

.remove:hover {
  color: red;
  transform: scale(1.2);
}

.decrease:hover {
  color: red;
  transform: scale(1.2);
}

.increase:hover {
  color: red;
  transform: scale(1.2);
}

/*  footer */
.footer {
  background-color: #b0e3e3;
  color: #000;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  height: 200px;
  margin-top: 50px;
}

.footer .column {
  flex: 1;
  margin: 0 10px;
}

.footer .column h3 {
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: bold;
}

.footer .column ul {
  list-style: none;
  padding: 0;
}

.footer .column ul li {
  margin-bottom: 10px;
  font-size: 14px;
}

.footer .column ul li a {
  text-decoration: none;
  color: #000;
  transition: color 0.3s;
}

.footer .column ul li a:hover {
  color: #e30613;
}

.footer .contact {
  font-size: 14px;
}

.footer .contact i {
  margin-right: 10px;
}

.footer .logo img {
  width: 150px;
  margin-top: 20px;
  height: auto;
}
