/* style/style.css - SUCAR Boutique Global Design System */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Cores Modo Claro (Minimalista, limpo e alto contraste) */
  --bg-app: #f9fafb;
  --bg-card: #ffffff;
  --bg-card-muted: #f3f4f6;
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-dim: #9ca3af;
  
  --primary: #b85d38;
  --primary-hover: #a14e2c;
  --primary-light: #faece6;
  --primary-foreground: #ffffff;
  
  --cta: #e65100;
  --cta-hover: #cf4900;
  --cta-foreground: #ffffff;

  --whatsapp: #25d366;
  --whatsapp-hover: #1ebd5a;
  --whatsapp-foreground: #ffffff;

  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --input-bg: #ffffff;
  --ring: rgba(230, 81, 0, 0.2);

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(36, 24, 19, 0.05);
  --shadow-md: 0 4px 12px rgba(36, 24, 19, 0.08);
  --shadow-lg: 0 10px 25px rgba(36, 24, 19, 0.12);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark {
  --bg-app: #140f0c;
  --bg-card: #1f1713;
  --bg-card-muted: #29201a;
  --text-main: #f5ece4;
  --text-muted: #a8988e;
  --text-dim: #73645b;
  
  --primary: #cf6e46;
  --primary-hover: #b85d38;
  --primary-light: #38241b;
  --primary-foreground: #ffffff;
  
  --cta: #f97316;
  --cta-hover: #ea580c;
  --cta-foreground: #ffffff;

  --border: #33261f;
  --border-light: #261d17;
  --input-bg: #1f1713;
  --ring: rgba(207, 110, 70, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* Marca / Logótipo */
.brand-img-logo {
  max-height: 52px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
  font-size: 1.35rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary) 0%, var(--cta) 100%);
  color: #fff;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(184, 93, 56, 0.35);
}

.brand-text span {
  color: var(--primary);
  font-weight: 400;
  font-size: 0.85em;
  display: block;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  min-height: 48px;
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-cta {
  background-color: var(--cta);
  color: var(--cta-foreground);
  box-shadow: 0 4px 12px rgba(230, 81, 0, 0.3);
}

.btn-cta:hover {
  background-color: var(--cta-hover);
}

.btn-whatsapp {
  background-color: var(--whatsapp);
  color: var(--whatsapp-foreground);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background-color: var(--whatsapp-hover);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-card-muted);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.875rem;
  min-height: 38px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Formulários */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background-color: var(--input-bg);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
  min-height: 48px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.form-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Cartões */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* ================= SISTEMA DE TOASTS E NOTIFICAÇÕES LUXO ================= */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - 48px);
}

@media (max-width: 640px) {
  #toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    align-items: center;
  }
}

.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  width: 100%;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 30px -4px rgba(20, 10, 6, 0.12), 0 4px 10px -2px rgba(20, 10, 6, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.07);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  animation: toastSpringIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  user-select: none;
}

.toast.toast-exiting {
  opacity: 0 !important;
  transform: translateY(-12px) scale(0.96) !important;
}

/* Ícone com cápsula suave */
.toast-icon-capsule {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.toast:hover .toast-icon-capsule {
  transform: scale(1.08);
}

.toast.success .toast-icon-capsule {
  background: #ecfdf5;
  color: #059669;
}

.toast.error .toast-icon-capsule {
  background: #fef2f2;
  color: #dc2626;
}

.toast.warning .toast-icon-capsule {
  background: #fffbeb;
  color: #d97706;
}

.toast.info .toast-icon-capsule {
  background: #fbf5f2;
  color: #b85d38;
}

/* Conteúdo */
.toast-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1f140e;
  line-height: 1.25;
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}

.toast-message {
  font-size: 0.8125rem;
  color: #6b5c52;
  line-height: 1.45;
  word-break: break-word;
}

/* Botão Fechar */
.toast-close-btn {
  background: none;
  border: none;
  padding: 4px;
  margin: -4px -4px 0 0;
  border-radius: 6px;
  color: #a89a90;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  outline: none;
}

.toast-close-btn:hover {
  color: #1f140e;
  background: rgba(0, 0, 0, 0.05);
}

/* Barra de Progresso Animada */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

.toast.success .toast-progress { background: #059669; opacity: 0.45; }
.toast.error .toast-progress { background: #dc2626; opacity: 0.45; }
.toast.warning .toast-progress { background: #d97706; opacity: 0.45; }
.toast.info .toast-progress { background: #b85d38; opacity: 0.55; }

@keyframes toastSpringIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ================= MODAIS DE ALERTA E CONFIRMAÇÃO INTERATIVOS ================= */
.sucar-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 13, 8, 0.55);
  backdrop-filter: blur(8px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.sucar-dialog-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sucar-dialog-card {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 30px 26px 26px;
  box-shadow: 0 25px 50px -12px rgba(20, 10, 6, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transform: scale(0.92) translateY(14px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  position: relative;
  box-sizing: border-box;
}

.sucar-dialog-overlay.active .sucar-dialog-card {
  transform: scale(1) translateY(0);
}

.sucar-dialog-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sucar-dialog-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  opacity: 0.22;
  background: currentColor;
  animation: sucarPulse 2s infinite ease-out;
}

.sucar-dialog-icon.success { background: #ecfdf5; color: #059669; }
.sucar-dialog-icon.danger { background: #fef2f2; color: #dc2626; }
.sucar-dialog-icon.warning { background: #fffbeb; color: #d97706; }
.sucar-dialog-icon.info { background: #fbf5f2; color: #b85d38; }

.sucar-dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f140e;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.sucar-dialog-desc {
  font-size: 0.885rem;
  color: #6b5c52;
  line-height: 1.55;
  margin-bottom: 24px;
}

.sucar-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.sucar-dialog-btn {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  outline: none;
}

.sucar-dialog-btn:active {
  transform: scale(0.98);
}

.sucar-dialog-btn-cancel {
  background: #f4efe9;
  color: #554439;
}

.sucar-dialog-btn-cancel:hover {
  background: #eae2d8;
  color: #1f140e;
}

.sucar-dialog-btn-confirm {
  background: #b85d38;
  color: #ffffff;
}

.sucar-dialog-btn-confirm:hover {
  background: #a04e2d;
  box-shadow: 0 4px 14px rgba(184, 93, 56, 0.35);
}

.sucar-dialog-btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.sucar-dialog-btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

@keyframes sucarPulse {
  0% { transform: scale(1); opacity: 0.35; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Modais e Drawer Mobile */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drawer-overlay.active {
  display: block;
  opacity: 1;
}

.drawer-content {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 24px 20px 32px;
  z-index: 1001;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.drawer-content.active {
  transform: translateX(-50%) translateY(0);
}

.drawer-handle {
  width: 42px;
  height: 5px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 0 auto 18px;
}

/* Utilitários */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.font-semibold { font-weight: 600; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.opacity-70 { opacity: 0.7; }
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }
.transition { transition: var(--transition); }
