/* ============================================
   SELECTOR DE DIRECCIÓN - DISEÑO PROFESIONAL
   Con paleta de colores de DomiPancho
   ============================================ */

   .address-selector-wrapper {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: box-shadow 0.2s ease;
  }
  
  .address-selector-wrapper.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }
  
  .address-selector-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .address-selector-container:hover {
    background: #f9fafb;
  }
  
  .address-selector-container:active {
    transform: scale(0.99);
  }
  
  /* Icono de ubicación */
  .address-icon-wrapper {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
  }
  
  .address-selector-container:hover .address-icon-wrapper {
    background: linear-gradient(135deg, #e55a2b, #d14f24);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  }
  
  .address-icon-wrapper svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
  }
  
  /* Información de dirección */
  .address-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .address-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .address-text {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
  }
  
  /* Icono dropdown */
  .address-dropdown-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
  }
  
  .address-dropdown-icon svg {
    width: 16px;
    height: 16px;
    fill: #ff6b35;
  }
  
  .address-selector-container:hover .address-dropdown-icon svg {
    fill: #e55a2b;
  }
  
  /* ============================================
     MODAL DE DIRECCIONES
     ============================================ */
  
  .address-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
  }
  
  @keyframes fadeIn {
    to { opacity: 1; }
  }
  
  @keyframes fadeOut {
    to { opacity: 0; }
  }
  
  .address-modal {
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    transform: scale(0.95);
    opacity: 0;
    animation: scaleIn 0.2s ease forwards 0.05s;
  }
  
  @keyframes scaleIn {
    to {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  /* Header del modal */
  .address-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 14px 14px 0 0;
  }
  
  .address-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .address-modal-icon {
    width: 24px;
    height: 24px;
  }
  
  .address-modal-icon svg {
    width: 100%;
    height: 100%;
    fill: #ffffff;
  }
  
  .address-modal-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
  }
  
  .address-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }
  
  .address-modal-close:hover {
    background: rgba(255, 107, 53, 0.9);
    color: #ffffff;
  }
  
  /* Cuerpo del modal */
  .address-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
  }
  
  /* Botón de ubicación actual */
  .use-current-location-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.2);
  }
  
  .use-current-location-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e55a2b, #d14f24);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
  }
  
  .use-current-location-btn:active:not(:disabled) {
    transform: translateY(0);
  }
  
  .use-current-location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  .location-icon svg {
    width: 18px;
    height: 18px;
    fill: white;
  }
  
  /* Divider */
  .address-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
  }
  
  .address-divider::before,
  .address-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
  }
  
  /* Header de direcciones guardadas */
  .saved-addresses-header {
    margin-bottom: 16px;
  }
  
  .saved-addresses-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .address-count {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
  }
  
  /* Lista de direcciones */
  .saved-addresses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  /* Card de dirección */
  .address-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .address-card:hover {
    background: #ffffff;
    border-color: #ff6b35;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.15);
  }
  
  .address-card.selected {
    background: #ffffff;
    border-color: #ff6b35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
  }
  
  .address-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  
  .address-card-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
  }
  
  .address-type-icon svg {
    width: 18px;
    height: 18px;
    fill: #ff6b35;
  }
  
  .favorite-badge {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
  }
  
  .favorite-badge svg {
    width: 12px;
    height: 12px;
    fill: #fbbf24;
  }
  
  .address-card-text {
    color: #374151;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
  }
  
  .address-card-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
  }
  
  .address-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
  }
  
  .address-action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }
  
  .address-action-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .btn-set-favorite {
    background: #f3f4f6;
    color: #374151;
  }
  
  .btn-set-favorite:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
  }
  
  .btn-delete {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
  }
  
  .btn-delete:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
  }
  
  /* Botón agregar nueva dirección */
  .add-address-btn {
    width: 100%;
    padding: 10px 16px;
    background: white;
    border: 2px dashed #ff6b35;
    border-radius: 10px;
    color: #ff6b35;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: 16px;
  }
  
  .add-address-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .add-address-btn:hover {
    background: rgba(255, 107, 53, 0.05);
    border-color: #e55a2b;
    color: #e55a2b;
    border-style: solid;
  }
  
  /* Estado vacío */
  .no-addresses {
    text-align: center;
    padding: 40px 20px;
  }
  
  .no-addresses-icon svg {
    width: 64px;
    height: 64px;
    fill: #ff6b35;
    opacity: 0.3;
    margin-bottom: 16px;
  }
  
  .no-addresses p {
    color: #6b7280;
    font-size: 14px;
    margin: 8px 0;
  }
  
  /* Formulario de nueva dirección */
  .address-form {
    animation: fadeIn 0.2s ease;
  }
  
  .address-form h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
  }

  /* Ocultar botón agregar cuando el formulario está activo */
  .address-modal-body:has(.address-form) .add-address-btn {
    display: none;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
  }
  
  .form-input,
  .form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    color: #2c3e50;
    background: white;
  }
  
  .form-input:focus,
  .form-select:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
  }
  
  .form-input::placeholder {
    color: #9ca3af;
  }
  
  textarea.form-input {
    resize: vertical;
    min-height: 80px;
  }
  
  .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
  }
  
  .btn-form {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .btn-save {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.2);
  }
  
  .btn-save:hover {
    background: linear-gradient(135deg, #e55a2b, #d14f24);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
  }
  
  .btn-cancel {
    background: #f3f4f6;
    color: #374151;
  }
  
  .btn-cancel:hover {
    background: #e5e7eb;
  }
  
  /* Loading state */
  .address-loading {
    text-align: center;
    padding: 40px 20px;
  }
  
  .address-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  .address-loading p {
    color: #6b7280;
    font-size: 14px;
  }
  

/* ============================================
   MAPA Y INSTRUCCIONES
   ============================================ */

.map-form-container {
  animation: fadeIn 0.3s ease;
}

.map-header {
  text-align: center;
  margin-bottom: 20px;
}

.map-header h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.map-header p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.map-instructions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: #f0f9ff;
  border-radius: 10px;
  border: 1px solid #e0f2fe;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 12px;
  color: #374151;
  line-height: 1.4;
}

