@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: #f5f0e8;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── PAGE HERO ── */
.addr-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  padding: 48px 40px 80px;
  position: relative;
  overflow: hidden;
}

.addr-hero::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,152,0,0.15) 0%, transparent 70%);
  top: -100px; right: -50px;
  pointer-events: none;
}

.addr-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: #f5f0e8;
  clip-path: ellipse(55% 100% at 50% 100%);
}

.addr-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.addr-hero-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.addr-hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,152,0,0.85);
}

.addr-hero-title h1 {
  font-size: 36px;
  font-weight: 800;
  color: white;
  line-height: 1.1;
}

.addr-hero-title p {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

.addr-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: #ff9800;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(255,152,0,0.4);
  white-space: nowrap;
}
.addr-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,152,0,0.5);
}
.addr-add-btn:active { transform: scale(0.97); }

/* ── PAGE BODY ── */
.addr-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 40px 60px;
}

/* ── GRID ── */
#address-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* ── ADDRESS CARD ── */
.address-card {
  background: white;
  border-radius: 18px;
  padding: 22px 22px 18px;
  border: 2px solid transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  cursor: default;
}

.address-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.10);
  border-color: #ff9800;
}

/* Default card highlight */
.address-card.is-default {
  border-color: #2a7de1;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

/* ── PIN ICON ── */
.card-pin {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #ff9800, #ff6f00);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(255,111,0,0.35);
  flex-shrink: 0;
}
.card-pin svg { transform: rotate(45deg); }
.address-card.is-default .card-pin {
  background: linear-gradient(135deg, #2a7de1, #1a5fb4);
  box-shadow: 0 4px 12px rgba(42,125,225,0.35);
}

/* ── DEFAULT BADGE ── */
.default-tag {
  position: absolute;
  top: 14px; right: 14px;
  background: linear-gradient(135deg, #2a7de1, #1a5fb4);
  color: white;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── CARD NAME ── */
.address-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 8px;
  line-height: 1.3;
}

/* ── CARD ADDRESS ── */
.address-card p {
  font-size: 13.5px;
  line-height: 1.65;
  color: #666;
  margin-bottom: 16px;
}

/* ── CARD ACTIONS ── */
.address-actions {
  display: flex;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid #f0ede6;
}

.addr-action-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  border: 1.5px solid #e5e2db;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  color: #555;
}
.addr-action-btn:hover { background: #f5f0e8; border-color: #ccc; color: #1a1a2e; }
.addr-action-btn.btn-default { color: #2a7de1; border-color: #b8d4f7; }
.addr-action-btn.btn-default:hover { background: #eef4ff; border-color: #2a7de1; }
.addr-action-btn.btn-remove { color: #dc2626; border-color: #fca5a5; }
.addr-action-btn.btn-remove:hover { background: #fff0f0; border-color: #dc2626; }

/* ── EMPTY STATE ── */
.addr-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
}
.addr-empty svg { margin-bottom: 16px; opacity: 0.3; }
.addr-empty p { font-size: 16px; }

/* ── MODAL ── */
.modal {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15,15,30,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 6000;
  padding: 20px;
}

.modal-box {
  background: white;
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modal-pop 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modal-pop {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-box h3 {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.modal-box .modal-subtitle {
  font-size: 13px;
  color: #aaa;
  margin-top: -10px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-field label {
  font-size: 12px;
  font-weight: 700;
  color: #777;
  letter-spacing: 0.03em;
}

.modal-box input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e5e2db;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  color: #1a1a2e;
  background: #faf9f7;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.modal-box input:focus {
  border-color: #ff9800;
  background: white;
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.modal-save-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: linear-gradient(135deg, #ff9800, #ff6f00);
  color: white;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,111,0,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.modal-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,111,0,0.4);
}

.modal-cancel-btn {
  padding: 12px 20px;
  border: 1.5px solid #e5e2db;
  background: transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  color: #888;
  cursor: pointer;
  transition: background 0.15s;
}
.modal-cancel-btn:hover { background: #f5f0e8; color: #333; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .addr-hero { padding: 36px 20px 70px; }
  .addr-hero-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .addr-hero-title h1 { font-size: 28px; }
  .addr-body { padding: 24px 20px 48px; }
  #address-container { grid-template-columns: 1fr; }
  .modal-row { grid-template-columns: 1fr; }
}