/* ===== COD POPUP FORM CSS - DRIPPIN =====
   Paste in: /wp-content/themes/AAPKA-THEME/cod-form.css
   =========================================== */

/* Overlay */
#cod-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

#cod-overlay.active {
  display: flex;
}

/* Modal */
#cod-modal {
  background: #fff;
  border-radius: 0;
  width: 100%;
  max-width: 540px;
  margin: auto;
  padding: 28px 24px 32px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  box-sizing: border-box;
}

#cod-modal h2 {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  margin: 0 0 18px 0;
  padding-right: 30px;
  letter-spacing: 0.2px;
}

/* Close button */
#cod-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #555;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cod-close:hover {
  color: #000;
}

/* Product list */
.cod-products {
  margin-bottom: 14px;
}

.cod-product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.cod-product-item:last-child {
  border-bottom: none;
}

.cod-product-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid #eee;
  flex-shrink: 0;
}

.cod-product-info {
  flex: 1;
  min-width: 0;
}

.cod-product-title {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cod-product-variant {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.cod-product-qty {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.cod-product-price {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Summary */
.cod-summary {
  background: #f8f8f8;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid #ebebeb;
}

.cod-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #444;
  padding: 4px 0;
}

.cod-summary-row.total {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  border-top: 1px solid #ddd;
  margin-top: 6px;
  padding-top: 8px;
}

.cod-fee-label {
  color: #e05c00;
}

.cod-fee-value {
  color: #e05c00;
  font-weight: 600;
}

/* Form fields */
#cod-form-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cod-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.cod-field label {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cod-field .req {
  color: #e00;
}

.cod-row {
  display: flex;
  gap: 10px;
}

.cod-row .cod-field {
  flex: 1;
}

.cod-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 0;
  font-size: 14px;
  color: #111;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.cod-input:focus {
  border-color: #111;
}

.cod-input.error {
  border-color: #e00;
  background: #fff8f8;
}

.cod-input::placeholder {
  color: #bbb;
}

select.cod-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Subscribe checkbox */
.cod-subscribe {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  margin-top: 2px;
}

.cod-subscribe input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #111;
  flex-shrink: 0;
  cursor: pointer;
}

/* Error message */
.cod-error-msg {
  display: none;
  background: #fff0f0;
  border: 1px solid #ffcccc;
  color: #c00;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 0;
}

/* Buttons */
.cod-btn-pay {
  width: 100%;
  padding: 16px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 0;
  margin-top: 4px;
}

.cod-btn-pay:hover {
  opacity: 0.88;
}

.cod-btn-pay:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Prepaid button - green */
.cod-btn-prepaid {
  background: #1a7a3c;
  color: #fff;
}

/* COD button - black */
.cod-btn-cod {
  background: #111111;
  color: #fff;
}

/* Spinner */
.cod-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cod-spin 0.7s linear infinite;
}

@keyframes cod-spin {
  to { transform: rotate(360deg); }
}

/* Success screen */
#cod-success {
  text-align: center;
  padding: 40px 20px;
}

#cod-success h3 {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin: 0 0 10px 0;
}

#cod-success p {
  color: #555;
  font-size: 14px;
  margin: 0;
}

/* Mobile responsive */
@media (max-width: 540px) {
  #cod-overlay {
    padding: 0;
    align-items: flex-end;
  }

  #cod-modal {
    border-radius: 0;
    max-height: 92vh;
    overflow-y: auto;
    margin: 0;
    width: 100%;
    padding: 20px 16px 28px;
  }

  .cod-row {
    flex-direction: column;
    gap: 10px;
  }

  #cod-modal h2 {
    font-size: 15px;
  }

  .cod-btn-pay {
    padding: 15px;
    font-size: 14px;
  }
}
