body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  padding: 20px 10%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #eee;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
  height: 60px;
}

.search-bar {
  display: flex;
  align-items: center;
}

.search-input {
  padding: 10px;
  width: 250px;
  border: 2px solid #5B22D4;
  border-right: none;
  border-radius: 25px 0 0 25px;
  outline: none;
  font-size: 16px;
  box-sizing: border-box;
}

.search-btn {
  padding: 10px 20px;
  border: 2px solid #5B22D4;
  border-left: none;
  background-color: #5B22D4;
  color: #fff;
  border-radius: 0 25px 25px 0;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

.search-btn:hover {
  background-color: #4a1cb3;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.nav ul li {
  display: flex;
  align-items: center;
}

.nav ul li a {
  text-decoration: none;
  color: #5B22D4;
  font-weight: 600;
  font-size: 16px;
}

.nav ul li a.active {
  color: #C5ED51;
}

.nav ul li a:hover {
  text-decoration: underline;
}

.user-menu, .design-menu {
  position: relative;
}

.user-btn, .design-btn {
  background: #fff;
  border: 2px solid #6a0dad;
  border-radius: 25px;
  padding: 8px 24px;
  font-size: 18px;
  font-weight: bold;
  color: #6a0dad;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
  box-shadow: none;
  margin: 0 8px;
  letter-spacing: 0.2px;
}

.user-btn:hover, .design-btn:hover, .user-btn:focus {
  background: #f6f2ff;
  color: #4a1cb3;
  border-color: #4a1cb3;
}

.user-menu .user-btn {
  font-size: 18px;
  font-weight: bold;
  color: #6a0dad;
  border-radius: 25px;
  border: 2px solid #6a0dad;
  background: #fff;
  margin: 0 8px;
}

.user-menu .user-btn:after {
  content: '\25BC';
  font-size: 12px;
  margin-left: 8px;
  color: #6a0dad;
  vertical-align: middle;
}

.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: #fff;
  border: 1.5px solid #eee;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(106,13,173,0.08);
  min-width: 180px;
  z-index: 1001;
  padding: 10px 0;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.dropdown.show {
  display: block;
  opacity: 1;
}

.dropdown-item {
  display: block;
  padding: 10px 18px;
  text-decoration: none;
  color: #6a0dad;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
  border-radius: 15px;
  margin: 4px 8px;
  font-weight: 600;
}

.dropdown-item:hover {
  background: #f3eaff;
  color: #4a1cb3;
}

.main {
  flex: 1;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  background-color: #fff;
}

.welcome-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 40px auto;
  padding: 20px 0;
  /* Reduce horizontal padding to bring text and image closer */
  gap: 8px; /* was 32px, now much closer */
}

.welcome-content {
  flex: 1;
  text-align: left;
  padding-right: 8px; /* was 24px */
  padding-left: 8px;  /* was 24px */
}

.welcome-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.welcome-section h1 {
  color: #5B22D4;
  font-size: 48px;
  margin-bottom: 10px;
}

.welcome-section .highlight {
  color: #C5ED51;
}

.welcome-section p {
  color: #666;
  font-size: 18px;
  margin-bottom: 30px;
}

.hero-image {
  max-width: 500px;
  width: 100%;
  height: auto;
}

.cta-buttons {
  display: flex;
  gap: 24px;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 20px;
}

.btn-explore {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(90,34,212,0.07);
  padding: 18px 32px;
  min-width: 180px;
  font-size: 1.3rem;
  font-weight: bold;
  color: #8A4AF3;
  border: none;
  outline: none;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: box-shadow 0.2s, background 0.2s, color 0.2s;
  gap: 12px;
}

.btn-explore:hover {
  box-shadow: 0 4px 24px rgba(90,34,212,0.15);
  background: #f6f2ff;
  color: #5B22D4;
}

