:root {
  /* Paleta Oficial Praia Berry Açaí */
  --color-purple-dark: #2D1A36;
  --color-purple-medium: #5B2E82;
  --color-gold: #D4B26A;
  --color-gold-hover: #c29f57;
  --color-cream-bg: #F2E8DC;
  --color-card-bg: #FFFFFF;
  --color-green: #4C5C3D;
  --color-green-hover: #3d4a31;
  --color-green-bg: #f4f6f2;

  --text-main: #2D1A36;
  --text-muted: #6b5b75;
  --border-color: #e5d9ca;
  --border-focus: #D4B26A;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 35px -8px rgba(45, 26, 54, 0.12), 0 4px 10px -2px rgba(45, 26, 54, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--color-cream-bg);
  color: var(--text-main);
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 16px;
}

.container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.card {
  background: var(--color-card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  position: relative;
}

/* Header & Branding */
.brand-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.brand-logo-img {
  width: 100%;
  max-width: 210px;
  height: auto;
  display: block;
  margin: 0 auto 6px auto;
  mix-blend-mode: multiply;
}

.tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Form */
.search-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-purple-medium);
  letter-spacing: 0.1em;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  width: 100%;
}

.input-wrapper input {
  flex: 1;
  width: 100%;
  background: #FFF;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-purple-dark);
  outline: none;
  transition: all 0.2s ease;
  min-width: 0;
  height: 48px;
}

.input-wrapper input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 178, 106, 0.25);
}

.btn-primary {
  background: var(--color-purple-dark);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
  min-width: 96px;
  height: 48px;
  flex-shrink: 0;
}

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

/* Error */
.error-msg {
  background: #fdf2f2;
  border: 1px solid #f8b4b4;
  color: #9b1c1c;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.4;
  font-weight: 500;
}

/* Result Section */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.3s ease;
  width: 100%;
}

.divider {
  height: 1px;
  background: var(--border-color);
  width: 100%;
  margin-bottom: 2px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.badge {
  background: var(--color-green-bg);
  color: var(--color-green);
  border: 1px solid rgba(76, 92, 61, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.distance-tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.store-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-purple-dark);
  line-height: 1.3;
  word-break: break-word;
}

.store-address {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

.user-address-info {
  font-size: 0.78rem;
  color: #8c7a97;
  line-height: 1.3;
  word-break: break-word;
}

/* Actions */
.action-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  width: 100%;
}

.btn-redirect {
  background: var(--color-purple-dark);
  color: #FFF;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
  min-height: 48px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(45, 26, 54, 0.2);
}

.btn-redirect:hover {
  background: var(--color-purple-medium);
  transform: translateY(-1px);
}

.auto-redirect {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 100%;
}

.btn-cancel {
  background: none;
  border: none;
  color: var(--color-purple-medium);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
}

.btn-cancel:hover {
  color: var(--color-purple-dark);
}

/* Footer */
.card-footer {
  text-align: center;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px stroke var(--border-color);
}

.card-footer p {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.82rem;
  color: var(--color-gold);
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Regras Responsivas para Mobile */
@media (max-width: 480px) {
  body {
    padding: 12px 10px;
  }

  .card {
    padding: 24px 16px;
    gap: 18px;
    border-radius: 16px;
  }

  .brand-title {
    font-size: 1.6rem;
  }

  .input-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .input-wrapper input {
    text-align: center;
    font-size: 1.1rem;
  }

  .btn-primary {
    width: 100%;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .store-name {
    font-size: 1.2rem;
  }

  .auto-redirect {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
  }
}