.instruction-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: linear-gradient(135deg, #ff6b35, #e55a2b);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
}

.instruction-icon svg {
  width: 14px;
  height: 14px;
  fill: white;
}

#address-map {
  height: 300px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.map-coordinates {
  display: flex;
  gap: 16px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #6b7280;
}

.map-coordinates strong {
  color: #2c3e50;
  font-weight: 600;
}

  /* ============================================
     RESPONSIVE - DESKTOP
     ============================================ */
  
  @media (min-width: 1024px) {
    .address-selector-wrapper {
      padding: 0;
    }
  
    .address-selector-container {
      padding: 10px 24px;
      max-width: 1200px;
    }
  
    .address-info {
      max-width: 400px;
    }
  }
  
  /* ============================================
     RESPONSIVE - TABLET
     ============================================ */
  
  @media (max-width: 768px) {
    .address-modal {
      max-height: 90vh;
      max-width: 100%;
    }
  
    .address-modal-header {
      padding: 16px 20px;
    }
  
    .address-modal-body {
      padding: 20px;
    }
  }
  
  /* ============================================
     RESPONSIVE - MÓVIL
     ============================================ */
  
  @media (max-width: 480px) {
    .address-selector-container {
      padding: 10px 16px;
      gap: 10px;
    }
  
    .address-icon-wrapper {
      width: 36px;
      height: 36px;
      min-width: 36px;
    }
  
    .address-icon-wrapper svg {
      width: 18px;
      height: 18px;
    }
  
    .address-label {
      font-size: 10px;
    }
  
    .address-text {
      font-size: 13px;
    }
  
    .address-modal {
      border-radius: 16px 16px 0 0;
      margin-top: auto;
    }
  
    .address-modal-header {
      padding: 16px;
    }
  
    .address-modal-title h2 {
      font-size: 16px;
    }
  
    .address-modal-body {
      padding: 16px;
    }
  
    .use-current-location-btn {
      padding: 12px 16px;
      font-size: 13px;
    }
  
    .address-card {
      padding: 14px;
    }
  
    .form-actions {
      flex-direction: column;
    }
  
    .btn-form {
      width: 100%;
    }
  }
  
  /* ============================================
     NOTIFICACIONES
     ============================================ */
  
  .address-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    z-index: 10001;
    font-size: 14px;
    font-weight: 500;
    max-width: 90%;
    animation: slideIn 0.3s ease;
  }
  
  .address-notification.error {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
  }
  
  .address-notification.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
  }
  
  @keyframes slideIn {
    from {
      transform: translateX(400px);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  @keyframes slideOut {
    from {
      transform: translateX(0);
      opacity: 1;
    }
    to {
      transform: translateX(400px);
      opacity: 0;
    }
  }
  
  /* ============================================
     UTILIDADES
     ============================================ */
  
  .address-modal-overlay *::-webkit-scrollbar {
    width: 8px;
  }
  
  .address-modal-overlay *::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
  }
  
  .address-modal-overlay *::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 10px;
  }
  
  .address-modal-overlay *::-webkit-scrollbar-thumb:hover {
    background: #e55a2b;
  }
/* Responsive adicional para instruction-item en móviles */
@media (max-width: 480px) {
  .map-instructions {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .instruction-item {
    font-size: 11px;
  }

  .instruction-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }

  .instruction-icon svg {
    width: 12px;
    height: 12px;
  }
}