* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ========== GENERAL LAYOUT ========== */
main.product-page {
  padding: 40px 30px;
}

.product-container {
  display: flex;
  gap: 40px;
  max-width: 1300px;
  margin: 0 auto;
  flex-wrap: wrap;
}

/* ========== GALLERY ========== */
.product-gallery {
  flex: 1;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Slider wrapper */
.slider {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

/* Main image styling */
.main-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Nav arrows — already fine */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
  z-index: 5;
}

#prevSlide {
  left: 10px;
}

#nextSlide {
  right: 10px;
}

.nav-arrow:hover {
  background: #ddd;
}

/* Thumbnails */
.thumbnails {
  display: flex;
  flex-wrap: wrap;         /* Allow wrapping to avoid scrolling */
  gap: 14px;
  justify-content: center;
  padding-top: 6px;
  overflow-x: hidden;      /* Hides horizontal scroll */
}

.thumb {
  width: 70px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  filter: blur(1px) grayscale(40%);
  opacity: 0.5;
  transition: 0.4s ease;
}

.thumb.active,
.thumb:hover {
  filter: none;
  opacity: 1;
  transform: scale(1.05) rotate(1deg);
}

.thumbnails::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* ========== DESCRIPTION AREA ========== */
.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-width: 300px;
  padding-right: 0px;
}

.product-info h1 {
  font-size: 2.1rem;
}

.description {
  color: #555;
  line-height: 1.6;
  font-weight: 502;
}

.price {
  font-size: 15.4px;
  font-weight: 800;
  color: #555;
}

.add-to-cart {
  padding: 14px 20px;
  background: #111;
  color: #fff;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.add-to-cart:hover {
  background: #333;
}

.payfast-btn {
  background-color: #ccc; /* Match add-to-cart background */
  color: #f9f9f9;
  border: none;
  padding: 14px 20px; /* Match add-to-cart padding */
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 15px;
  border-radius: 6px; /* Match add-to-cart border radius */
  width: 100%; /* Make it responsive */
  transition: background-color 0.3s ease;
}
.payfast-btn:hover {
  background-color: #333; /* Match add-to-cart hover */
}

.main-img-wrapper {
  width: 100%;
  height: 400px; /* You can adjust this to your desired size */
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff; /* shows as border for smaller imgs */
  overflow: hidden;
}

.main-img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* ======= RECOMMENDATION SECTION ======= */
.recommendation-wrapper {
  max-width: 1300px;
  margin: 40px auto 0 auto;
  padding: 0 20px;
}

.recommendation-title {
  text-align: center;
  font-size: 30px;
  margin-bottom: 20px;
}

/* ========== 4 per row + 4 visible (1025px and up) ========== */
@media (min-width: 1025px) {
  .recommendations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-bottom: 40px;
  }

  .recommendations-grid > .pro {
    display: none;
  }

  .recommendations-grid > .pro:nth-child(-n+4) {
    display: block;
  }
}

/* ======= PRODUCT CARD STYLE (reused from shop.html) ======= */
.pro {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.pro:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.pro-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-img {
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
  display: block;
  border-radius: 0;
}

.product-img .hover-img {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.pro:hover .hover-img {
  opacity: 1;
}

.pro:hover .main-img {
  opacity: 0;
}

.des {
  text-align: left;
  padding: 10px 0;
}

.des h5 {
  font-size: 14px;
  color: #222;
  margin-top: 5px;
}

.des h4 {
  font-size: 16px;
  font-weight: 700;
  color: #444;
  margin-top: 5px;
}

/* Add-to-Cart Button */
.add-to-cart-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  z-index: 5;
}

.add-to-cart-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.btn-icon {
  width: 24px;
  height: 24px;
}

/* Cart Count */
#cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: crimson;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  line-height: 1;
  z-index: 2;
  display: none; /* hidden by default for fallback */
}

.cart-wrapper {
  position: relative;
  display: inline-block;
}

#navbar a:hover,
#navbar a.active {
  color: #afafaf;
}

/* Show hamburger and close icons only on mobile */
#bar,
#close {
  color: #222; /* Dark color for visibility on white navbar */
}

.logo {
  display: block;
}

