

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999; /* Ensures it's on top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.6); /* Semi-transparent white background */
    backdrop-filter: blur(4px); /* This creates the blur effect */
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Class to hide the loader with a fade-out effect */
.loader-overlay.hide {
    opacity: 0;
    visibility: hidden;
}

.loader-box {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader-text {
    font-weight: 500;
    color: #333;
}

.back-link-container {
    padding: 1rem 2rem; /* Matches the product detail padding */
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--clr-gray); /* Use your theme's gray color */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--clr-primary); /* Use your theme's primary red on hover */
}

.back-link i {
    font-size: 1.2rem;
}

.product-detail {
  display: grid;
  /* ⭐ UPDATED: Changed from 1fr 1fr to a 40/60 split for desktop */
  grid-template-columns: 3fr 3fr;
  /* 2 parts for images, 3 parts for info */
  gap: 2rem;
  padding: 2rem;
  background-color: #fff;
  align-items: flex-start;
}

.main-image img {
  width: 70%;
  object-fit: cover;
  border-radius: 1.5rem;
}

.thumbnail-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1rem;
}

.thumbnail-images img {
  padding: 4px;
  border: 1px solid black;
  border-radius: 1rem;
  width: 70px;
  height: 70px;
  object-fit: cover;
  cursor: pointer;
  transition: border 0.3s ease;
}

.thumbnail-images img:hover {
  border-color: #333;
}

#main-image{
  border: 1px solid black;
  border-radius: 1rem;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-title {
  font-size: 2.4rem;
  font-weight: 700;
  color: #222;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--clr-primary);
}

.mrp {
  text-decoration: line-through;
  color: gray;
  font-size: 1.2rem;
  font-weight: 400;
}

.discount {
  color: #16a34a;
  font-size: 1rem;
  font-weight: 600;
}


.product-description {
  font-size: 1.1rem;
  max-width: 100%;
  color: #555;
  line-height: 2;

  /* ⭐ FIX: Add these two lines to control the height and add a scrollbar */
  max-height: 200px;
  /* Adjust this value as needed */
  overflow-y: auto;
  /* Adds a scrollbar only if the text is too long */
}

.product-sizes p,
.product-colors p {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  /* Makes the button a perfect circle */
  border: 2px solid #e0e0e0;
  /* A light border to see light colors like white */
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  /* Remove any text-related padding from previous versions */
  padding: 0;
}

/* Style for the active/selected color swatch */
.color-btn.active {
  border-color: #27ae60;
  /* Use the same green as the size buttons for consistency */
  transform: scale(1.1);
  /* Slightly enlarges the selected swatch */
  box-shadow: 0 0 0 2px white, 0 0 0 4px #27ae60;
  /* Creates a clean outline effect */
}

.color-btn:hover {
  border-color: #333;
}


.size-btn {
  padding: 0.6rem 1.2rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  border: 2px solid #2ecc71;
  background-color: #f0fff5;
  color: #2ecc71;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.size-btn.active,
.size-btn:hover,
.size-btn:focus {
  background-color: #2ecc71;
  color: #fff;
  border-color: #27ae60;
}

/* --- ⭐ NEW: Styles for Unavailable Size Buttons --- */
.size-btn.unavailable {
  background-color: #f8f9fa;
  /* Light gray background */
  color: #adb5bd;
  /* Lighter text color */
  border-color: #e9ecef;
  text-decoration: line-through;
  /* This adds the cross mark */
  cursor: not-allowed;
  /* Shows a 'disabled' cursor */
  pointer-events: none;
  /* Makes the button unclickable */
}

/* Override the hover effect for unavailable buttons */
.size-btn.unavailable:hover {
  background-color: #f8f9fa;
  color: #adb5bd;
  border-color: #e9ecef;
}


.add-to-cart {
  padding: 1rem;
  background-color: #2ecc71;
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: background-color 0.3s ease;
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
}

.add-to-cart:hover {
  background-color: #27ae60;
}


.extra-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
  background-color: #fff;
  align-items: flex-start;
}


/* Extra Info Section with Square Cards */
.extra-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.extra-info>div {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.extra-info>div:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.extra-info .icon {
  font-size: 2.2rem;
  color: #2ecc71;
  margin-bottom: 0.6rem;
}

.extra-info h4 {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
  color: #333;
}

.extra-info p {
  font-size: 1rem;
  color: #666;
  line-height: 1.4;
}

.product-image {
  margin-left: 0rem;
}

/* Responsive Design */
@media (max-width: 768px) {

  .product-detail,
  .extra-section {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .main-image img {
    width: 100%;
    height: auto;
  }

  .product-title {
    font-size: 2rem;
  }

  .product-price {
    font-size: 1.3rem;
  }

  .extra-info {
    grid-template-columns: 1fr;
  }

  .product-image {
    margin-left: 0rem;
  }
}

@media (max-width: 480px) {

  .product-detail,
  .extra-section {
    padding: 1rem;
    gap: 1.5rem;
  }

  .main-image img {
    width: 100%;
    height: auto;
  }

  .thumbnail-images img {
    width: 60px;
    height: 60px;
  }

  .product-title {
    font-size: 1.6rem;
  }

  .product-description {
    font-size: 0.95rem;
  }

  .size-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .add-to-cart {
    padding: 0.8rem;
    font-size: 1rem;
  }

  .extra-info {
    padding: 0;
    grid-template-columns: 1fr;
  }

  .product-image {
    margin-left: 0rem;
  }
}