.products-container {
  padding: 2rem;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.product-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  transition: 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transform: translateY(-4px);
}

.product-card img {
  width: 100%;
  height: 250px; /* fixed height for uniform size */
  object-fit: cover; /* crop image proportionally without distortion */
  border-radius: 6px;
  display: block;
}


.product-card h2 {
  font-size: 1.2rem;
  margin: 0.5rem 0;
}

.product-card p {
  font-size: 1rem;
  font-weight: bold;
  color: #444;
}

.product-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.product-actions .btn {
  flex: 1;
  padding: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: 0.3s;
}

.add-to-cart {
  background: #28a745;
  color: #fff;
}

.add-to-cart:hover {
  background: #218838;
}

.add-to-wishlist {
  background: #ffc107;
  color: #000;
}

.add-to-wishlist:hover {
  background: #e0a800;
}

.product-main { margin-bottom: 30px; }

.product-grid .showcase {
  border: 1px solid var(--cultured);
  -webkit-border-radius: var(--border-radius-md);
          border-radius: var(--border-radius-md);
  overflow: hidden;
  -webkit-transition: var(--transition-timing);
  -o-transition: var(--transition-timing);
  transition: var(--transition-timing);
}

.product-grid .showcase:hover { 
  -webkit-box-shadow: 0 0 10px hsla(0, 0%, 0%, 0.1); 
  box-shadow: 0 0 10px hsla(0, 0%, 0%, 0.1); 
}

.product-grid .showcase-banner { position: relative; }

.product-grid .product-img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  -webkit-transition: var(--transition-timing);
  -o-transition: var(--transition-timing);
  transition: var(--transition-timing);
}

.product-grid .product-img.default {
  position: relative;
  z-index: 1;
}

.product-grid .product-img.hover {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  opacity: 0;
}

.product-grid .showcase:hover .product-img.hover { opacity: 1; }

.product-grid .showcase:hover .product-img.default { opacity: 0; }

.product-grid .showcase:hover .product-img { 
  -webkit-transform: scale(1.1); 
  -ms-transform: scale(1.1); 
  transform: scale(1.1); 
}

.product-grid .showcase-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--ocean-green);
  font-size: var(--fs-8);
  font-weight: var(--weight-500);
  color: var(--white);
  padding: 0 8px;
  -webkit-border-radius: var(--border-radius-sm);
          border-radius: var(--border-radius-sm);
  z-index: 3;
}

.product-grid .showcase-badge.angle {
  top: 8px;
  left: -29px;
  -webkit-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
          transform: rotate(-45deg);
  text-transform: uppercase;
  font-size: 11px;
  padding: 5px 40px;
}

.product-grid .showcase-badge.black { background: var(--eerie-black); }

.product-grid .showcase-badge.pink { background: var(--salmon-pink); }

.product-grid .showcase-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  -webkit-transform: translateX(50px);
      -ms-transform: translateX(50px);
          transform: translateX(50px);
  -webkit-transition: var(--transition-timing);
  -o-transition: var(--transition-timing);
  transition: var(--transition-timing);
  z-index: 3;
}

.product-grid .showcase:hover .showcase-actions { 
  -webkit-transform: translateX(0); 
  -ms-transform: translateX(0); 
  transform: translateX(0); 
}

.product-grid .btn-action {
  background: var(--white);
  color: var(--sonic-silver);
  margin-bottom: 5px;
  border: 1px solid var(--cultured);
  padding: 5px;
  -webkit-border-radius: var(--border-radius-sm);
          border-radius: var(--border-radius-sm);
  -webkit-transition: var(--transition-timing);
  -o-transition: var(--transition-timing);
  transition: var(--transition-timing);
}

.product-grid .btn-action:hover {
  background: var(--eerie-black);
  color: var(--white);
  border-color: var(--eerie-black);
}

.product-grid .showcase-content { padding: 15px 20px 0; }