/* ======= Mobile Dot Indicators ======= */
.mobile-dots {
  display: none; /* Hidden by default */
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.mobile-dots .dot {
  width: 10px;
  height: 10px;
  background: #bbb;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.mobile-dots .dot.active {
  background: #333;
}

/* ========== DESKTOP + MOBILE CART DRAWER ========== */
#mobileCartDrawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 400px;
  max-width: 100%;
  height: 100vh;
  background: #fff;
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
}
#mobileCartDrawer.open {
  right: 0;
}

/* Header */
#mobileCartHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  font-size: 1.2rem;
  border-bottom: 1px solid #ddd;
}

/* Close Button */
#closeCartDrawer {
  background: none;
  border: none;
  font-size: 40px;
  cursor: pointer;
}

/* === Cart Item Structure === */
#mobileCartItems {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
#mobileCartItems .cart-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  position: relative;
}
#mobileCartItems .cart-img {
  width: 100px;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
#mobileCartItems .cart-details {
  flex: 1;
  margin-left: 12px;
  display: flex;
  flex-direction: column;
}
#mobileCartItems .cart-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
#mobileCartItems .cart-price {
  font-size: 14px;
  color: #444;
  margin-bottom: 8px;
}
/* ===== Cart Size: Mobile & Desktop Unified Styling ===== */
.cart-size {
  font-size: 13px;
  color: #666;
  margin-top: -4px;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Mobile-specific tweaks if needed */
@media (max-width: 768px) {
  #mobileCartItems .cart-size {
    font-size: 13px;
    color: #777;
    margin-top: -4px;
    margin-bottom: 6px;
  }
}

#mobileCartItems .quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
#mobileCartItems .qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: #f0f0f0;
  font-size: 18px;
  border-radius: 6px;
  cursor: pointer;
  color: #222;
  transition: background 0.2s;
}
#mobileCartItems .qty-btn:hover {
  background: #ddd;
}
#mobileCartItems .qty-num {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.remove-item-mobile {
    position: absolute;
    top: -38px;
    background: transparent;
    border: none;
    font-size: 18px;
    padding: 0;
    right: -10px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.remove-item-mobile .bin-icon {
  width: 29px;
  height: 118px;
  object-fit: contain;
  filter: invert(0.4); /* optional */
  transition: transform 0.2s ease;
}

.remove-item-mobile:hover .bin-icon {
  transform: scale(1.15);
  filter: invert(0); /* optional */
}

/* Footer */
#mobileCartFooter {
  padding: 16px;
  border-top: 1px solid #ddd;
}
.checkout-bar {
  width: 100%;
  padding: 12px;
  background: #000;
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 8px;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.3); /* Slight dark overlay */
  z-index: 9;
  display: none;
}

/* ========== REMOVE HOVER FOR SEARCH ICON ========== */
.search-info a,
.search-info a:visited,
.search-info a:hover,
.search-info a:active {
  color: inherit !important;
  text-decoration: none !important;
}

.success-wrapper {
  max-width: 600px;
  margin: 5rem auto;
  text-align: center;
  padding: 32px;
  background: white;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
}

.checkmark-circle {
  width: 120px;
  height: 120px;
  border: 4px solid #007bff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.checkmark {
  font-size: 60px;
  color: #007bff;
}

.thank-you {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.order-received {
  font-size: 1.2rem;
  color: #555;
}

.return-home {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 1.5rem;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: 0.2s;
}

.return-home:hover {
  background-color: #0056b3;
}

.cancel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80vh;
  text-align: center;
  color: #fff;
  font-family: 'Arial', sans-serif;
}

.cancel-circle {
  background-color: #df0e0e; /* red */
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(224, 36, 36, 0.5);
}

.cancel-icon {
  color: #fff;
  font-size: 4rem;
  font-weight: 900;
  line-height: 0;
}

.cancel-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cancel-message {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 1.5rem;
}

/* === Footer Structure === */
.footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: #eee;
  padding: 30px 60px;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  align-items: center;
}

.footer-right {
  display: flex;
  flex-direction: column;
  text-align: right;
  gap: 10px;
}

.custom-select-wrapper {
  position: relative;
  width: 150px;
}

.custom-select {
  position: relative;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 10px;
  cursor: pointer;
  background-color: white;
}

.selected-option {
  font-size: 14px;
}

.arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 14px;
  color: #333;
  pointer-events: none;
}

.options {
  display: none;
  position: absolute;
  bottom: 100%; /* ✅ Now opens upward */
  left: 0;
  right: 0;
  border: 1px solid #333;
  border-bottom: none; /* since it's above */
  background: white;
  z-index: 100;
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

.options li {
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
}

.options li:hover {
  background-color: #f0f0f0;
}

/* === Footer Links === */
.footer-copy {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 15px;
  font-size: 13px;
}

.footer-links .policy-link {
  text-decoration: none;
  color: #333;
  transition: color 0.2s ease;
}

.footer-links .policy-link:hover {
  color: #000;
}

@media (min-width: 641px) and (max-width: 768px) {
  .slider {
    width: 100%;
    overflow: visible;
    position: relative;
  }

  .main-img-wrapper {
    width: 100%;
    height: auto;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .main-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }

  .nav-arrow {
    display: block !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
  }

  #prevSlide {
    left: 8px;
  }

  #nextSlide {
    right: 8px;
  }
}


/* ========== MOBILE NAVBAR + SEARCH + RECOMMENDATION FIXES ========== */
@media (max-width: 768px) {
  html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }
  
  .main-img-wrapper {
    width: 100%;
    height: 400px; /* You can adjust this to your desired size */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff; /* shows as border for smaller imgs */
    overflow: hidden;
  }
  
  .main-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
  }
  
  /* Clear all margins from slider and parents */
  main.product-page {
    padding: 0;
    margin: 0;
  }
  
  .product-container {
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
  }
  
  .product-gallery {
    width: 100%;
    padding: 0;
    margin: 0;
    margin-top: 30px ;
  }
  
  .slider {
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    background-color: #f8f8f8;
  }
  
  .main-img {
    width: 100vw;
    max-width: 100vw;
    display: block;
    object-fit: contain;
  }
  
  .product-info {
    width: 100%;
    max-width: 100%;
    padding: 0 15px;
  }
  /* === Search Overlay === */
  #searchOverlay {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    width: 88%;
    max-width: 88%;
    border-radius: 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-sizing: border-box;
  }

  #searchOverlay.active {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  .search-box {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #searchInput {
    font-size: 15px;
    padding: 10px 20px;
    width: 100%; /* ✅ fills parent but no overflow */
    box-sizing: border-box;    
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 20px;
  }

  .search-item {
    width: 100%;
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    transition: 0.2s ease;
    box-sizing: border-box;
  }

  .search-item:hover {
    background: #f1f1f1;
  }

  .search-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
  }

  .search-info h4 {
    font-size: 14px;
    margin: 0;
    color: #111;
  }

  .search-info p {
    font-size: 12.5px;
    color: #555;
    margin: 4px 0 0;
  }

  #closeSearch {
    position: absolute;
    top: 20px;
    right: 92px;
    font-size: 25px;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    z-index: 1001;
  }

  #closeSearch:hover {
    color: #000;
  }
  
  /* === Mobile Slide-in Cart Drawer === */
  #mobileCartDrawer {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen on the right */
    width: 410px; /* You can tweak this width */
    height: 100vh;
    background: #fff;
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
  }
  
  #mobileCartDrawer.open {
    right: 0;
  }
  
  #mobileCartHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    font-size: 1.2rem;
    border-bottom: 1px solid #ddd;
  }

  #mobileCartItems .cart-size {
    font-size: 13px;
    color: #777;
    margin-top: -4px;
    margin-bottom: 6px;
  }

  #closeCartDrawer {
    background: none;
    border: none;
    font-size: 40px;
    cursor: pointer;
  }
  
  #mobileCartItems {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }
  
  #mobileCartFooter {
    padding: 16px;
    border-top: 1px solid #ddd;
  }
  
  .checkout-bar {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 8px;
  }
  
  .recommendation-title {
    text-align: center;
    font-size: 1.3rem;
    margin: 40px 0 20px;
  }
  
  .recommendation-wrapper .pro {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    box-sizing: border-box;
    background: #f5f5f5;
  }
  
  .recommendation-wrapper .product-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #fff;
  }
  
  .recommendation-wrapper .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .hide-on-mobile {
    display: none !important;
  }

  .empty-cart-mobile {
    text-align: center;
    padding: 20px;
  }
  
  .proceed-to-shop-btn {
    margin-top: 12px;
    padding: 10px 18px;
    background: #f1f1f1;
    color: #222;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
  }
  
  .proceed-to-shop-btn:hover {
    background: #333;
  }
  
  #mobileCartItems .cart-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
  }
  
  #mobileCartItems .cart-img {
    width: 100px;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
  }
  
  #mobileCartItems .cart-details {
    flex: 1;
    margin-left: 12px;
    display: flex;
    flex-direction: column;
  }
  
  #mobileCartItems .cart-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
  }
  
  #mobileCartItems .cart-price {
    font-size: 14px;
    color: #444;
    margin-bottom: 8px;
  }
  
  #mobileCartItems .quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  
  #mobileCartItems .qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #eee;
    font-size: 18px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  #mobileCartItems .qty-num {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
  }
  
  #mobileCartItems .remove-item-mobile {
    align-self: flex-start;
    background: none;
    border: none;
    font-size: 18px;
    color: #c00;
    cursor: pointer;
    position: absolute;
    top: 12px;
    right: 16px;
  }
  
  .empty-cart-message {
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 500px;
  }
  
  .thumbnails {
    display: none;
  }

  .mobile-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
  }

  .mobile-dots .dot {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0.6;
  }
  
  .mobile-dots .dot.active {
    background: #222;
    transform: rotate(360deg) scale(1.3);
    opacity: 1;
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
  }
  
  .footer-flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .footer-right {
    align-items: center;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .footer-left {
    justify-content: center;
  }
  
  .success-wrapper {
    height: 700px;
    text-align: center;
  }

  .checkmark-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
  }

  .checkmark {
    font-size: 40px;
  }

  .thank-you {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .order-received {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .return-home {
    font-size: 14px;
    padding: 10px 20px;
  }
}

@media (min-width: 350px) and (max-width: 768px) {
  /* === Mobile Slide-in Cart Drawer === */
  #mobileCartDrawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 410px;
    height: 100vh;
    background: #fff;
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
  }

  #mobileCartDrawer.open {
    right: 0;
  }

  #mobileCartHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    font-size: 1.2rem;
    border-bottom: 1px solid #ddd;
  }

  #closeCartDrawer {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
  }

  #mobileCartItems {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }

  #mobileCartItems .cart-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    position: relative;
  }

  #mobileCartItems .cart-img {
    width: 100px;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
  }

  #mobileCartItems .cart-details {
    flex: 1;
    margin-left: 12px;
    display: flex;
    flex-direction: column;
  }

  #mobileCartItems .cart-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
  }

  #mobileCartItems .cart-price {
    font-size: 14px;
    color: #444;
    margin-bottom: 8px;
  }

  #mobileCartItems .cart-size {
    font-size: 13px;
    color: #777;
    margin-top: -4px;
    margin-bottom: 6px;
  }

  #mobileCartItems .quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  #mobileCartItems .qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #eee;
    font-size: 18px;
    border-radius: 4px;
    cursor: pointer;
  }

  #mobileCartItems .qty-num {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
  }

  #mobileCartItems .remove-item-mobile {
    align-self: flex-start;
    background: none;
    border: none;
    font-size: 18px;
    color: #c00;
    cursor: pointer;
    position: absolute;
    top: -34px;
    right: 6px;
  }

  .empty-cart-message {
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 500px;
  }

  #mobileCartFooter {
    padding: 16px;
    border-top: 1px solid #ddd;
  }

  .checkout-bar {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 8px;
  }
}

