/* ----- DESKTOP ----- */
/* ----- CONTENT DESKTOP ----- */

/* ----- MAIN CONTAINER ----- */
main.container.my-4.flex-grow-1 {
  max-width: 1400px;
  width: 80%;
  margin: 1.5rem auto;               /* Center the container */
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  display: flex;
  justify-content: center;            /* Center the content horizontally */
  align-items: center;                /* Align items vertically */
  flex-wrap: wrap;                    /* Allow content to wrap if needed */
}

/* ----- PRODUCT MEDIA ----- */
.product-media {
  flex: 1 1 300px;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
}

/* ----- PRODUCT IMAGE ----- */
.product-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* ----- PRODUCT INFO ----- */
.product-info {
  flex: 1 1 300px;
  text-align: left;
  align-self: flex-start;
  padding-left: 2rem;                 /* Added left padding to avoid touching the image */
}

.product-name {
  font-size: 1.6rem;
  font-weight: 600;
}

.product-description {
  font-size: 1rem;
  line-height: 1.5;
}

/* ----- ARROWS SECTION (Prev/Next Buttons) ----- */
.product-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: 0.4rem 0.8rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

.product-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
}

.arrow-left {
  left: 10px;
}

.arrow-right {
  right: 10px;
}

/* ----- PRICE & QUANTITY WRAPPER ----- */
.price-quantity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0 1.5rem;
}

.product-price,
.product-price span {
  font-size: 1.4rem;
  font-weight: bold;
  margin: 0;
  color: #000;
}

/* ----- QUANTITY CONTROLS (Plus/Minus) ----- */
.quantity-box {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 0px;
  overflow: hidden;
  box-sizing: border-box;
}

.qty-btn {
  width: 50px;
  height: 50px;
  font-size: 1.8rem;
  font-weight: bold;
  border: none;
  background: #009639;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: Arial, sans-serif;
  user-select: none;
}

.product-quantity {
  width: 60px;
  height: 50px;
  font-size: 1.2rem;
  text-align: center;
  border: none;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}

/* ----- ADD TO CART BUTTON (Override Version) ----- */
.add-to-cart-btn {
  background: #009639;
  color: #fff;
  border: none;
  padding: 1rem 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: 0px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: center;
  min-height: 46px;
  display: block;
  width: 100%;
}

.add-cart-btn:hover {
  background: #007a2e;
}

/* ----- END DESKTOP CONTENT ----- */











































/* ============================ 
   MOBILE VIEW (≤768px) 
============================ */
@media screen and (max-width: 768px) {
  /* MAIN CONTAINER FULL WIDTH */
  main.container.my-4.flex-grow-1 {
    width: 90%;                      /* Adjust width to 90% for better fit */
    max-width: 90%;
    margin: 0 auto;                  /* Center the container */
    padding: 1rem;                   /* Add some padding for mobile */
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  /* HIDE ARROWS ON MOBILE */
  .product-arrow {
    display: none !important;
  }

 .product-media {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 1rem 0 0 0;   /* idinagdag yung top margin */
  position: relative;
}

  .product-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin-top: 0.8rem;   /* dagdag konti spacing sa taas */
}

  /* DOTS NAVIGATION STYLE */
  .product-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 0.8rem;
  }

  .product-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  .product-dots .dot.active {
    background: #0066cc;             /* highlight color ng active dot */
  }

  /* PRODUCT INFO STACKED BELOW IMAGE */
  .product-info {
    padding: 1rem;
    text-align: left;
  }

  .product-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  .product-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;           /* limit description */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* READ MORE LINK */
  .read-more {
    color: #0066cc;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    margin-bottom: 1rem;
  }

  /* PRICE & QUANTITY */
  .price-quantity {
    margin: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
  }

  .quantity-box {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 0px;
    overflow: hidden;
  }

  .qty-btn {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
    font-weight: bold;
    border: none;
    background: #009639;
    color: #fff;
    cursor: pointer;
  }

  .product-quantity {
    width: 50px;
    height: 40px;
    text-align: center;
    border: none;
    font-size: 1rem;
  }

  /* ADD TO CART BUTTON */
  .add-to-cart-btn {
    background: #009639 !important;
    color: #fff !important;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    display: block;
    width: 100%;
    border-radius: 0;
    margin-top: 1rem;
  }
}

/* ----- READ MORE BUTTON */
.read-more {
  color: blue;
  text-decoration: underline;
  cursor: pointer;
}

/* ----- PRODUCT DESCRIPTION ----- */
.product-description {
  font-size: 1rem !important;
  line-height: 1.5 !important;
  margin-bottom: 0 !important;       /* Remove margin initially when collapsed */
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  transition: margin-bottom 0.3s ease !important;
  max-height: 6em !important;
}

.product-description.expanded {
  max-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
  margin-bottom: 21rem !important;   /* Add margin when expanded */
}

/* ----- PRODUCT CONTROLS ----- */
.product-controls {
  position: relative !important;
  z-index: 1 !important;
  margin-top: 2rem !important;
  transition: margin-top 0.3s ease !important; /* Adjust transition for smooth margin changes */
}

/* ----- PRODUCT INFO ----- */
.product-info {
  padding-bottom: 1rem !important;   /* Default padding at the bottom */
  transition: padding-bottom 0.3s ease !important; /* Smooth transition for padding */
}
















































/* ======================================================
   LOADING SPINNER INSIDE ADD TO CART BUTTON
====================================================== */
.add-to-cart-btn.loading {
  position: relative;
  color: transparent !important;   /* hide text completely */
  text-shadow: none !important;    /* remove any text outline */
  pointer-events: none;            /* disable click habang loading */
}

.add-to-cart-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { 
    transform: rotate(360deg); 
  }
}
/* ============================ END LOADING SPINNER ============================ */