* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Amazon Ember', Arial, Helvetica, sans-serif;
  background: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.4;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--amazon-blue);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-header {
  background: #232f3e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  color: white;
}

.left-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-toggle {
  font-size: 1.6rem;
  cursor: pointer;
  color: white;
  transition: color 0.2s;
}

.menu-toggle:hover {
  color: var(--amazon-orange);
}

.logo img {
  width: 100px;
  height: auto;
}

.user-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-icons a {
  color: white;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.user-icons a:hover {
  color: var(--amazon-orange);
}

.cart-icon {
  position: relative;
  font-size: 1.6rem;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--amazon-orange);
  color: #111;
  font-weight: bold;
  font-size: 0.75rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-container {
  background: white;
  padding: 10px 16px;
  position: relative;
}

.search-bar {
  display: flex;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border: 2px solid transparent;
  transition: border-color 0.2s;
  max-width: 1200px;
  margin: 0 auto;
}

.search-bar:focus-within {
  border-color: var(--amazon-orange);
}

.search-bar select {
  background: #f3f3f3;
  border: none;
  padding: 0 12px;
  font-size: 0.95rem;
  color: #555;
  cursor: pointer;
  outline: none;
  min-width: 120px;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 0 15px;
  font-size: 1rem;
  outline: none;
  width: 100%;
}

.search-bar button {
  background: var(--amazon-orange);
  color: #111;
  border: none;
  padding: 0 18px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 60px;
}

.search-bar button:hover {
  background: var(--amazon-orange-dark);
}

.delivery-bar {
  background: #37475a;
  color: white;
  padding: 10px 16px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.delivery-bar i {
  font-size: 1.2rem;
}

/* Desktop Menu Bar */
.menu-bar {
  background: #232f3e;
  color: white;
  padding: 10px 16px;
  display: flex;
  gap: 25px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  max-width: 1400px;
  margin: 0 auto;
}

.menu-bar::-webkit-scrollbar {
  display: none;
}

.menu-bar a {
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.menu-bar a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--amazon-orange);
}

/* Sidebar Menu */
.sidebar-menu {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100%;
  background: white;
  transition: left 0.3s ease;
  z-index: 2000;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,0,0,0.2);
}