@media (min-width: 200px) and (max-width: 349px) {
  /* === Smaller Mobile Slide-in Cart Drawer Overrides === */
  #mobileCartDrawer {
    width: 100vw;
    padding: 0 8px;
  }

  #mobileCartHeader {
    padding: 12px;
    font-size: 1rem;
  }

  #closeCartDrawer {
    font-size: 36px;
  }

  #mobileCartItems {
    padding: 12px;
  }

  #mobileCartItems .cart-item {
    align-items: flex-start;
    padding: 12px 0;
  }

  #mobileCartItems .cart-img {
    width: 90px;
    height: 100px;
    max-height: 150px;
    margin-bottom: 8px;
  }

  #mobileCartItems .cart-details {
    margin-left: 10px;
    width: 100%;
  }

  #mobileCartItems .cart-name {
    font-size: 15px;
  }

  #mobileCartItems .cart-price {
    font-size: 13px;
  }

  #mobileCartItems .cart-size {
    font-size: 12px;
  }

  #mobileCartItems .quantity-controls {
    gap: 6px;
    margin-bottom: 6px;
  }

  #mobileCartItems .qty-btn {
    width: 26px;
    height: 26px;
    font-size: 16px;
  }

  #mobileCartItems .qty-num {
    font-size: 15px;
  }

  #mobileCartItems .remove-item-mobile {
    font-size: 16px; 
    top: -30px;
    bottom: 0px;
    right: -8px;
  }

  .remove-item-mobile .bin-icon {
    width: 28px !important;
    height: 118px !important;
  }

  #mobileCartFooter {
    padding: 12px;
  }

  .checkout-bar {
    padding: 10px;
    font-size: 0.95rem;
  }

  .empty-cart-message {
    height: auto;
    padding: 30px 16px;
  }
}

