/* ----------------------------------------------------------------
   POPUP WRAPPER
---------------------------------------------------------------- */
#product-addons-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8); /* Dark overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden; /* Prevent scrolling behind the popup */
}

/* ----------------------------------------------------------------
   POPUP CONTENT
---------------------------------------------------------------- */
.popup-content {
  background: #ffffff;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 85vh;
  width: 90vw;
  max-width: 1200px;
  padding: 20px;
}

@media (max-width: 1024px) {
  .popup-content {
    max-width: 1000px;
  }
}

@media (max-width: 768px) {
  .popup-content {
    max-width: 700px;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .popup-content {
    max-width: 400px;
    padding: 10px;
  }
}

/* ----------------------------------------------------------------
   FILTER TABS
---------------------------------------------------------------- */
.filter-buttons-wrapper {
  overflow-x: auto;
  white-space: nowrap;
  margin-bottom: 15px;
}

.filter-buttons {
  display: inline-flex;
  gap: 10px;
}

.filter-btn {
  flex: 0 0 auto;
  background-color: #ffffffcf;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.filter-btn.active {
  background-color: #f74b4b;
  color: #ffffff;
  border-color: #005f85;
}

.filter-btn:hover {
  background-color: #f74b4b;
  color: #ffffff;
}

/* ----------------------------------------------------------------
   PRODUCTS GRID
---------------------------------------------------------------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  justify-items: center;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* ----------------------------------------------------------------
   PRODUCT CARD
   Ensuring functionality and correct positioning of elements.
---------------------------------------------------------------- */
.addon-product {
  position: relative; /* Important for absolute positioning inside */
  background: #fff;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.addon-product:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Checkbox on the left top corner */
.addon-product .addon-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
accent-color: #28a745; /* Change to your preferred color */
  z-index: 20; /* Ensuring it is clickable */
}

.addon-product img {
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
  border-radius: 4px;
}

/* 
   Separate rules for name & price to ensure each is on its own line
*/
.addon-product-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  height: 36px;              /* ✅ Fixed height for 2 lines max */
  line-height: 18px;         /* 18px line height = 2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;     /* ✅ Clamp to 2 lines */
  -webkit-box-orient: vertical;
}


.addon-product .addon-product-price {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  overflow: hidden;
}

/* Add button (if you are using it) */
.addon-product .addon-add-button {
  display: inline-block;
  background-color: #28a745;
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.addon-product .addon-add-button:hover {
  background-color: #218838;
}

/* ----------------------------------------------------------------
   FOOTER (STICKY)
---------------------------------------------------------------- */
.popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 20px;
  background: #ffffff;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
  z-index: 99999;
}

#selected-summary {
  flex-grow: 1;
  margin: 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  padding: 6px 12px;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid #ddd;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popup-footer .skip-btn,
.popup-footer .continue-btn {
  flex: 0 0 auto;
background: #ff0202;  /* Change this to your preferred background color */
  color: #ffffff;       /* Change this to your preferred text color */
}

.popup-footer .skip-btn:hover,
.popup-footer .continue-btn:hover {
  background: #005f85;
}

.popup-footer .continue-btn {
  background: #1d8508ab;
 color: #ffffff; /* Text color */
}

/* ----------------------------------------------------------------
   UPDATED QUANTITY SELECTOR
   Single bounding box around minus, number input, plus
---------------------------------------------------------------- */
.addon-quantity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;   /* Single bounding box for the entire control */
  border-radius: 4px;
  overflow: hidden;         /* Ensures corners remain neat */
  margin-top: 8px;
}

/* Minus and Plus Buttons */
.addon-quantity button {
  background-color: #fff;
  border: none;             /* No individual border */
  outline: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: #333;
  transition: background-color 0.2s ease;
}

/* Hover effect for buttons */
.addon-quantity button:hover {
  background-color: #f2f2f2;
}

/* Disabled state for buttons (if used) */
.addon-quantity button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Numeric Input Field */
.addon-quantity input[type="number"] {
  width: 50px;
  height: 30px;
  border: none;             /* No individual border */
  text-align: center;
  font-size: 14px;
  color: #333;
  outline: none;
  -moz-appearance: textfield; /* Removes spinner in Firefox */
}

/* Remove spinner in Chrome, Safari, Edge, etc. */
.addon-quantity input[type="number"]::-webkit-inner-spin-button,
.addon-quantity input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ----------------------------------------------------------------
   RESPONSIVE FIX FOR SMALL SCREENS
   Keep two columns & shrink quantity controls
---------------------------------------------------------------- */
@media (max-width: 480px) {
  /* Two columns on very small screens */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px; /* Slightly smaller gap */
  }

  /* Reduce padding on product cards to save space */
  .addon-product {
    width: 100%;  /* Stretches within the column */
    padding: 5px; /* Less padding to prevent overflow */
  }

  /* Make images scale down if needed */
  .addon-product img {
    max-width: 100%;
    height: auto;
  }

  /* Slightly smaller minus/plus and input on tiny screens */
  .addon-quantity button {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
  .addon-quantity input[type="number"] {
    width: 40px;  /* or 35px if still too wide */
    height: 26px;
    font-size: 14px;
  }
}
/* Spark element styling */
.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #ff0 20%, transparent 20%);
  border-radius: 50%;
  opacity: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: sparkAnim 0.5s ease-out forwards;
}

@keyframes sparkAnim {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(5);
    opacity: 0;
  }
}
/* ----------------------------------------------------------------
   CONFETTI / PARTY POPPER EFFECT
---------------------------------------------------------------- */
.confetti {
  position: absolute;
  width: 5px;
  height: 10px;
  opacity: 1;
  pointer-events: none;
  /* The element will start at its initial position */
  transform: translate(0, 0) rotate(0deg);
  animation: confettiBurst 1s ease-out forwards;
}

/* The keyframes use custom CSS variables (--tx and --ty)
   which will be set dynamically via JavaScript */
@keyframes confettiBurst {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) rotate(360deg);
    opacity: 0;
  }
}


.addon-quantity button.disabled,
.addon-quantity input[type="number"].disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

#selected-summary {
    min-height: 40px; /* Adjust as needed */
}

.addon-product {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%; /* Ensures all boxes align */
}

.addon-product-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.addon-quantity {
  margin-top: auto; /* Push to bottom */
}


