/**
 * Address Input Modal CSS
 * Handles the address input modal with manual form and location detection options
 */

.cmc-addr-input-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10030;
}

.cmc-addr-input-modal.open {
  display: block;
}

.cmc-addr-input-modal .cmc-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.cmc-addr-input-modal .cmc-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.2);
  padding: 16px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cmc-addr-input-modal.open .cmc-sheet {
  transform: translateY(0);
}

.cmc-addr-input-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.cmc-addr-option {
  border: 1px solid #eef0ff;
  border-radius: 14px;
  padding: 12px;
  background: #f9faff;
}

.cmc-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cmc-option-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.cmc-option-header p {
  display: none; /* Hide description to save space */
}

.cmc-manual-form {
  display: grid;
  gap: 8px;
}

.cmc-form-row {
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr 1fr;
}

.cmc-form-row.full-width {
  grid-template-columns: 1fr;
}

.cmc-form-row label {
  display: block;
  font-weight: 600;
  color: #222;
  font-size: 12px;
  margin-bottom: 4px;
}

.cmc-form-row input,
.cmc-form-row select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #e1e3ee;
  border-radius: 8px;
  outline: 0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
  font-size: 14px;
}

.cmc-form-row input:focus,
.cmc-form-row select:focus {
  border-color: #cdd9ff;
  box-shadow: 0 0 0 2px rgba(122, 39, 255, 0.12);
}

.cmc-location-btn-container {
  margin: 0;
}

.cmc-location-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #7a27ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.cmc-location-btn:hover {
  background: #6a20e5;
}

.cmc-location-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.cmc-location-icon {
  font-size: 14px;
}

.cmc-location-result {
  margin-top: 8px;
  padding: 8px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e1e3ee;
  display: none;
}

.cmc-location-address {
  margin-bottom: 8px;
  line-height: 1.4;
  color: #222;
  font-size: 12px;
}

.cmc-location-actions {
  display: flex;
  gap: 6px;
}

.cmc-use-location-btn,
.cmc-retry-location-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.cmc-use-location-btn {
  background: #7a27ff;
  color: #fff;
}

.cmc-use-location-btn:hover {
  background: #6a20e5;
}

.cmc-retry-location-btn {
  background: #f3f5ff;
  color: #7a27ff;
  border: 1px solid #e1e3ee;
}

.cmc-retry-location-btn:hover {
  background: #e9e0ff;
}

.cmc-addr-input-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #eef0ff;
}

.cmc-cancel-btn,
.cmc-save-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.cmc-cancel-btn {
  background: #f3f5ff;
  color: #7a27ff;
  border: 1px solid #e1e3ee;
}

.cmc-cancel-btn:hover {
  background: #e9e0ff;
}

.cmc-save-btn {
  background: #7a27ff;
  color: #fff;
}

.cmc-save-btn:hover {
  background: #6a20e5;
}

.cmc-save-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.cmc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #666;
  font-style: italic;
  font-size: 13px;
}

.cmc-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #7a27ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.cmc-error {
  color: #c33;
  padding: 8px;
  background: #ffebee;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .cmc-addr-input-modal .cmc-sheet {
    padding: 12px;
  }
  
  .cmc-form-row input,
  .cmc-form-row select {
    height: 36px;
    font-size: 13px;
  }
  
  .cmc-form-row label {
    font-size: 11px;
  }
  
  .cmc-location-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .cmc-cancel-btn,
  .cmc-save-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}