/* UPS Shipping Calculator - Clean Professional Style */

.ups-pcalc {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  background: #fff;
}

.ups-pcalc__title {
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 15px;
  color: #333;
}

.ups-pcalc__row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ups-pcalc__zip {
  flex: 1;
  min-width: 160px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d6e4f0;
  font-size: 14px;
  transition: border-color 0.2s;
}

.ups-pcalc__zip:focus {
  outline: none;
  border-color: #4a90e2;
}

.ups-pcalc__zip.is-invalid {
  border-color: #c62828;
  background-color: #fff5f5;
  color: #c62828;
}

.ups-pcalc__zip.is-invalid:focus {
  border-color: #c62828;
}

/* Address autocomplete field — full-width, above the ZIP row */
.ups-pcalc__address {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d6e4f0;
  font-size: 14px;
  background: #fff;
  margin-bottom: 10px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.ups-pcalc__address:focus {
  outline: none;
  border-color: #4a90e2;
}

/* Country selector — full-width row below the title */
.ups-pcalc__country-wrap {
  position: relative;
  margin-bottom: 10px;
}

.ups-pcalc__country-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #6b8ba4;
  pointer-events: none;
}

.ups-pcalc__country {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  border-radius: 8px;
  border: 1px solid #d6e4f0;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ups-pcalc__country:focus {
  outline: none;
  border-color: #4a90e2;
}

.ups-pcalc__qty {
  width: 80px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d6e4f0;
  font-size: 14px;
  text-align: center;
  transition: border-color 0.2s;
}

.ups-pcalc__qty:focus {
  outline: none;
  border-color: #4a90e2;
}

.ups-pcalc__btn {
  height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #333;
  color: #fff !important;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-width: 100px;
}

.ups-pcalc__btn::after,
.ups-pcalc__btn::before {
  display: none !important;
  content: none !important;
}

.ups-pcalc__btn:hover {
  background: #555;
  border-color: #555;
}

.ups-pcalc__btn:disabled,
.ups-pcalc__btn.ups-pcalc-busy {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

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

/* ── Detecting banner ── */
.ups-pcalc__detecting {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 12px;
  border: 2px solid #00A651;
  border-radius: 8px;
  background: #f0faf4;
  color: #1a5c35;
  font-size: 14px;
  font-weight: 500;
}

.ups-pcalc__spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid #00A651;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ups-pcalc-spin 0.7s linear infinite;
}

/* ── Address type note (residential / commercial / unconfirmed) ── */
.ups-pcalc__addr-note {
  display: none; /* shown via JS */
  margin-top: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 2px solid #d6e4f0;
  background: #f4f9ff;
  color: #2c5282;
}

.ups-pcalc__addr-note[data-type="residential"] {
  border-color: #2b6cb0;
  background: #ebf8ff;
  color: #1a365d;
}

.ups-pcalc__addr-note[data-type="commercial"] {
  border-color: #a0aec0;
  background: #f7fafc;
  color: #4a5568;
}

.ups-pcalc__addr-note[data-type="unconfirmed"] {
  border-color: #d69e2e;
  background: #fffff0;
  color: #744210;
}

.ups-pcalc__hint {
  margin-top: 10px;
  font-size: 13px;
  color: #666;
}

.ups-pcalc__fallback {
  margin-top: 12px;
  padding: 12px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  color: #666;
}

.ups-pcalc__fallback strong {
  color: #333;
}

.ups-pcalc__status {
  margin-top: 12px;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  display: inline-block;
}

.ups-pcalc__status.is-loading { 
  background: #f5f5f5;
  color: #666;
}

.ups-pcalc__status.is-ok { 
  background: #e8f5e9;
  color: #2e7d32;
}

.ups-pcalc__status.is-error { 
  background: #ffebee;
  color: #c62828;
}

.ups-pcalc__results {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.ups-pcalc__item {
  padding: 14px 16px;
  border: 2px solid #d6e4f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.ups-pcalc__item:hover {
  border-color: #a8c5e0;
  background: #f8fbfd;
}

/* Selected state - soft blue border */
.ups-pcalc__item.is-selected {
  border-color: #4a90e2;
  background: #e8f2fc;
  box-shadow: 0 0 0 1px #4a90e2;
}

.ups-pcalc__line1 {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ups-pcalc__cost {
  font-weight: 700;
  color: #333;
}

.ups-pcalc__line2 {
  margin-top: 6px;
  font-size: 13px;
  color: #666;
}

/* LTL Freight section */
.ups-pcalc__ltl-results {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.ups-pcalc__ltl-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  padding-bottom: 4px;
  border-bottom: 1px solid #e8e8e8;
}

.ups-pcalc__item--ltl {
  border-color: #d5e8d4;
  cursor: default;
}

.ups-pcalc__item--ltl:hover {
  border-color: #a3c9a1;
  background: #f6fbf6;
}

/* Responsive — row wraps on narrow screens */
@media (max-width: 600px) {
  .ups-pcalc__row {
    flex-wrap: wrap;
  }
  .ups-pcalc__zip {
    flex: 1 1 calc(100% - 100px);
    min-width: 0;
  }
  .ups-pcalc__qty {
    flex: 0 0 80px;
  }
  .ups-pcalc__btn {
    flex: 1 1 auto;
  }
}
