:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --radius: 0.75rem;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background-color: var(--gray-50);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.25;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header Styles */
header {
  background-color: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 0;
  position: relative;
}

.nav-links a:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:hover:after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.search-container {
  position: relative;
}

.search-input {
  padding: 0.625rem 1rem;
  padding-right: 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  width: 220px;
  transition: all 0.2s;
  background-color: var(--gray-50);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  width: 260px;
}

.search-btn,
.cancel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.search-btn:hover {
  color: var(--primary);
}

.search-btn {
  right: 0.75rem;
}

.cancel-btn {
  display: none;
  right: 0.75rem;
  font-size: 1.5rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  color: var(--gray-700);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.menu-btn {
  display: none;
}

.icon-btn:hover {
  background-color: var(--gray-100);
  color: var(--primary);
}

.cart-count {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The actual popout */
.user-popout-container {
  position: fixed;
  top: 0;
  left: 0;
  background: #0005;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 20000;
}

/* Show when active */
.user-popout-container.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-popout {
  position: absolute;
  top: 50%;
  left: 50%;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  width: 90%;
  height: auto;
  max-width: 300px;
  max-height: 500px;
  transform: translate(-50%, -75%);
  overflow-y: auto;
}

/* User info */
.user-info {
  padding: 1rem;
  border-bottom: 1.5px solid var(--gray-200);
  text-align: center;
}

.user-info .username {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
}

.user-info .balance {
  margin-top: 0.25rem;
  color: var(--gray-700);
  font-size: 0.875rem;
}

/* Links */
.user-links {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.user-links li {
  border-top: 1px solid var(--gray-100);
}

.user-links a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.9rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.user-links a:hover {
  background: var(--primary);
  color: #fff;
}

/* Hero Section */
.hero {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  padding: 4rem 0;
  margin-bottom: 4rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.hero-text {
  flex: 1;
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-desc {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  gap: 0.5rem;
}

.btn-primary {
  background-color: white;
  color: var(--primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background-color: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hero-img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* Categories Section */
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2rem;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

.section-title p {
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.category-card {
  background-color: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.category-img {
  height: 160px;
  background: linear-gradient(to right, var(--gray-100), var(--gray-200));
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-img i {
  font-size: 3rem;
  color: var(--primary);
}

.category-content {
  padding: 1.5rem;
}

.category-content h3 {
  margin-bottom: 0.5rem;
  color: var(--gray-800);
}

.category-content p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.category-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.category-link:hover {
  text-decoration: underline;
}

/* Products Section */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.product-card {
  background-color: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product-img {
  height: 240px;
  background-color: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-slideshow {
  position: relative;
  width: 100%;
  display: flex;
  transition: transform 0.5s ease;
}

.product-slideshow img {
  width: 100%;
  height: auto;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.5s ease;
}

/* Slideshow controls */
.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  font-size: 16px;
}

.slide-btn.prev {
  left: 8px;
}

.slide-btn.next {
  right: 8px;
}

.slide-btn:hover {
  background: white;
}

.product-badge {
  position: absolute;
  top: 1rem;
  background-color: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 1;
}

.product-badge.sale {
  background-color: var(--error);
  right: 1rem;
}

.product-badge.new {
  background-color: var(--success);
  left: 1rem;
}

.product-actions {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.product-card:hover .product-actions {
  opacity: 1;
}

.action-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  background-color: white;
  color: var(--gray-700);
  border: none;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1;
}

.action-btn:hover {
  background-color: var(--primary);
  color: white;
}

.action-btn.hide {
  opacity: 0;
  pointer-events: none;
}

.product-info {
  padding: 1.5rem;
}

.product-info h3 {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.product-category {
  color: var(--gray-500);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  display: block;
}

.product-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  font-weight: 600;
  color: var(--gray-800);
}

.price del {
  color: var(--gray-500);
  font-size: 0.875rem;
  margin-right: 0.5rem;
}

.add-to-cart {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.add-to-cart:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

/* Sidebar Styles */
.menu-sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: 350px;
  max-width: 90%;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: left 0.4s ease;
  z-index: 2000;
}

/* Open State */
.menu-sidebar.active {
  left: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #333;
  cursor: pointer;
  transition: color 0.3s;
}

.close-btn:hover {
  color: #ff4d4d;
}

/* Navigation Links */
.side-nav-links {
  list-style: none;
  padding: 1rem;
  margin: 0;
  flex-grow: 1;
}

.side-nav-links li {
  margin-bottom: 1rem;
}

.side-nav-links a {
  text-decoration: none;
  color: #333;
  font-size: 1.1rem;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s;
}

.side-nav-links a:hover {
  background-color: #162b3f;
  color: #fff;
}

/* Footer Buttons */
.menu-footer {
  padding: 1rem;
  border-top: 1px solid #eee;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #162b3f;
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background-color: #0f1d2b;
}

.btn-outline {
  border: 1px solid #162b3f;
  color: #162b3f;
  background: transparent;
}

.btn-outline:hover {
  background-color: #162b3f;
  color: #fff;
}

/* Utility classes */
.w-full {
  width: 100%;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 0.75rem;
}

/* Responsive (for smaller screens) */
@media (max-width: 480px) {
  .side-nav-links a {
    font-size: 1rem;
  }
}

/* Newsletter Section */
.newsletter {
  background: linear-gradient(to right, var(--gray-800), var(--gray-900));
  color: white;
  padding: 4rem 0;
  border-radius: var(--radius);
  margin-bottom: 4rem;
}

.newsletter-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.newsletter h2 {
  margin-bottom: 1rem;
}

.newsletter p {
  margin-bottom: 2rem;
  opacity: 0.8;
}

.newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 1rem;
}

.newsletter-btn {
  padding: 0 1.5rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.newsletter-btn:hover {
  background-color: var(--primary-dark);
}

/* Footer */
footer {
  background-color: var(--gray-800);
  color: white;
  padding: 4rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-column h3 {
  font-size: 1.125rem;
  margin-bottom: 1.25rem;
  color: white;
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 0.75rem;
}

.footer-column a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: white;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--gray-700);
  border-radius: var(--radius);
  transition: background-color 0.2s;
}

.social-links a:hover {
  background-color: var(--primary);
}

.copyright {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-700);
  color: var(--gray-400);
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1060px) {
  .nav-links {
    display: none;
  }

  .menu-btn {
    display: flex;
  }

  .search-input {
    width: 280px;
  }

  .search-input:focus {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .header-content {
    gap: 1rem;
  }

  .logo {
    font-size: 1.6rem;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .search-input {
    display: none;
  }

  .cancel-btn {
    display: none;
  }

  /* When active */
  .search-container.active {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease forwards;
    z-index: 1;
  }

  .search-container.active .search-input {
    display: block;
    width: 100%;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.625rem 2rem 0.625rem;
  }

  .search-container.active .search-btn {
    left: 1.75rem;
    right: auto;
    color: var(--primary);
  }

  .search-container.active .cancel-btn {
    display: block;
    right: 1.75rem;
  }

  @keyframes slideDown {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .newsletter-form {
    flex-direction: column;
    gap: 1rem;
  }

  .newsletter-input,
  .newsletter-btn {
    border-radius: var(--radius);
    width: 100%;
  }
}

@media (max-width: 500px) {
  .logo {
    font-size: 1.4rem;
  }

  .header-actions {
    gap: 1rem;
  }

  .icon-btn {
    width: 1rem;
  }
}

/* 🛒 Cart Button */
.cart-btn {
  padding: 10px 20px;
  background: var(--bs-primary, #4CAF50);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

.cart-btn:hover {
  background: var(--bs-accent, #FFB547);
}

/* Sidebar Base */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 350px;
  max-width: 90%;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.4s ease;
  z-index: 2000;
}

/* Open State */
.cart-sidebar.active {
  right: 0;
}

/* Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  z-index: 1500;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Cart Header */
.cart-header {
  padding: 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Cart Items */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.cart-item img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 12px;
}

.item-info {
  flex: 1;
}

.item-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.item-price {
  margin: 2px 0 0;
  color: #444;
  font-weight: bold;
  font-size: 0.9rem;
}

.remove-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.remove-btn:hover {
  color: #e74c3c;
}

/* Cart Footer */
.cart-footer {
  padding: 16px;
  border-top: 1px solid #eee;
}

.cart-total {
  margin-bottom: 10px;
  font-size: 1rem;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.qty-btn {
  background: #ddd;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  line-height: 0;
  transition: background 0.2s ease;
}

.qty-btn:hover {
  background: #bbb;
}

.qty {
  min-width: 20px;
  text-align: center;
  font-weight: bold;
}

.checkout-btn {
  width: 100%;
  padding: 12px;
  background: var(--bs-primary, #4CAF50);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.checkout-btn:hover {
  background: var(--bs-accent, #FFB547);
}

/* Responsive */
@media (max-width: 500px) {
  .cart-sidebar {
    width: 100%;
  }
}