/* COD Form (modal + offer selector + totals + form) */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 12px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 12px 16px;
  position: relative;
  margin: 12px auto;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  line-height: 1;
}

.modal-header {
  color: rgba(237, 21, 21, 1);
  font-weight: 800;
  font-size: 18px;
  text-align: center;
  padding: 10px 8px;
  margin-bottom: 12px;
}

.modal-gif {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
}

.offer-option {
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}

.offer-option.selected {
  border-color: #ff9c33;
  background: #fffbeb;
}

.offer-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.offer-image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: #f5f5f5;
  flex-shrink: 0;
}

.offer-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.offer-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.offer-badge {
  background: #ff9c33;
  color: white;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  align-self: flex-start;
}

.offer-right {
  text-align: right;
  flex-shrink: 0;
}

.offer-old-price {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
  display: block;
}

.offer-price {
  font-size: 16px;
  font-weight: 900;
  color: #0fba31;
  display: block;
}

.offer-variant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.offer-option:not(.selected) .offer-variant-row {
  display: none;
}

.variant-label {
  font-weight: 800;
  color: #333;
  min-width: 24px;
}

.variant-select {
  flex: 1;
  padding: 12px 32px 12px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}

.totals-summary {
  background: #ebebeb;
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0 14px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: #444;
  margin-bottom: 8px;
  font-weight: 600;
}

.total-row:last-child {
  margin-bottom: 0;
}

.total-final {
  border-top: 1px solid #ddd;
  padding-top: 8px;
  font-size: 17px;
  font-weight: 900;
  color: #111;
}

.discount-value {
  color: #e00;
}

.free-shipping {
  color: #0fba31;
  font-weight: 800;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #333;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
}

.form-group.has-error input,
.form-group.has-error select {
  border-color: #e00;
}

/* Icon-input variant (styles live in products CSS too; keep error state here so the modal is consistent). */
.form-group.has-error .input-wrapper {
  border-color: #e00;
}

.form-group.has-error .field-icon {
  background-color: #ffdbdb;
  border-right-color: #e00;
}

.field-error {
  display: block;
  color: #e00;
  font-size: 12px;
  margin-top: 4px;
  padding-right: 14px;
  padding-left: 14px;
  line-height: 1.3;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}

.submit-button {
  width: 100%;
  background: #0fba31;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 10px 0 12px;
}

.submit-main {
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.submit-sub {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.95;
}
