/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

/* Overlay */
.qo-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qo-overlay.qo-visible {
  opacity: 1;
  visibility: visible;
}

/* Modal */
.qo-modal {
  background-color: #ffffff;
  border-radius: 8px;
  width: 480px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 28px;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.qo-overlay.qo-visible .qo-modal {
  transform: translateY(0);
}

/* Cart summary */
.qo-cart-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.qo-product-thumbnail {
  position: relative;
  flex-shrink: 0;
}

.qo-thumbnail-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.qo-quantity-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 24px;
  height: 24px;
  background-color: #6b7280;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  z-index: 2;
}

.qo-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 80px;
}

.qo-product-name {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.qo-product-price {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: #1a1a1a;
  margin-top: auto;
  margin-left: auto;
  align-self: center;
}

/* Divider */
.qo-divider {
  border-top: 1px solid #e5e7eb;
  margin: 0 0 16px 0;
}

/* Close button */
.qo-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: #f3f4f6;
  border: none;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #1a1a1a;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.qo-close:hover {
  background-color: #f0f0f0;
}

/* Title */
.qo-title {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  color: #1a1a1a;
  margin: 0 0 24px 0;
}

/* Form elements */
.qo-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.qo-field {
  margin-bottom: 16px;
  width: 100%;
}

.qo-row .qo-field {
  flex: 1;
  margin-bottom: 0;
}

.qo-field label {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 8px;
}

.qo-required {
  color: #ef4444;
}

.qo-field input {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #1a1a1a;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.qo-field input::placeholder {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #9ca3af;
}

.qo-field input:focus {
  outline: none;
  border-color: #1a1a1a;
}

.qo-field input.qo-valid {
  border-color: #10b981;
}

.qo-field input.qo-error {
  border-color: #ef4444;
}

/* Stepper */
.qo-stepper {
  display: flex;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.qo-btn-minus,
.qo-btn-plus {
  width: 40px;
  height: 40px;
  background-color: #1a1a1a;
  color: white;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease;
}

.qo-btn-minus:hover,
.qo-btn-plus:hover {
  background-color: #333333;
}

.qo-btn-minus:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.qo-value {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

/* Checkbox */
.qo-checkbox {
  margin-bottom: 16px;
}

.qo-checkbox label {
  display: flex;
  align-items: flex-start;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  cursor: pointer;
}

.qo-checkbox input {
  margin-right: 8px;
  margin-top: 4px;
}

/* Warning message */
.qo-warning {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ef4444;
  text-align: center;
  margin: 16px 0;
}

/* Submit button */
.qo-submit {
  width: 100%;
  padding: 16px;
  background-color: #1a1a1a;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.qo-submit:hover:not(:disabled) {
  background-color: #333333;
}

.qo-submit:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 767px) {
  .qo-modal {
    padding: 20px;
    width: 90%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .qo-row {
    margin-bottom: 14px;
  }
  
  .qo-field {
    margin-bottom: 14px;
  }
  
  .qo-title {
    font-size: 18px;
    margin-bottom: 20px;
  }
  
  .qo-field label {
    font-size: 13px;
  }
  
  .qo-field input {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .qo-field input::placeholder {
    font-size: 13px;
  }
  
  .qo-value {
    font-size: 14px;
  }
  
  .qo-checkbox label {
    font-size: 13px;
  }
  
  .qo-warning {
    font-size: 12px;
    margin: 14px 0;
  }
  
  .qo-submit {
    padding: 14px;
    font-size: 15px;
  }
}