.btn-explore .btn-icon {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.category-tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.tab {
  padding: 10px 20px;
  background-color: #0e1122;
  color: #fff;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  width: 100px;
  text-align: center;
}

.tab.active {
  background-color: #5B22D4;
}

.tab:hover {
  background-color: #4a1cb3;
}

.product-section {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 40px auto;
  padding: 0 24px;
}

.product-section h2 {
  color: #5B22D4;
  font-size: 36px;
  margin-bottom: 10px;
  text-align: center;
}

.see-all {
  background-color: #8A4AF3;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.3s;
  display: block;
  margin: 0 auto 20px auto;
  cursor: pointer;
  width: fit-content;
}

.see-all:hover {
  background-color: #6D2EC5;
}

.see-all-best-sellers {
  background-color: #8A4AF3;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.3s;
  display: block;
  margin: 0 auto 20px auto;
  cursor: pointer;
  width: fit-content;
}

.see-all-best-sellers:hover {
  background-color: #6D2EC5;
}

/* Responsive product grid: 1 per row on mobile, 2 on tablet, 4 on desktop */
.product-grid {
  position: relative;
  min-height: 200px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 64px;
  margin-bottom: 40px;
  justify-items: center;
  justify-content: center;
}

#featured-products.product-grid,
#best-seller-products.product-grid,
#designer-products.product-grid {
  gap: 16px;
  justify-content: center;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.best-seller-grid {
  display: flex;
  flex-direction: row;
  gap: 20px;
  margin-bottom: 40px;
  overflow-x: auto;
  padding: 10px 0;
  width: 100%;
}

.product-card {
  background-color: #fff;
  border: 1.5px solid #eee;
  border-radius: 15px;
  padding: 18px 18px 24px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  box-shadow: 0 6px 16px rgba(90,34,212,0.10);
  overflow: hidden;
  min-width: 220px;
  max-width: 300px;
  width: 100%;
  margin: 18px 12px 32px 12px;
  transition: box-shadow 0.2s, transform 0.2s;
  opacity: 0;
  transform: translateY(40px);
}

.product-card.animated {
  animation: fadeSlideIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes fadeSlideIn {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

.product-card:hover {
  box-shadow: 0 8px 32px rgba(90,34,212,0.18);
  transform: scale(1.04);
  z-index: 2;
}

.product-card img {
  width: 180px;
  height: auto;
  max-width: 100%;
  max-height: 240px;
  display: block;
  margin: 0 auto 18px auto;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.product-card h3 {
  color: #5B22D4;
  font-size: 18px;
  margin: 10px 0 5px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card p {
  color: #666;
  font-size: 14px;
  margin: 5px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card .price {
  color: #5B22D4;
  font-weight: bold;
  font-size: 16px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.new-label {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #C5ED51;
  color: #333;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: bold;
  z-index: 1;
}

.btn {
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.3s;
  width: 100%;
}

.btn-secondary {
  background-color: #8A4AF3;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  width: fit-content;
  margin: 0 auto;
}

.btn-secondary:hover {
  background-color: #6D2EC5;
}

.footer {
  background-color: #0e1122;
  color: #fff;
  padding: 40px 20px 20px;
  font-size: 14px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-section {
  flex: 1 1 200px;
  min-width: 180px;
}

.footer-logo {
  width: 120px;
  margin-bottom: 5px;
}

.tagline {
  margin: 8px 0;
  margin-top: 3px;
  margin-bottom: 10px;
  font-size: 17px;
  color: #ccc;
}

.support {
  margin-top: 60px;
  margin-bottom: 10px;
  color: #ddd;
}

.support a {
  color: #C5ED51;
  text-decoration: none;
}

.support a:hover {
  text-decoration: underline;
}

.social-icons a {
  display: inline-block;
  margin-right: 10px;
}

.social-icons img {
  height: 28px;
  width: 28px;
}

.footer-section h4 {
  font-size: 20px;
  margin-bottom: 20px;
  font-weight: bold;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  color: #ccc;
}

.footer-section ul li {
  margin: 6px 0;
}

.footer-section ul li a {
  color: #ccc;
  text-decoration: none;
}

.footer-section ul li a:hover {
  text-decoration: underline;
}

.payment-methods img {
  height: 30px;
  margin-right: 8px;
  margin-top: 10px;
}

.footer-bottom {
  text-align: center;
  color: #888;
  margin-top: 30px;
  border-top: 1px solid #444;
  padding-top: 15px;
  font-size: 13px;
}

.footer-bottom a {
  color: #888;
  text-decoration: none;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4vw;
    gap: 0;
  }
  .logo img, .logo {
    height: 40px !important;
    max-height: 40px !important;
  }
  .hamburger {
    display: flex;
  }
  .nav, .user-menu {
    display: none;
    width: 100%;
    background: #fff;
    position: absolute;
    left: 0;
    top: 60px;
    box-shadow: 0 4px 16px rgba(106,13,173,0.08);
    z-index: 1001;
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 16px 0;
  }
  .nav.show-mobile, .user-menu.show-mobile {
    display: flex;
  }
  .nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0;
  }
  .nav ul li {
    width: 100%;
    justify-content: center;
  }
  .user-menu {
    margin-top: 0;
    position: absolute;
    top: calc(60px + 48px * 4);
    right: 0;
    left: 0;
    border-top: 1px solid #eee;
    border-radius: 0 0 20px 20px;
    box-shadow: none;
    background: #fff;
    z-index: 1002;
  }
  .user-btn, .design-btn {
    width: 90vw;
    max-width: 350px;
    margin: 8px auto;
    font-size: 17px;
    padding: 10px 0;
  }
}

@media (max-width: 900px) {
  .welcome-section {
    gap: 4px;
  }
  .welcome-content {
    padding-right: 2px;
    padding-left: 2px;
  }
}

/* Style cho section banner */
.banner-section {
  width: 100%;
  text-align: center;
  margin-bottom: 40px;
}

.banner-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.banner-image {
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
}

/* Style cho section cam kết */
.commitment-section {
  width: 100%;
  text-align: center;
  margin-bottom: 40px;
  background-color: #f9f9f9;
  padding: 20px 0;
  position: relative;
}

.commitment-section h2 {
  color: #5B22D4;
  font-size: 36px;
  margin-bottom: 20px;
}

.commitment-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.commitment-card {
  background-color: #fff;
  border-radius: 15px;
  padding: 20px;
  width: 30%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: left;
}

.commitment-card h3 {
  color: #fff;
  background-color: #5B22D4;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-size: 18px;
}

.commitment-card ul {
  list-style: none;
  padding: 0;
  color: #333;
  font-size: 14px;
}

.commitment-card ul li {
  margin-bottom: 10px;
}

/* Vòng tròn trang trí */
.commitment-section::before,
.commitment-section::after {
  content: '';
  position: absolute;
  border: 2px solid #A3D8F4;
  border-radius: 50%;
}

.commitment-section::before {
  width: 100px;
  height: 100px;
  top: -50px;
  left: 10%;
}

.commitment-section::after {
  width: 150px;
  height: 150px;
  bottom: -75px;
  right: 10%;
}

.product-grid .empty-message {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8A4AF3;
  font-size: 20px;
  font-weight: 500;
  min-height: 200px;
  width: 100%;
  text-align: center;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-60px);}
  to { opacity: 1; transform: translateX(0);}
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px);}
  to { opacity: 1; transform: translateX(0);}
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px);}
  to { opacity: 1; transform: translateY(0);}
}

