/* Container Layout */
.sar-build-a-box-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  direction: rtl;
  font-family: inherit;
}

/* Sidebar (Right Side in RTL desktop) */
.sar-sidebar {
  flex: 1;
  min-width: 320px;
  max-width: 350px;
  background: #f9f9f9;
  padding: 25px;
  border-radius: 12px;
  border: 1px solid #eee;
  height: fit-content;
  position: sticky;
  top: 20px;
  z-index: 10;
}

.sar-sidebar-title {
  text-align: center;
  color: #0b9e6f;
  margin-bottom: 10px;
}

.sar-sidebar-desc {
  text-align: center;
  font-size: 13px;
  color: #666;
  margin-bottom: 25px;
}

/* Empty Slots (Dotted Boxes) */
.sar-slots-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.sar-slot-item {
  width: 50px;
  height: 70px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #fff;
  transition: all 0.3s ease;
}

.sar-slot-item.filled {
  border-style: solid;
  border-color: #0b9e6f;
}

.sar-slot-item img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.sar-plus-icon {
  color: #ccc;
  font-size: 20px;
  font-weight: bold;
}

/* Discount Badge */
.sar-discount-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #0b9e6f;
  color: #fff;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 50px;
  z-index: 2;
}

/* Packaging Selection */
.sar-packaging-wrapper {
  margin-bottom: 20px;
}

.sar-packaging-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

.sar-pack-price {
  color: #0b9e6f;
}

.sar-pack-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  outline: none;
}

.sar-divider {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 20px 0;
}

/* Total Price */
.sar-total-wrapper {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 25px;
}

/* Submit Button */
.sar-submit-btn {
  width: 100%;
  padding: 15px;
  background: #0b9e6f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.sar-submit-btn:disabled {
  background: #a4d8c7;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Products Grid Area */
.sar-products-area {
  flex: 2;
  min-width: 60%;
}

.sar-products-main-title {
  margin-bottom: 20px;
  color: #333;
}

.sar-grid-layout {
  display: grid;
  gap: 20px;
}

.sar-grid-layout.sar-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.sar-grid-layout.sar-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Product Cards */
.sar-product-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
}

.sar-product-img img {
  max-width: 100%;
  height: 180px;
  object-fit: contain;
  margin-bottom: 15px;
}

.sar-product-title {
  font-size: 16px;
  margin: 0 0 5px;
  color: #333;
}

.sar-product-desc {
  font-size: 12px;
  color: #777;
  margin-bottom: 15px;
  display: block;
}

.sar-variation-select {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #eee;
  border-radius: 6px;
  font-size: 13px;
}

.sar-variation-spacer {
  height: 38px;
  margin-bottom: 15px;
}

.sar-price-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 14px;
  margin-top: auto;
}

.sar-product-price {
  color: #0b9e6f;
  font-weight: bold;
}

.sar-add-to-box-btn {
  width: 100%;
  padding: 10px;
  background: #0b9e6f;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.sar-add-to-box-btn:hover {
  background: #08845c;
}

/* Loader */
.sar-loader {
  text-align: center;
  padding: 20px;
  color: #0b9e6f;
  font-weight: bold;
}

/* =========================================
   Responsive Settings for Tablet and Mobile 
   ========================================= */
@media (max-width: 1024px) {
  .sar-build-a-box-container {
    flex-direction: column;
  }

  .sar-sidebar {
    max-width: 100%;
    position: relative; /* Remove sticky on mobile */
    top: 0;
    margin-bottom: 20px;
  }

  .sar-products-area {
    min-width: 100%;
  }
}

/* Specific Mobile Settings */
@media (max-width: 768px) {
  /* Force 2 columns on mobile regardless of Elementor settings */
  .sar-grid-layout.sar-cols-2,
  .sar-grid-layout.sar-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .sar-product-img img {
    height: 120px; /* Make images slightly smaller for 2 cols on mobile */
  }

  .sar-product-card {
    padding: 10px;
  }

  .sar-add-to-box-btn {
    font-size: 12px;
    padding: 8px 5px;
  }

  .sar-product-title {
    font-size: 13px;
  }

  .sar-price-wrapper {
    flex-direction: column;
    gap: 5px;
  }
}
