/* ==============================================
   PRODUCT CARD + IMAGE (CAROUSEL-SAFE VERSION)
   Unified layout and responsive styles
============================================== */

/* --- Product Card Container --- */
#home_section .product-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  /* --- border: 1px solid #e3bc5c; --- */
  border-radius: 5px;
  padding: 15px;
  max-width: 700px;
  margin: auto;
  margin-bottom: 20px;
  /* background-color: #faf9f6;*/
  /* box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);*/
  height: 100%;
  width: 100%;
}

/* --- Header --- */
#home_section .product-header {
  order: 0;
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
}

#home_section .product-header h5 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
}

#home_section .price-sup {
  font-size: 12px;
  vertical-align: super;
  color: #8B0000;
}

.text-small {
  font-size: 90%;
  opacity: 0.8;
  display: inline-block;
  font-weight: bold;
}

/* --- Product Image Container --- */
.product-image-container {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #faf9f6;
  flex-shrink: 0;
  width: 100%;           /* ✅ ensure full width on mobile/card */
}

/* --- Inner Wrapper --- */
.square-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;   /* ✅ square box for image/carousel */
  padding: 0 !important;
}

/* Make carousel + single image fill the square-inner box */
.square-inner .product-carousel,
.square-inner > img {
  width: 100%;
  height: 100%;
}

.square-inner .carousel-inner,
.square-inner .carousel-item {
  width: 100%;
  height: 100%;
}

/* --- Image or Carousel inside card --- */
.product-image-container img,
.product-image-container .carousel-inner img {
  width: 100%;
  height: 100%;          /* ✅ fill square box */
  object-fit: cover;     /* ✅ no letterboxing; looks larger */
  display: block;
  border-radius: 0.5rem;
}

/* --- Camera Icon Overlay --- */
/* .product-image-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 7px;
  z-index: 10;
  font-size: 1.2rem;
} */

/* @media (max-width: 768px) {
  .product-image-icon {
    top: 5%;
    right: 5%;
    padding: 5px;
    font-size: 1rem;
  }
}*/

/* --- Product Body (image + details side by side) --- */
#home_section .product-body {
  display: flex;
  flex-direction: row;
  gap: 30px;
  align-items: flex-start;
  justify-content: flex-start;
  flex-grow: 1; /* ✅ takes remaining vertical space */
}

/* --- Product Details --- */
#home_section .product-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7px;
}

#home_section .product-info {
  font-size: inherit;
  line-height: 1.5;
}

/* --- Product Footer --- */
#home_section .product-footer {
  order: 2;
  text-align: center;
  width: 100%;
  margin-top: auto; /* ✅ anchors to bottom */
}

/* --- Fix button alignment --- */
#home_section .product-footer .product-actions {
  display: flex;
  justify-content: center;
}

#home_section .product-footer button {
  width: 100%;
  max-width: 250px;
}

/* Mobile override (FULL WIDTH button) */
@media (max-width: 767px) {
  #home_section .product-footer button {
    max-width: none !important;
    width: 100% !important;
  }
}

/* --- Pricing Visibility --- */
.product-pricing-not-mobile {
  display: block;
}

.product-pricing-mobile {
  display: none;
}

@media (max-width: 767px) {
  .product-pricing-not-mobile {
    display: none;
  }
  .product-pricing-mobile {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }
}

/* ==============================================
   RESPONSIVE BREAKPOINTS
============================================== */

/* --- Mobile --- */
@media (max-width: 767px) {
  #home_section .product-body {
    flex-direction: column;
    gap: 10px;
  }

  #home_section .product-header .product-name {
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
  }

  #home_section .product-card .product-price {
    text-align: center;
    margin-bottom: 0.5rem;
  }
}

/* --- Tablet --- */
@media (min-width: 768px) and (max-width: 1024px) {
  #home_section .product-body {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
  }

  #home_section .product-image-container {
    position: relative;
    flex: 0 0 300px;
    width: 300px;
    overflow: hidden;
    border-radius: 5px;
    align-self: flex-start;
  }
}

/* --- Desktop --- */
@media (min-width: 1025px) {
  #home_section .product-card {
    flex-direction: column; /* ✅ vertical stack restored */
    align-items: stretch;
  }

  #home_section .product-image-container {
    width: 300px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 5px;
  }

  #home_section .product-body {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
    flex-grow: 1;
  }
}

/* ==============================================
   FLAGS AND DECORATIVE ELEMENTS
============================================== */
.flags-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
}

.flags-container img {
  width: 24px;
  height: auto;
}

.flag {
  height: auto;
  width: 50px;
}

/* ==============================================
   ERROR HANDLING / VALIDATION
============================================== */
#home_section .error-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #8B0000;
  cursor: pointer;
  font-size: 1.2rem;
}

#home_section .error-icon:hover {
  font-size: 1.5rem;
}

#home_section .invalid-feedback {
  color: #8B0000;
  font-size: 0.875rem;
  margin-top: 5px;
}

#home_section .form-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 10px;
}

#home_section .char-counter {
  text-align: right;
}

/* Hide Product ID text visually */
#home_section .product-id {
  color: #fff;
}