.animated-slide-left {
  animation: slideInLeft 0.8s cubic-bezier(.77,0,.18,1) both;
}
.animated-slide-right {
  animation: slideInRight 0.8s cubic-bezier(.77,0,.18,1) both;
}
.animated-fade-up {
  animation: fadeInUp 0.8s cubic-bezier(.77,0,.18,1) both;
}

/* Remove underline and arrow for unauthenticated account link and all nav buttons */
.user-btn {
  text-decoration: none !important;
  position: relative;
}
/* Only show arrow for dropdown button (authenticated users) */
#accountBtn.user-btn[onclick]:after {
  content: ' ▼';
  font-size: 14px;
  margin-left: 6px;
  vertical-align: middle;
}
/* Remove arrow for all other .user-btn (including <a> version) */
.user-btn:after {
  content: none !important;
}
#accountBtn.user-btn[onclick]:after {
  content: ' ▼';
}

/* Modal styles for login required popup */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 0;
  border-radius: 16px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 20px;
  font-weight: 600;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close:hover {
  color: #333;
}

.modal-body {
  padding: 24px;
  text-align: center;
}

.modal-icon {
  margin-bottom: 20px;
}

.modal-body p {
  margin: 8px 0;
  color: #666;
  line-height: 1.5;
  font-size: 16px;
}

.modal-body p:first-of-type {
  font-weight: 500;
  color: #333;
}

.modal-footer {
  padding: 16px 24px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-footer .btn-primary {
  background: #7B3FF2;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 140px;
}

.modal-footer .btn-primary:hover {
  background: #6B2FE2;
}

.modal-footer .btn-secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 100px;
}

.modal-footer .btn-secondary:hover {
  background: #eee;
}

/* Hamburger styles */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1002;
}
.hamburger span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 4px 0;
  background: #6a0dad;
  border-radius: 2px;
  transition: 0.3s;
}

@media (max-width: 480px) {
  .commitment-section {
    padding: 10px 0;
  }
  .commitment-container {
    flex-direction: column;
    gap: 16px;
    max-width: 100vw;
    width: 100vw;
    margin: 0;
    align-items: center;
    justify-content: center;
  }
  .commitment-card {
    width: 90vw;
    min-width: unset;
    margin: 0 auto;
    box-sizing: border-box;
  }
  .commitment-section h2 {
    font-size: 28px;
    text-align: center;
  }
}

.skeleton-loader {
  display: inline-block;
  height: 1em;
  width: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.2s infinite linear;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 200px;
  min-height: 200px;
}

.loading-spinner:after {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  border: 6px solid #e0e0e0;
  border-top: 6px solid #8A4AF3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Ensure product grid centers spinner properly */
.product-grid:has(.loading-spinner) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

/* Alternative for browsers that don't support :has() */
.product-grid .loading-spinner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}