/* ========== 3 per row + 3 visible (600px – 1024px) ========== */
@media (max-width: 1024px) and (min-width: 600px) {
  .recommendations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 40px;
  }

  .recommendations-grid > .pro {
    display: none;
  }

  .recommendations-grid > .pro:nth-child(-n+3) {
    display: block;
  }
}

/* ========== 2 per row + 2 visible (300px – 599px) ========== */
@media (max-width: 599px) and (min-width: 300px) {
  .recommendations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-bottom: 40px;
  }

  .recommendations-grid > .pro {
    display: none;
  }

  .recommendations-grid > .pro:nth-child(-n+2) {
    display: block;
  }
}

@media (max-width: 480px) {
  .recommendation-wrapper {
    padding: 0;
  }

  .recommendation-title {
    font-size: 1.1rem;
    margin: 30px 10px 20px;
  }

  .recommendation-wrapper .pro {
    padding: 4px;
    background: #fff;
    border-radius: 2px;
    box-sizing: border-box;
  }

  .recommendation-wrapper .product-img {
    width: 100%;
    height: 230px; /* Image is dominant */
    overflow: hidden;
    border-radius: 2px;
    background-color: #fff;
  }

  .recommendation-wrapper .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .recommendation-wrapper .des {
    padding-top: 6px;
    text-align: left;
  }

  .recommendation-wrapper .des h5 {
    font-size: 13px;
    margin: 4px 0 2px;
  }

  .recommendation-wrapper .des h4 {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
  }

  .hide-on-mobile {
    display: none !important;
  }
}

/* ========== 1 per row + 1 visible (200px – 299px) ========== */
@media (max-width: 299px) and (min-width: 200px) {
  .recommendations-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    padding-bottom: 40px;
  }

  .recommendations-grid > .pro {
    display: none;
  }

  .recommendations-grid > .pro:nth-child(1) {
    display: block;
  }
}


/* ========== GENERAL LAYOUT ========== */
main.product-page {
  padding: 40px 30px;
}

.product-container {
  display: flex;
  gap: 40px;
  max-width: 1300px;
  margin: 0 auto;
  flex-wrap: wrap;
}

/* ========== GALLERY ========== */
.product-gallery {
  flex: 1;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.slider {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.main-img-wrapper {
  width: 100%;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  overflow: hidden;
}

.main-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.5s ease;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
  z-index: 5;
}

#prevSlide {
  left: 10px;
}

#nextSlide {
  right: 10px;
}

.nav-arrow:hover {
  background: #ddd;
}

.thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding-top: 6px;
  overflow-x: hidden;
}

.thumb {
  width: 70px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  filter: blur(1px) grayscale(40%);
  opacity: 0.5;
  transition: 0.4s ease;
}

.thumb.active,
.thumb:hover {
  filter: none;
  opacity: 1;
  transform: scale(1.05) rotate(1deg);
}

.thumbnails::-webkit-scrollbar {
  display: none;
}

/* ========== DESCRIPTION AREA ========== */
.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-width: 300px;
  padding-right: 0px;
}

