/**
 * Quantity Discounts - Quick Order Modal Styles
 * Clean horizontal list design
 */

/* Wrapper inside modal */
.quick-order-discount-wrapper {
  padding: 16px;
  background: #f8f9fa;
  border-radius: 16px;
  border: none;
}

.quick-order-discount-wrapper > p {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
  text-align: center;
}

.quick-order-discount-wrapper .discount-max-percent {
  color: #6f42c1;
  font-weight: 800;
}

/* Discount Options - Vertical Stack */
.quick-order-discount-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual Option Row */
.discount-option {
  position: relative;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.discount-option:hover {
  border-color: #6f42c1;
}

.discount-option.selected {
  border-color: #6f42c1;
  background: white;
  box-shadow: 0 0 0 1px #6f42c1;
}

/* Hide native radio */
.discount-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.discount-option label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row-reverse;
  width: 100%;
  cursor: pointer;
  margin: 0;
}

/* Custom radio indicator - Left side by default (LTR) */
.discount-option .radio-indicator {
  width: 22px;
  height: 22px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  margin-left: 0;
}

.discount-option.selected .radio-indicator {
  border-color: #6f42c1;
  background: #6f42c1;
}

.discount-option.selected .radio-indicator::after {
  content: "";
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

/* Option Content Layout - Horizontal */
.option-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

/* Left side - Prices */
.option-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 90px;
  order: 3;
}

/* Middle - Save Badge */
.save-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  background: #f0f0f0;
  color: #666;
  white-space: nowrap;
  order: 2;
}

.save-badge.save-0 {
  background: #f0f0f0;
  color: #888;
}

.save-badge.save-4,
.save-badge.save-5,
.save-badge.save-10,
.save-badge.save-15,
.save-badge.save-20,
.save-badge.save-25,
.save-badge.save-30,
.save-badge.save-40,
.save-badge.save-50 {
  background: #f3e8ff;
  color: #6f42c1;
}

/* Right side - Title text */
.option-right {
  flex: 1;
  text-align: right;
  order: 1;
}

.option-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

/* Price Display */
.price-current {
  font-size: 15px;
  font-weight: 700;
  color: #6f42c1;
  line-height: 1.3;
}

.price-original {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
  display: block;
  margin-top: 2px;
}

/* Option Badge (Popular, Best Value) - Top Right */
.option-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
  color: white;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3);
}