.sidebar-menu.active {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #232f3e;
  color: white;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.close-btn {
  font-size: 2rem;
  cursor: pointer;
  color: white;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  color: var(--amazon-orange);
  background: rgba(255,255,255,0.1);
}

/* Sidebar Items - Updated for links */
.sidebar-menu a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.sidebar-item {
  padding: 16px 24px;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  color: var(--text-dark);
  text-decoration: none;
  background: white;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: #f7f7f7;
  color: var(--blue-link);
  border-left-color: var(--amazon-orange);
  padding-left: 21px; /* Compensate for border */
}

.sidebar-item:active {
  background: #f0f0f0;
  transform: translateX(2px);
}

.sidebar-item i {
  color: #666;
  font-size: 0.9rem;
  transition: transform 0.2s, color 0.2s;
}

.sidebar-item:hover i {
  color: var(--amazon-orange);
  transform: translateX(3px);
}

/* Sidebar scrollbar styling */
.sidebar-menu::-webkit-scrollbar {
  width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  display: none;
  animation: fadeIn 0.3s;
  backdrop-filter: blur(2px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay.active {
  display: block;
}

/* Main Content */
.main-content {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 16px;
  width: 100%;
}

/* Carousel */
.carousel {
  background: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.carousel h2 {
  font-size: 1.8rem;
  color: var(--text-dark);
  font-weight: 600;
  margin: 0;
}

.carousel-nav {
  display: flex;
  gap: 10px;
}

.carousel-nav button {
  background: white;
  border: 2px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
  color: #666;
  z-index: 10;
}

.carousel-nav button:hover {
  border-color: var(--amazon-blue);
  color: var(--amazon-blue);
  background: #f8f8f8;
}

.carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  width: 100%;
}

.carousel-track {
  display: flex;
  gap: 16px;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
}

.carousel-item {
  flex: 0 0 calc(16.666% - 13.33px); /* 6 items with gap */
  text-align: center;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  min-width: 160px;
  position: relative;
}

.carousel-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.carousel-item img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  padding: 16px;
  background: #f8f8f8;
  transition: transform 0.3s;
}

.carousel-item:hover img {
  transform: scale(1.05);
}

.carousel-item p {
  margin: 12px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
  padding: 0 8px;
}

/* Carousel Progress Indicator */
.carousel-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.progress-dot.active {
  background: var(--amazon-blue);
  transform: scale(1.2);
}

.progress-dot:hover {
  background: var(--amazon-orange);
  transform: scale(1.1);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  width: 100%;
}

.product-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  position: relative;
  opacity: 1;
  transform: scale(1);
  width: 100%;
}

.product-card.hidden {
  opacity: 0;
  transform: scale(0.8);
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.product-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  transform: translateY(-4px);
  border-color: #c7c7c7;
}

/* Single Image Layout */
.single-image {
  width: 100%;
  height: 220px;
  object-fit: contain;
  padding: 15px;
  background: white;
}

/* Multi-Image Grid Layout */
.multi-image-grid {
  display: flex;
  height: 220px;
  gap: 4px;
  padding: 4px;
  background: white;
}

.main-image {
  flex: 1;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.3s;
}

.side-images {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-image {
  flex: 1;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.side-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.3s;
}

.image-count {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
}

.product-info {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.deal-tag {
  background: var(--deal-red);
  color: white;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.product-title {
  font-size: 0.95rem;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.rating-stars {
  color: #f0c14b;
  font-size: 1rem;
}

.rating-count {
  color: #0066c0;
  font-size: 0.85rem;
  margin-left: 4px;
}

.price {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 8px 0;
  color: #b12704;
}

.old-price {
  text-decoration: line-through;
  color: #767676;
  font-size: 1rem;
  margin-left: 8px;
  font-weight: 400;
}

.savings {
  color: var(--deal-red);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 4px;
}

.prime-badge {
  color: #146eb4;
  font-size: 0.9rem;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Search Results Info */
.search-info {
  background: white;
  padding: 16px 24px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: none;
  width: 100%;
}

.search-info.active {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-results-count {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.search-query {
  color: var(--deal-red);
  font-weight: 700;
}

.clear-search {
  color: var(--blue-link);
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: underline;
  margin-top: 8px;
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.clear-search:hover {
  color: var(--deal-red);
}

/* No Results Message */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: none;
  width: 100%;
}

.no-results.active {
  display: block;
}

.no-results i {
  font-size: 3rem;
  color: #ccc;
  margin-bottom: 16px;
}

.no-results h3 {
  font-size: 1.4rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.no-results p {
  color: #666;
  margin-bottom: 16px;
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 16px;
  right: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: none;
  z-index: 1001;
  max-height: 300px;
  overflow-y: auto;
  max-width: 1200px;
  margin: 0 auto;
}

.search-suggestions.active {
  display: block;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
  text-decoration: none;
  color: var(--text-dark);
  background: white;
}

.suggestion-item:hover {
  background: #f7f7f7;
}

.suggestion-item i {
  color: #666;
  font-size: 0.9rem;
}

.suggestion-text {
  font-size: 0.95rem;
  color: var(--text-dark);
}

/* Filter Bar Styles */
.filter-bar {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-box {
  display: flex;
  gap: 10px;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.filter-tag {
  background: var(--amazon-orange);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-remove-filter {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  margin-left: 3px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-remove-filter:hover {
  background: rgba(255,255,255,0.2);
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 10px;
}

.view-options {
  display: flex;
  gap: 5px;
}

.btn-view {
  background: white;
  border: 2px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
  color: #666;
}

.btn-view.active {
  background: var(--amazon-blue);
  border-color: var(--amazon-blue);
  color: white;
}

.btn-view:hover:not(.active) {
  border-color: var(--amazon-blue);
  color: var(--amazon-blue);
}

/* Category Links Styling */
.category-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-link:hover {
  text-decoration: none;
}

/* Button Reset */
button {
  font-family: inherit;
  cursor: pointer;
}

button:focus {
  outline: 2px solid var(--amazon-orange);
  outline-offset: 2px;
}

/* Form Elements */
select, input, button {
  font-family: inherit;
}

select:focus, input:focus {
  outline: 2px solid var(--amazon-orange);
  outline-offset: 2px;
}

/* Responsive Breakpoints */
/* Large Desktop */
@media (min-width: 1400px) {
  .carousel-item {
    flex: 0 0 calc(16.666% - 13.33px);
  }
  
  .products-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Desktop */
@media (max-width: 1399px) and (min-width: 1200px) {
  .carousel-item {
    flex: 0 0 calc(20% - 12.8px); /* 5 items */
  }
  
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Laptop */
@media (max-width: 1199px) and (min-width: 992px) {
  .carousel-item {
    flex: 0 0 calc(25% - 12px); /* 4 items */
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet Landscape */
@media (max-width: 991px) and (min-width: 768px) {
  .carousel-item {
    flex: 0 0 calc(33.333% - 10.67px); /* 3 items */
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .carousel h2 {
    font-size: 1.6rem;
  }
  
  .single-image,
  .multi-image-grid {
    height: 200px;
  }
}

/* Tablet Portrait */
@media (max-width: 767px) and (min-width: 576px) {
  .carousel-item {
    flex: 0 0 calc(50% - 8px); /* 2 items */
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .carousel {
    padding: 16px;
  }
  
  .carousel h2 {
    font-size: 1.5rem;
  }
  
  .carousel-nav button {
    width: 36px;
    height: 36px;
  }
  
  .single-image,
  .multi-image-grid {
    height: 180px;
  }
  
  .product-title {
    font-size: 0.9rem;
  }
  
  .price {
    font-size: 1.2rem;
  }
  
  /* Mobile Sidebar */
  .sidebar-menu {
    width: 280px;
  }
  
  .sidebar-item {
    padding: 14px 20px;
    font-size: 0.95rem;
  }
  
  .sidebar-item:hover {
    padding-left: 17px;
  }
}

/* Mobile */
@media (max-width: 575px) {
  .top-header {
    padding: 6px 12px;
  }

  .logo img {
    width: 90px;
  }

  .user-icons {
    gap: 15px;
  }
  
  .user-icons a span {
    display: none;
  }

  .search-container {
    padding: 8px 12px;
  }
  
  .search-bar {
    height: 40px;
  }
  
  .search-bar select {
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0 8px;
  }
  
  .search-bar input {
    font-size: 0.9rem;
    padding: 0 10px;
  }
  
  .search-bar button {
    padding: 0 12px;
    min-width: 50px;
  }

  .delivery-bar {
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .menu-bar {
    padding: 8px 12px;
    gap: 15px;
  }
  
  .menu-bar a {
    font-size: 0.9rem;
    padding: 4px 6px;
  }

  .carousel {
    padding: 12px;
    margin-bottom: 16px;
  }
  
  .carousel-header {
    margin-bottom: 12px;
  }
  
  .carousel h2 {
    font-size: 1.4rem;
  }
  
  .carousel-item {
    flex: 0 0 calc(50% - 8px); /* 2 items */
  }
  
  .carousel-item img {
    height: 140px;
    padding: 12px;
  }
  
  .carousel-item p {
    font-size: 0.85rem;
    margin: 8px 0;
  }
  
  .carousel-nav button {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .product-card {
    border-radius: 8px;
  }
  
  .single-image,
  .multi-image-grid {
    height: 200px;
  }
  
  .product-info {
    padding: 12px;
  }
  
  .product-title {
    font-size: 0.9rem;
    height: 2.6em;
  }
  
  .price {
    font-size: 1.3rem;
  }
  
  .old-price {
    font-size: 0.9rem;
  }
  
  .deal-tag {
    font-size: 0.8rem;
  }
  
  .rating-stars {
    font-size: 0.9rem;
  }
  
  .rating-count {
    font-size: 0.8rem;
  }
  
  .prime-badge {
    font-size: 0.85rem;
  }
  
  /* Mobile Sidebar */
  .sidebar-menu {
    width: 260px;
  }
  
  .sidebar-header {
    padding: 16px;
  }
  
  .sidebar-header h3 {
    font-size: 1.2rem;
  }
  
  .sidebar-item {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  
  .sidebar-item:hover {
    padding-left: 13px;
  }
  
  .close-btn {
    font-size: 1.8rem;
    width: 28px;
    height: 28px;
  }
}

/* Small Mobile */
@media (max-width: 375px) {
  .logo img {
    width: 80px;
  }
  
  .user-icons {
    gap: 12px;
  }
  
  .menu-toggle {
    font-size: 1.4rem;
  }
  
  .cart-icon {
    font-size: 1.4rem;
  }
  
  .search-bar select {
    display: none;
  }
  
  .carousel-item {
    flex: 0 0 100%; /* 1 item on very small screens */
  }
  
  .carousel-item img {
    height: 160px;
  }
  
  .multi-image-grid {
    height: 180px;
  }
  
  /* Mobile Sidebar */
  .sidebar-menu {
    width: 240px;
  }
  
  .sidebar-header {
    padding: 14px;
  }
  
  .sidebar-header h3 {
    font-size: 1.1rem;
  }
  
  .sidebar-item {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  
  .sidebar-item:hover {
    padding-left: 11px;
  }
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-link:hover {
    text-decoration: none;
}