.product-info h1 {
  font-size: 2.1rem;
}

.description {
  color: #555;
  line-height: 1.6;
  font-weight: 502;
}

.price {
  font-size: 15.4px;
  font-weight: 800;
  color: #555;
}

.add-to-cart {
  padding: 14px 20px;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.add-to-cart:hover {
  background: #333;
}

.payfast-btn {
  background-color: #ccc;
  color: #f9f9f9;
  border: none;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 15px;
  border-radius: 6px;
  width: 100%;
  transition: background-color 0.3s ease;
}

.payfast-btn:hover {
  background-color: #333;
}

/* === RESPONSIVE DESIGN & MEDIA QUERIES === */

/* 4 per row (desktop) */
@media (min-width: 1025px) {
  .recommendations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-bottom: 40px;
  }

  .recommendations-grid > .pro {
    display: none;
  }

  .recommendations-grid > .pro:nth-child(-n+4) {
    display: block;
  }
}

/* 3 per row (tablet) */
@media (max-width: 1024px) and (min-width: 600px) {
  .recommendations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 40px;
  }

  .recommendations-grid > .pro {
    display: none;
  }

  .recommendations-grid > .pro:nth-child(-n+3) {
    display: block;
  }
}

/* 2 per row (mobile) */
@media (max-width: 599px) and (min-width: 300px) {
  .recommendations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-bottom: 40px;
  }

  .recommendations-grid > .pro {
    display: none;
  }

  .recommendations-grid > .pro:nth-child(-n+2) {
    display: block;
  }

  
}

/* 1 per row (tiny screens) */
@media (max-width: 299px) {
  .recommendations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 40px;
  }

  .recommendations-grid > .pro {
    display: none;
  }

  .recommendations-grid > .pro:nth-child(1) {
    display: block;
  }
}

/* ===============================
   MEDIA QUERY: Tiny Devices (200px–350px)
   =============================== */
@media screen and (max-width: 350px) and (min-width: 200px) {
  /* Make sure box-sizing is border-box to handle padding nicely */
  *, *::before, *::after {
    box-sizing: border-box;
  }

  main.product-page,
  .product-container,
  .product-gallery,
  .slider,
  .main-img-wrapper,
  .product-info,
  .recommendation-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    background: none;
    padding: 0 10px;
    margin: 0 auto;
    overflow-x: hidden;
  }

  /* Stack the product container vertically */
  .product-container {
    display: flex;
    flex-direction: column; /* stack gallery and info */
    align-items: center;    /* center contents horizontally */
    justify-content: flex-start;
    padding: 10px;
    box-sizing: border-box;
    max-width: 100%;
    margin: 0 auto;
  }

  /* Product gallery and info take full width */
  .product-gallery,
  .product-info {
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
  }

  /* Add margin between stacked sections */
  .product-info {
    margin-top: 20px;
  }

  /* Main image wrapper adjusts for width */
  .main-img-wrapper {
    width: 100%;
    max-width: 350px;
  }

  /* Make main image fully responsive and contained */
  .main-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }

  /* Adjust nav arrows for smaller size */
  .nav-arrow {
    font-size: 20px;
    padding: 5px;
  }

  /* Hide thumbnails on tiny screens to save space */
  .thumbnails {
    display: none;
  }

  /* Show dots for mobile slider navigation */
  .mobile-dots {
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }

  /* Smaller font sizes and better text wrapping */
  .product-info h4,
  .product-info h5,
  .price,
  .description,
  .add-to-cart,
  .payfast-btn {
    font-size: 14px !important;
    line-height: 1.3;
    word-break: break-word; /* Prevent text overflow */
    overflow-wrap: break-word;
  }

  /* Make buttons full width with smaller padding */
  .add-to-cart,
  .payfast-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
  }

  /* Recommendations grid stacks vertically */
  .recommendations-grid {
    gap: 5px;
  }

  /* Recommendation products take full width */
  .pro {
    width: 100%;
  }

  /* Product images adapt to container */
  .product-img {
    width: 100%;
    height: auto;
  }

  .product-img img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  /* Prevent horizontal scrolling */
  body,
  html {
    overflow-x: hidden !important;
  }

  .return-home {
    font-size: 13px;
    padding: 14px 16px !important;
  }
}