.product-grid .showcase-category {
  color: var(--salmon-pink);
  font-size: var(--fs-9);
  font-weight: var(--weight-500);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.product-grid .showcase-title {
  color: var(--sonic-silver);
  font-size: var(--fs-8);
  font-weight: var(--weight-300);
  text-transform: capitalize;
  letter-spacing: 1px;
  margin-bottom: 10px;
  -webkit-transition: var(--transition-timing);
  -o-transition: var(--transition-timing);
  transition: var(--transition-timing);
}

.product-grid .showcase-title:hover { color: var(--eerie-black); }

.product-grid .showcase-rating {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  color: var(--sandy-brown);
  margin-bottom: 10px;
}

.product-grid .price-box {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  gap: 10px;
  font-size: var(--fs-7);
  color: var(--eerie-black);
  margin-bottom: 10px;
}

.product-grid .price { font-weight: var(--weight-700); }

.product-grid del { color: var(--sonic-silver); }

@media (min-width: 480px) {
  .product-grid {
    -ms-grid-columns: 1fr 30px 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (min-width: 768px) {
  .product-minimal {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
            flex-wrap: wrap;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
        -ms-flex-pack: center;
            justify-content: center;
    gap: 20px;
  }

  .product-minimal .product-showcase {
    min-width: -webkit-calc(50% - 10px);
    min-width: calc(50% - 10px);
    width: -webkit-calc(50% - 10px);
    width: calc(50% - 10px);
  }

  .product-minimal .showcase-container { min-width: 100%; }
  
  .product-featured .showcase {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
        -ms-flex-pack: center;
            justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 20px;
  }

  .product-featured .showcase-img { 
    max-width: -webkit-fit-content; 
    max-width: -moz-fit-content; 
    max-width: fit-content; 
  }

  .product-featured .showcase-content {
    margin-top: 0;
    min-width: -webkit-calc(100% - 345px);
    min-width: calc(100% - 345px);
  }
}

@media (min-width: 1024px) {
  .product-container .container {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
  }

  .sidebar {
    --fs-5: 0.941rem;
    position: sticky;
    top: 30px;
    left: 0;
    padding: 0;
    min-width: calc(25% - 15px);
    margin-bottom: 30px;
    visibility: visible;
    overflow-y: auto;
    overscroll-behavior: auto;
    z-index: 0;
  }

  .sidebar-category {
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--cultured);
    border-radius: var(--border-radius-md);
  }

  .sidebar-close-btn { display: none; }

  .product-box { min-width: calc(75% - 15px); }

  .product-minimal { margin-bottom: 20px; }

  .product-minimal .product-showcase {
    min-width: calc(33.33% - 14px);
    width: calc(33.33% - 14px);
    flex-grow: 1;
  }

  .product-minimal .showcase-wrapper { gap: 10px; }

  .product-minimal .showcase-container { padding: 2px; }

  .product-featured .countdown-content { padding: 5px 10px; }

  .product-grid { 
    -ms-grid-columns: (1fr)[3]; 
    grid-template-columns: repeat(3, 1fr); 
  }
}

@media (min-width: 1200px) {
  .product-featured .showcase > div { 
    min-width: -webkit-calc(50% - 10px); 
    min-width: calc(50% - 10px); 
  }

  .product-featured .display-number { --fs-5: 1.125rem; }

  .product-grid { 
    -ms-grid-columns: (1fr)[4]; 
    grid-template-columns: repeat(4, 1fr); 
  }
}


.add-to-cart-btn {
  background: #fada06;
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s ease;
}

.add-to-cart-btn:hover {
  background: #fada06;
}

/* Toast popup */
.toast {
  visibility: hidden;
  min-width: 250px;
  background: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 12px 16px;
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.4s, bottom 0.4s;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}


.add-to-wishlist-btn ion-icon {
  font-size: 24px;
  color: #555; /* default color */
  transition: color 0.3s ease;
}

.add-to-wishlist-btn.active ion-icon {
  color: rgb(227, 92, 92); /* filled heart */
}

/* =========================
   Base Reset
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.5;
  background: #f9f9f9;
}

/* =========================
   Header & Navigation
========================= */
header {
  background: #222;
  color: #fff;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .logo {
  font-size: 1.2rem;
  font-weight: bold;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/*-----------------------------------*\
  #PRODUCT GRID FINAL FIXED VERSION
\*-----------------------------------*/

/* Container */
.product-main {
  padding: 2rem;
  text-align: center;
  background: #f9f9f9;
}

.product-main .title {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: #222;
}

/* Grid layout */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  justify-content: center;
}

/* Showcase card */
.showcase {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 440px; /* uniform card height */
}

.showcase:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Showcase image section */
.showcase-banner {
  position: relative;
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 250px; /* fixed image height */
  object-fit: cover;
  transition: opacity 0.4s ease, transform 0.3s ease;
}

.product-img.hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.showcase:hover .product-img.hover {
  opacity: 1;
}

.showcase:hover .product-img.default {
  opacity: 0;
}

/* Badge (like 15% or Sale) */
.showcase-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background:#fada06;
  color: #fff;
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 3;
}

.showcase-badge.angle {
  transform: rotate(-45deg);
  top: 10px;
  left: -30px;
  width: 100px;
  text-align: center;
}

/* Wishlist Icon */
.showcase-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  transition: transform 0.3s ease;
  z-index: 3;
}

