* {
  box-sizing: border-box;
  margin: 0;
  font-family:-apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif;

}

header {
  background-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 12px 0;

  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}
  


.container-header {
  max-width: 1280px;
  margin: 0 auto;
  font-size: 15px;
  font-weight: 400;
  line-height: 21px;
  height: 70px;
}

/* Layout */
.row-header {
  display: flex;
  align-items: center;
  justify-content: center; /* căn giữa menu */
}

/* Logo */
.row-header-logo {
  width: 200px;
  height: auto;
}
.logo-header img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Navigation Items */
.row-header-item {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  justify-content: center; /* căn giữa các item trong menu */
  flex: 1; /* cho phép chiếm không gian để căn giữa */
}

/* Each Menu Item */
.row-header-item a {
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  padding: 10px;
  transition: color 0.3s;
  position: relative;
}

/* Arrow Down ONLY for .dropdown > a */
/* Arrow Down ONLY for .dropdown > a */
.dropdown > a::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #ffffff;
  transition: transform 0.3s ease, border-top-color 0.3s ease;
  transform: rotate(0deg);
}

.row-header-item a:hover {
  color: #ad7555;
}

/* Dropdown Wrapper */
.dropdown {
  position: relative;
}

/* Luôn ẩn dropdown-menu mặc định */
.dropdown-menu {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 20px;
  min-width: 800px;
  z-index: 999;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.dropdown.open .dropdown-menu {
  display: grid !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Small Dropdown (for few items) */
.dropdown-submenu {
  display: none;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 15px 20px;
  min-width: 200px;
  z-index: 999;
}

.dropdown:hover .dropdown-submenu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* List inside both dropdown types */
.dropdown-menu ul,
.dropdown-submenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-menu li,
.dropdown-submenu li {
  margin-bottom: 10px;
}

.dropdown-menu li:first-child,
.dropdown-submenu li:first-child {
  font-weight: bold;
  margin-bottom: 12px;
}

.dropdown-menu li a,
.dropdown-submenu li a {
  display: block;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  transition: color 0.2s;
}

.dropdown-menu li a:hover,
.dropdown-submenu li a:hover {
  color: #ad7555;
}

/* Header Icons Area with Font Awesome */
.row-header-icon {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 15px;
}

.row-header-icon .icon-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-header-icon .icon-wrapper i {
  color: #fff;
  font-size: 1.2em;
  transition: color 0.18s;
}

.row-header-icon .icon-wrapper .icon-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  line-height: 1;
  box-shadow: 0 1px 4px #0002;
}

.row-header-icon .icon-wrapper:hover,
.row-header-icon .icon-wrapper.active {
  box-shadow: 0 4px 16px #b2653322;
}

.row-header-icon .icon-wrapper:hover i,
.row-header-icon .icon-wrapper.active i {
  color: #a04e2e;
  transition: color 0.18s;
}

.row-header-icon .icon-wrapper a {
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

/* Fullscreen Search Modal */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.25);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.search-overlay.active { display: flex; }
.search-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px 24px 18px 24px;
  min-width: 320px;
  max-width: 96vw;
  box-shadow: 0 4px 32px #0002;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-modal-box input[type="text"] {
  font-size: 1.08rem;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  outline: none;
}
.search-modal-box .search-btn {
  background: #b26533;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 16px;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: 4px;
}
.search-modal-box .close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #b26533;
  margin-left: 8px;
  cursor: pointer;
}

/* Cart Modal */
.cart-modal {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1001;
  display: none;
  justify-content: flex-end;
  align-items: stretch;
}

.cart-modal.active { display: flex; }

.cart-modal-content {
  background: #fff;
  width: 400px;
  max-width: 95vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px 0 0 12px;
  box-shadow: -2px 0 16px rgba(0,0,0,0.08);
  animation: slideInCart .3s;
  position: relative;
}

@keyframes slideInCart {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.cart-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px 10px 22px;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid #eee;
}

.close-cart {
  background: none;
  border: none;
  font-size: 28px;
  color: #b65c3d;
  cursor: pointer;
}

.cart-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 22px 0 22px;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid #f2e7df;
  padding: 14px 0;
  position: relative;
}

.cart-item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f5;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 2px;
}

.cart-item-variant {
  font-size: 13px;
  color: #888;
  margin-bottom: 4px;
}