.option-badge.badge-bestseller {
  background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

.option-badge.badge-bestvalue {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 576px) {
  .quick-order-discount-wrapper {
    padding: 12px;
    border-radius: 12px;
  }

  .quick-order-discount-wrapper > p {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .quick-order-discount-options {
    gap: 10px;
  }

  .discount-option {
    padding: 14px 16px;
    border-radius: 10px;
  }

  .discount-option .radio-indicator {
    width: 20px;
    height: 20px;
  }

  .discount-option.selected .radio-indicator::after {
    width: 6px;
    height: 6px;
  }

  .option-title {
    font-size: 14px;
  }

  .save-badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .price-current {
    font-size: 14px;
  }

  .price-original {
    font-size: 11px;
  }

  .option-badge {
    font-size: 10px;
    padding: 4px 10px;
    top: -8px;
    right: 16px;
  }

  .option-left {
    min-width: 70px;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .discount-option {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .option-content {
    flex-wrap: wrap;
    gap: 8px;
  }

  .option-right {
    width: 100%;
    text-align: center;
    order: 1;
  }

  .save-badge {
    order: 2;
  }

  .option-left {
    order: 3;
    min-width: auto;
    align-items: center;
    width: 100%;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
  }

  .price-original {
    margin-top: 0;
  }
}

/* RTL Support (for Arabic) */
[dir="rtl"] .discount-option .radio-indicator {
  margin-right: 0;
  margin-left: 12px;
}

[dir="rtl"] .option-right {
  text-align: right;
}

[dir="rtl"] .option-left {
  align-items: flex-start;
}

[dir="rtl"] .option-badge {
  right: auto;
  left: 20px;
}

@media (max-width: 576px) {
  [dir="rtl"] .option-badge {
    left: 16px;
  }

  [dir="rtl"] .discount-option .radio-indicator {
    margin-left: 8px;
  }
}

@media (max-width: 360px) {
  [dir="rtl"] .option-right {
    text-align: center;
  }

  [dir="rtl"] .option-left {
    align-items: center;
  }
}

/* ========================================
   Upsell Products Styles
   ======================================== */

.quick-order-upsells-wrapper {
  padding: 16px;
  background: #f9f9f9;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.quick-order-upsells-wrapper h6 {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
}

.quick-order-upsells-wrapper h6 svg {
  stroke: #4caf50;
}

.quick-order-upsells-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upsell-product {
  position: relative;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upsell-product:hover {
  border-color: #4caf50;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.upsell-product.selected {
  border-color: #4caf50;
  background: #f1f8f4;
  box-shadow: 0 3px 12px rgba(76, 175, 80, 0.2);
}

.sale-badge {
  position: absolute;
  top: -8px;
  left: 12px;
  background: #ff5252;
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  z-index: 1;
}

.upsell-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upsell-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.upsell-info {
  flex: 1;
}

.upsell-name {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.upsell-price {
  font-size: 16px;
  font-weight: 700;
  color: #4caf50;
}

.upsell-price .price-sale {
  color: #ff5252;
  margin-left: 8px;
}

.upsell-price .price-regular {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
  font-weight: 400;
}

.upsell-actions {
  flex-shrink: 0;
}

.upsell-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
}

.upsell-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #4caf50;
}

.checkbox-label {
  font-size: 14px;
  font-weight: 600;
  color: #4caf50;
  white-space: nowrap;
}

.upsell-product.selected .checkbox-label {
  color: #2e7d32;
}

/* Responsive upsells */
@media (max-width: 576px) {
  .upsell-image {
    width: 50px;
    height: 50px;
  }

  .upsell-name {
    font-size: 14px;
  }

  .upsell-price {
    font-size: 14px;
  }
}

/* RTL Support for upsells */
[dir="rtl"] .sale-badge {
  left: auto;
  right: 12px;
}

[dir="rtl"] .upsell-price .price-sale {
  margin-left: 0;
  margin-right: 8px;
}

/* ========================================
   Sticky Quick Order Button
   ======================================== */

.sticky-quick-order-button {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 999999 !important;
  opacity: 0;
  transform: translateY(100px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  pointer-events: none;
  display: block !important;
  visibility: visible !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
}

.sticky-quick-order-button.show {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.sticky-order-btn {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white !important;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
  transition: all 0.3s ease;
  white-space: nowrap;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  width: auto !important;
  height: auto !important;
}

.sticky-order-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
  transform: translateY(-2px);
}

.sticky-order-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 15px rgba(76, 175, 80, 0.4);
}

.sticky-order-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  flex-shrink: 0;
}

.sticky-btn-text {
  font-size: 16px;
  font-weight: 700;
}

/* Pulse animation for attention */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

.sticky-order-btn.pulse {
  animation: pulse-ring 2s infinite;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .sticky-quick-order-button {
    bottom: 15px !important;
    right: 15px !important;
    display: block !important;
  }

  .sticky-order-btn {
    padding: 14px 22px !important;
    font-size: 15px !important;
    min-width: auto !important;
    /* Ensure good touch target size */
    min-height: 48px;
  }

  .sticky-btn-text {
    font-size: 15px !important;
  }

  .sticky-order-btn svg {
    width: 22px !important;
    height: 22px !important;
  }
}

@media (max-width: 576px) {
  .sticky-quick-order-button {
    bottom: 12px !important;
    right: 12px !important;
  }

  .sticky-order-btn {
    padding: 12px 18px !important;
    font-size: 14px !important;
  }

  .sticky-btn-text {
    font-size: 14px !important;
  }

  .sticky-order-btn svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* RTL Support */
[dir="rtl"] .sticky-quick-order-button {
  right: auto !important;
  left: 20px !important;
}

@media (max-width: 768px) {
  [dir="rtl"] .sticky-quick-order-button {
    left: 15px !important;
  }
}

@media (max-width: 576px) {
  [dir="rtl"] .sticky-quick-order-button {
    left: 12px !important;
  }
}