.btn-action {
  background: #fff;
  border: 1px solid #ddd;
  padding: 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-action:hover {
  background: #222;
  color: #fff;
}

/* Content */
.showcase-content {
  padding: 10px 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.showcase-category {
  color:#fada06;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 5px;
  display: inline-block;
}

.showcase-title {
  color: #222;
  font-size: 1rem;
  text-transform: capitalize;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.showcase-title:hover {
  color: #fada06;
}

/* Star Rating */
.showcase-rating {
  display: flex;
  justify-content: center;
  color: #ffc107;
  margin-bottom: 10px;
}

/* Price */
.price-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  margin-bottom: 10px;
}

.price-box del {
  color: #777;
  font-weight: normal;
}

/* Add to cart button */
.add-to-cart-btn {
  background: #267d50;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.add-to-cart-btn:hover {
  background: #1e6640;
}

/*-----------------------------------*\
  #RESPONSIVE DESIGN
\*-----------------------------------*/

/* 💻 Half screen / tablet — 2 per row */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 📱 Mobile — 2 per row, smaller height */
@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .showcase {
    height: 380px;
  }

  .product-img {
    height: 200px;
  }

  .showcase-title {
    font-size: 0.9rem;
  }
}

/* =========================
   Mobile First Styles
========================= */
@media (max-width: 600px) {
  header {
    flex-wrap: wrap;
  }
  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #222;
  }
  nav.show {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
}

/* =========================
   Tablet & Desktop
========================= */
@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}


/*-----------------------------------*\
  #PRODUCT IMAGE UNIFORM SIZE FIX
\*-----------------------------------*/

.product-container {
  display: grid;
  gap: 20px;
  justify-content: center;
  padding: 20px;
  grid-template-columns: repeat(4, 1fr); /* Default: 4 products per row */
}

/* Each product card */
.product-card {
  background: var(--white);
  border: 1px solid var(--cultured);
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 420px; /* Ensures uniform card height */
}

/* Product image styling */
.product-card img {
  width: 100%;
  height: 230px; /* uniform image height */
  object-fit: cover; /* crop proportionally */
  border-radius: 10px 10px 0 0;
}

/* Product details (below image) */
.product-info {
  padding: 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Hover effect */
.product-card:hover {
  transform: translateY(-5px);
}

/* 📏 Responsive Rules */

/* Half-screen (tablet or small laptop) */
@media (max-width: 1024px) {
  .product-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 📱 Mobile: still 2 per row, smaller gap */
@media (max-width: 600px) {
  .product-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card {
    height: 360px; /* shorter cards for mobile */
  }

  .product-card img {
    height: 200px;
  }
}