.cart-item-qty-form {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.qty-btn {
  background: #f5e7df;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 18px;
  color: #b65c3d;
  cursor: pointer;
}

.cart-qty-input {
  width: 36px;
  text-align: center;
  border: 1px solid #d9bba7;
  border-radius: 4px;
  font-size: 15px;
  padding: 2px 0;
}

.cart-item-remove-form {
  display: inline;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #b65c3d;
  font-size: 14px;
  cursor: pointer;
  margin-left: 8px;
}

.cart-item-price {
  font-weight: 600;
  color: #b65c3d;
  font-size: 16px;
  min-width: 90px;
  text-align: right;
}

.cart-empty {
  text-align: center;
  color: #888;
  margin: 40px 0;
  font-size: 16px;
}

.cart-modal-footer {
  border-top: 1px solid #eee;
  padding: 16px 22px 12px 22px;
  background: #fff;
}

.cart-total {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.cart-modal-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.cart-btn {
  flex: 1;
  background: #fff;
  border: 1.5px solid #b65c3d;
  color: #b65c3d;
  border-radius: 6px;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.cart-btn.primary {
  background: #b65c3d;
  color: #fff;
}

.cart-btn.primary:hover {
  background: #a04e2e;
}

.cart-continue {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-top: 2px;
}

/* Responsive Layout */
@media (max-width: 768px) {
  .row-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .row-header-item {
    flex-direction: column;
    gap: 10px;
  }

  .dropdown-menu,
  .dropdown-submenu {
    position: static;
    box-shadow: none;
    transform: none;
    padding: 10px 0;
    grid-template-columns: none;
    display: block;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .row-header-icon {
    margin-top: 10px;
  }
}
.favorite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.favorite-item {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 5px;
  width: 100%;
  max-width: 400px;
}
.product-image img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  margin-right: 15px;
}
.product-info h3 {
  margin: 0 0 10px;
}
.action-buttons {
  display: flex;
  gap: 10px;
}
/* Căn giữa toàn bộ danh sách yêu thích */
.favorite-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  margin: 40px 0 60px 0;
}

     
.btn-outline {
  border: 1px solid #bfa084;
  background: #fff;
  color: #bfa084;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-outline:hover {
  background: #bfa084;
  color: #fff;
}
.btn-primary {
  background: #bfa084;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: #a07a4d;
}
.cart-count-dropdown {
  position: absolute;
  top: 38px;
  right: -18px;
  min-width: 180px;
  background: #fff8f0;
  color: #bfa084;
  border-radius: 8px;
  box-shadow: 0 4px 16px #0001;
  padding: 8px 14px 8px 14px;
  font-size: 0.98rem;
  font-weight: 500;
  z-index: 100;
  text-align: center;
  border: none;
  display: block;
  animation: cartDropdownFade .3s;
}
.cart-count-arrow {
  position: absolute;
  top: -10px;
  right: 22px;
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 11px solid #fff8f0;
  filter: drop-shadow(0 -2px 2px #e7d3c0);
  z-index: 101;
}
@keyframes cartDropdownFade {
  from { opacity: 0; transform: translateY(-10px);}
  to   { opacity: 1; transform: translateY(0);}
}

/* Spinner loading hiệu ứng */
#global-loading .spinner {
  border: 6px solid #eee;
  border-top: 6px solid #bfa084;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  animation: spin 1s linear infinite;
  margin: auto;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* Tablet: <= 900px */
@media only screen and (max-width: 900px) {
  .container-header {
    max-width: 100vw;
    padding: 0 12px;
    height: auto;
  }
  .row-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    height: auto;
  }
  .row-header-logo {
    width: 150px;
    margin-bottom: 8px;
  }
  .row-header-item {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .row-header-icon {
    margin-top: 8px;
    gap: 10px;
  }
  .dropdown-menu,
  .dropdown-submenu {
    min-width: 220px;
    grid-template-columns: 1fr;
    padding: 10px 0;
    position: static;
    box-shadow: none;
    border-radius: 8px;
  }
}

/* Mobile: <= 600px */
@media only screen and (max-width: 600px) {
  header {
    padding: 6px 0;
  }
  .container-header {
    padding: 0 4vw;
    height: auto;
  }
  .row-header-logo {
    width: 110px;
  }
  .row-header-item a {
    font-size: 1rem;
    padding: 8px 4px;
  }
  .row-header-icon {
    font-size: 1rem;
    gap: 8px;
  }
  .dropdown-menu,
  .dropdown-submenu {
    min-width: 140px;
    padding: 6px 0;
    font-size: 0.98rem;
  }
  .cart-modal-content {
    width: 98vw;
    border-radius: 0;
  }
}

/* Siêu nhỏ: <= 400px */
@media only screen and (max-width: 400px) {
  .row-header-logo {
    width: 80px;
  }
  .row-header-item a {
    font-size: 0.95rem;
    padding: 6px 2px;
  }
  .row-header-icon {
    font-size: 0.95rem;
    gap: 6px;
  }
}

/* Hamburger menu button */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1200;
  margin-right: 8px;
}
.menu-toggle span {
  display: block;
  height: 4px;
  width: 28px;
  background: #ad7555;
  margin: 4px 0;
  border-radius: 2px;
  transition: 0.3s;
}

/* Show hamburger on mobile */
@media only screen and (max-width: 900px) {
  .menu-toggle {
    display: flex;
  }
  .row-header-item {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 18px 0 18px 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-120%);
    transition: transform 0.3s;
    z-index: 1100;
    min-height: 180px;
    width: 100vw;
  }
  .row-header-item.open {
    transform: translateY(0);
  }
  .row-header-item a {
    color: #ad7555;
    font-size: 1.1rem;
    padding: 12px 0;
    width: 100%;
    border-bottom: 1px solid #f2e7df;
  }
}

.header-right-group {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 8px;
}

/* Đưa sang phải trên mọi thiết bị */
.row-header {
  display: flex;
  align-items: center;
}

/* Responsive cho mobile */
@media only screen and (max-width: 900px) {
  .header-right-group {
    margin-left: auto;
    flex-direction: row-reverse;
    gap: 8px;
  }
  .menu-toggle {
    display: flex;
    margin-left: 8px;
    margin-right: 0;
  }
  .row-header-icon {
    gap: 8px;
  }
}
.social-float-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.social-float-btn:hover img {
  filter: brightness(0) invert(1); /* Đổi màu icon khi hover, tùy chỉnh nếu cần */
}