* {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
}

:root {
  --bg: #f7f9fb;
  --card: #ffffff;
  --muted: #6b7280;
  --accent: #0ea5a4;
  --accent-2: #06b6d4;
  --success: #25d366;
  --shadow: 0 6px 20px rgba(13, 38, 59, 0.08);
}

/* ✅ Global */
body {
  font-family: "Poppins", Arial, sans-serif;
  margin: 0;
  background: linear-gradient(180deg, var(--bg), #eef6f8);
  color: #0f172a;
  padding-top: 126px; /* space for sticky header */
}

/* Layout container */
.container {
  width: 100%;
  margin: 16px auto 60px;
  padding: 0 16px;
}
/* Breadcrumb */
.breadcrumb {
  background: #f8f9fa;
  padding: 10px 20px;
  font-size: 14px;
  border-bottom: 1px solid #e9ecef;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

/* Shop layout */
.shop-layout {
  display: flex;
  gap: 20px;
}
.sidebar {
  width: 250px;
  flex-shrink: 0;
}

/* Make sidebar sticky on desktop */
@media (min-width: 994px) {
  .sidebar {
    position: sticky;
    top: 142px; /* header height + container margin */
    height: fit-content;
  }
}
.main-content {
  flex: 1;
}

/* Sidebar filters */
.filter-section {
  background: var(--card);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.filter-section h3 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}
.filter-section input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.filter-section input[type="range"] {
  width: 100%;
  margin: 8px 0;
}
.price-display {
  text-align: center;
  font-weight: 600;
  color: var(--accent);
}
.filter-section label {
  display: block;
  margin: 6px 0;
  cursor: pointer;
}

/* Results count */
.results-count {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 20px;
  background: #f0f2f5;
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
}
/* ✅ Sticky Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 1100;
  box-shadow: var(--shadow);
}

.logo img {
  height: 64px;
}

/* ✅ Search Bar */
.search-box {
  flex: 1 1 480px;
  max-width: 640px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 15px;
  background: #fbfeff;
  box-shadow: 0 2px 8px rgba(14, 165, 164, 0.03) inset;
}

/* Hide search bar on desktop */
@media (min-width: 994px) {
  .search-box {
    display: none;
  }
}

/* ✅ Product Grid (Desktop: 4 items) */
.product-grid {
  display: grid;
  gap: 18px;
  padding: 6px 0 40px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  justify-content: center;
}

/* ✅ Product Card */
.product-card {
  background: var(--card);
  padding: 12px;
  border-radius: 12px;
  text-align: left;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(8, 22, 43, 0.08);
}

.product-card img {
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.product-card h3 {
  margin: 10px 0 6px 0;
  font-size: 16px;
  font-weight: 600;
}
/* ✅ Grey out out-of-stock products */
.product-card.out-of-stock {
  opacity: 0.6;
}

/* Disable only the buy button for out-of-stock products so
   image preview and sharing still work (accessibility) */
.product-card.out-of-stock .buy-btn {
  background: #ccc;
  cursor: not-allowed;
  pointer-events: none;
  color: #666;
}

/* ✅ Out of Stock text */
.out-stock-text {
  font-size: 16px;
  font-weight: bold;
  color: red;
  margin-bottom: 10px;
}

.price {
  font-size: 16px;
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 8px;
}

.price-small {
  font-size: 13px;
  color: var(--muted);
}

.price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.12);
}

.qty {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
}

.new-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ff4757;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.card-content {
  padding: 12px 0;
}

.rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.stars {
  color: #ffd700;
  font-size: 14px;
}
.reviews {
  font-size: 12px;
  color: var(--muted);
}

/* ✅ Buy Button */
.buy-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  background: #000;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  border: none;
  cursor: pointer;
  text-align: center;
}

.buy-btn:hover {
  background: #333;
}

/* ✅ Quantity Controls */
.qty-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: #e0e0e0;
}

.qty-display {
  font-weight: bold;
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

/* ✅ Sort Dropdown (Desktop) */
.sort-box {
  text-align: right;
  padding-top: 10px;
  padding-right: 10px;
}

.sort-box select {
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ddd;
}
@keyframes bounce {
  0% {
    bottom: 70px;
  }
  25% {
    bottom: 75px;
  }
  50% {
    bottom: 70px;
  }
  75% {
    bottom: 75px;
  }
  100% {
    bottom: 70px;
  }
}

/* ✅ Floating Support Button */
.floating-support {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation-name: bounce;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}
.floating-support img {
  width: 100%;
  border: 2px solid #000000;
  border-radius: 50%;
}

/* ✅ Support Menu */
.support-menu {
  position: fixed;
  bottom: 85px;
  right: 20px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.support-item {
  background: white;
  padding: 10px 15px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 16px;
}

.support-item:hover {
  background: #f0f0f0;
}

/* ✅ Mobile Sticky Search + Sort Bar (Bottom) */
.mobile-bottom-bar {
  display: none;
}

/* ✅ Sort + Title Row (Desktop) */
.sort-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ✅ Title font size desktop */
.title {
  font-size: 24px;
  margin: 0;
  font-weight: 700;
  color: #1a202c;
}

/* ✅ Sort dropdown style */
.sort-box select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
  background: #fff;
}

/* ✅ Shipping Popup Background */
.shipping-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(3px);
  background: rgba(0, 0, 0, 0.4);
  z-index: 5000;
  align-items: center;
  justify-content: center;
  padding: 20px; /* prevents sticking to edges */
}

/* ✅ Popup Box – scrollable for small screens */
.shipping-content {
  background: white;
  width: 90%;
  max-width: 350px;
  max-height: 90vh; /* ✅ Popup never exceeds screen height */
  overflow-y: auto; /* ✅ Internal scroll appears */
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  animation: popupFade 0.3s ease;
}

/* Scrollbar styling (optional) */
.shipping-content::-webkit-scrollbar {
  width: 6px;
}
.shipping-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

@keyframes popupFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shipping-content h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.shipping-content ul {
  margin-left: 18px;
  margin-bottom: 15px;
}

.shipping-content li {
  margin-bottom: 6px;
  font-size: 14px;
}

/* ✅ Close Button */
.close-btn {
  width: 100%;
  padding: 10px;
  background: #333;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.close-btn:hover {
  background: #000;
}

/* ✅ Eye Icon Hover */
.eye-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(2, 6, 23, 0.6);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  transition: 0.18s;
  cursor: pointer;
}

/* ✅ Slider Popup */
.image-popup {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
}

.image-popup-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.image-popup-content img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

/* Close button */
.close-popup {
  position: absolute;
  top: -10px;
  right: -10px;
  color: white;
  background: red;
  font-size: 20px;
  padding: 6px 10px;
  border-radius: 50%;
  cursor: pointer;
}

/* Arrows */
.arrow {
  position: absolute;
  top: 50%;
  color: white;
  font-size: 30px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}

.arrow.prev {
  left: -40px;
}
.arrow.next {
  right: -40px;
}

@media (max-width: 480px) {
  .arrow.prev {
    left: -20px;
  }
  .arrow.next {
    right: -20px;
  }
}

.share-icon {
  position: absolute;
  bottom: 0px;
  left: 4px;
  color: white;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  z-index: 5;
  width: 50px;
}

.product-card .image-wrapper {
  position: relative;
}
.tag-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #ff7a59, #ff4b7a);
  color: #fff;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 14px rgba(255, 75, 122, 0.12);
  z-index: 2;
}

/* ✅ ✅ SINGLE MOBILE BREAKPOINT */
@media (max-width: 993px) {
  /* ✅ Adjust header */
  .header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }

  .logo img {
    height: 50px;
  }

  body {
    padding-top: 70px;
    padding-bottom: 70px; /* space for bottom sticky bar */
  }

  /* ✅ Mobile: 2 items per row */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ✅ Hide header search + sort on mobile */
  .search-box,
  .sort-box {
    display: none;
  }

  /* ✅ Show bottom sticky bar */
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 8px;
    gap: 8px;
    border-top: 1px solid #ddd;
    z-index: 2000;
  }

  .mobile-bottom-bar input,
  .mobile-bottom-bar select {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
  }

  /* ✅ Floating Support Button smaller on mobile */
  .floating-support {
    width: 50px;
    height: 50px;
    font-size: 22px;
    bottom: 70px;
  }
  .support-menu {
    bottom: 128px;
  }
  .product-card h3 {
    font-size: 14px;
  }
  .product-card .price {
    margin-top: 0px;
    font-size: 14px;
  }
  .product-card .qty {
    margin-top: 0px;
  }
  .buy-btn {
    font-size: 12px;
    padding: 7px;
  }

  .sort-title-row {
    text-align: center;
  }

  /* Title fontsize on mobile (when visible anywhere else) */
  .title {
    font-size: 18px;
    margin-top: 15px;
    width: 100%;
  }
  .tag-badge {
    font-size: 10px;
  }

  /* Mobile sort-title-row */
  .sort-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 5px;
  }
  .sort-title-row .title {
    font-size: 16px;
    margin: 0;
    flex: 1;
  }
  .sort-title-row .results-count {
    font-size: 12px;
    margin: 0;
    padding: 4px 8px;
    background: #f0f2f5;
    border-radius: 4px;
    text-align: center;
    flex: 1;
  }
  .sort-box {
    display: none;
  }

  /* Hide sidebar on mobile */
  .sidebar {
    display: none;
  }
  .shop-layout {
    flex-direction: column;
  }
}

/* Cart button in header */
.cart-button {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 20px;
  position: relative;
  margin-left: auto;
}
.cart-count {
  background: #ff3b30;
  color: #fff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
}

/* Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9000;
}

/* Right side drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 360px;
  max-width: 100%;
  background: #fff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.cart-drawer.open {
  transform: translateX(0);
}
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
}
.free-shipping-banner {
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  text-align: center;
  padding: 12px 16px;
  font-weight: bold;
  font-size: 16px;
  border-bottom: 1px solid #eee;
  animation: slideIn 0.5s ease-out;
}
.free-shipping-banner .shipping-icon {
  font-size: 20px;
  margin-right: 8px;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.close-cart {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}
.cart-items {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.cart-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid #f0f0f0;
}
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
}
.cart-item .meta {
  flex: 1;
}
.cart-item .meta h4 {
  font-size: 14px;
  margin-bottom: 6px;
}
.qty-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qty-controls button {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}
.cart-footer {
  padding: 12px;
  border-top: 1px solid #eee;
}
.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: bold;
}
.proceed-btn {
  width: 100%;
  padding: 12px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}
.view-cart-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

@media (max-width: 480px) {
  .cart-drawer {
    width: 100%;
  }
}

/* ✅ Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(100px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10000;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .toast {
    bottom: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }
}
