/* 
 * user-styles.css - Versão Atualizada
 * CSS otimizado para integração das páginas de usuário com o layout da página principal
 */

/* ==================== */
/* Variáveis e Reset */
/* ==================== */
:root {
  /* Variáveis de espaçamento */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Variáveis de tipografia */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 600;
  --font-weight-extra-bold: 700;

  /* Variáveis de interface */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.2);
  --transition-speed: 0.3s;
  --z-index-dropdown: 100;
  --z-index-modal: 1000;
  --z-index-toast: 2000;
}

/* ==================== */
/* Estilos gerais para o módulo de usuários */
/* ==================== */

.auth-container {
  max-width: 600px;
  width: 100%;
  margin: var(--spacing-xl) auto;
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-lg);
  background-color: var(--background-color);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.auth-header h1 {
  font-size: var(--font-size-xl);
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-bold);
}

.auth-header p {
  color: var(--text-color);
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-md);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  width: 100%;
}

/* Melhorias nos estilos de formulários */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  position: relative;
  margin-bottom: var(--spacing-md);
  transition: all var(--transition-speed) ease;
}

.form-group label {
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
  font-size: var(--font-size-md);
  transition: color var(--transition-speed) ease;
}

.form-group input,
.form-group select {
  padding: 0.9rem var(--spacing-md);
  border: 1px solid var(--disabled-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--background-color);
  color: var(--text-color);
  font-size: var(--font-size-md);
  transition: all var(--transition-speed) ease;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(173, 32, 138, 0.15);
}

/* Estados de erro com animações melhoradas */
.form-group .error-message {
  color: #e74c3c;
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
  display: none;
  opacity: 0;
  transform: translateY(-5px);
  transition: all var(--transition-speed) ease;
}

.form-group.error input,
.form-group.error select {
  border-color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.05);
}

.form-group.error .error-message {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.form-group.error label {
  color: #e74c3c;
}

/* Grupos de checkbox melhorados */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
}

.checkbox-group input {
  width: auto;
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
  margin-right: var(--spacing-sm);
}

.checkbox-group label {
  cursor: pointer;
  font-size: var(--font-size-sm);
  user-select: none;
  color: var(--text-color);
}

/* Links de autenticação com efeito de sublinhado */
.auth-links {
  display: flex;
  justify-content: space-between;
  margin: var(--spacing-md) 0;
  font-size: var(--font-size-sm);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.auth-links a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-speed) ease;
  position: relative;
}

.auth-links a:hover {
  color: var(--secondary-color);
}

.auth-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--secondary-color);
  transition: width var(--transition-speed) ease;
}

.auth-links a:hover::after {
  width: 100%;
}

/* Botão principal com efeito de onda ao clicar */
.auth-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 2rem; /* Arredondamento igual aos outros botões do site */
  padding: 0.9rem var(--spacing-md);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  margin-top: var(--spacing-md);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.auth-button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button:disabled {
  background-color: var(--disabled-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Efeito de ripple para o botão */
.auth-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.auth-button:hover::before {
  width: 300%;
  height: 300%;
}

/* Divisor com texto "ou" */
.auth-divider {
  display: flex;
  align-items: center;
  margin: var(--spacing-xl) 0;
  color: var(--disabled-color);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--disabled-color);
}

.auth-divider span {
  padding: 0 var(--spacing-md);
  font-size: var(--font-size-sm);
}

/* Botões de redes sociais */
.auth-social {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
}

.auth-social button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  border: 1px solid var(--disabled-color);
  border-radius: 2rem; /* Consistente com outros botões */
  padding: 0.9rem 1.5rem;
  font-size: var(--font-size-md);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  width: 100%;
}

.auth-social button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.auth-social button:active {
  transform: translateY(0);
}

.auth-social button img {
  width: 20px;
  height: 20px;
}

/* ==================== */
/* Estilos para toast messages */
/* ==================== */

.toast-message {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  z-index: var(--z-index-toast);
  box-shadow: var(--shadow-md);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  max-width: 90%;
}

.toast-message.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-message.success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.toast-message.success::before {
  content: "check_circle";
  font-family: "Material Icons";
  color: #28a745;
}

.toast-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.toast-message.error::before {
  content: "error";
  font-family: "Material Icons";
  color: #dc3545;
}

.toast-message.warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 4px solid #ffc107;
}

.toast-message.warning::before {
  content: "warning";
  font-family: "Material Icons";
  color: #ffc107;
}

.toast-message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.toast-message.info::before {
  content: "info";
  font-family: "Material Icons";
  color: #17a2b8;
}

/* ==================== */
/* Estilos para tabs na página de perfil */
/* ==================== */

.profile-container {
  max-width: 1000px; /* Aumentado para compatibilidade com o layout da index */
  margin: var(--spacing-xl) auto;
  padding: var(--spacing-md);
  background-color: var(--background-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--disabled-color);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
}

.profile-info h1 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-xs);
  color: var(--text-color);
}

.profile-info p {
  color: var(--disabled-color);
  font-size: var(--font-size-sm);
}

.profile-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* Tabs de navegação com indicador visual aprimorado */
.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--disabled-color);
  margin-bottom: var(--spacing-xl);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.profile-tabs::-webkit-scrollbar {
  height: 3px;
}

.profile-tabs::-webkit-scrollbar-thumb {
  background-color: var(--disabled-color);
  border-radius: 3px;
}

.profile-tab {
  padding: var(--spacing-md) var(--spacing-lg);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-speed) ease;
  white-space: nowrap;
  color: var(--text-color);
  position: relative;
}

.profile-tab:hover {
  color: var(--primary-color);
}

.profile-tab.active {
  color: var(--primary-color);
  font-weight: var(--font-weight-bold);
}

.profile-tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 2px 2px 0 0;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-content.active {
  display: block;
}

/* ==================== */
/* Estilos para o gerenciamento de endereços */
/* ==================== */

.addresses-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.address-card {
  border: 1px solid var(--disabled-color);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
  position: relative;
  transition: all var(--transition-speed) ease;
  background-color: var(--background-color);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.address-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
  border-color: var(--primary-color);
}

.address-card.default {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px rgba(173, 32, 138, 0.2);
}

.address-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--primary-color);
  color: white;
  font-size: var(--font-size-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 0 var(--border-radius-md) 0 var(--border-radius-sm);
  font-weight: var(--font-weight-bold);
}

.address-card h3 {
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-md);
  color: var(--text-color);
  font-weight: var(--font-weight-bold);
}

.address-card p {
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--text-color);
  line-height: 1.4;
}

.address-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: auto;
  padding-top: var(--spacing-md);
}

.address-actions button {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: var(--font-size-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-speed) ease;
}

.address-actions button:hover {
  background-color: rgba(173, 32, 138, 0.1);
}

/* Botão de adicionar novo endereço */
.add-address-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--spacing-sm);
  background-color: var(--background-color);
  border: 1px dashed var(--disabled-color);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
  color: var(--primary-color);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  min-height: 150px;
  text-align: center;
}

.add-address-button:hover {
  background-color: rgba(173, 32, 138, 0.05);
  border-color: var(--primary-color);
  transform: translateY(-3px);
}

.add-address-button .material-icons {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
}

/* ==================== */
/* Estilos para o histórico de pedidos */
/* ==================== */

.orders-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.order-card {
  border: 1px solid var(--disabled-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  transition: all var(--transition-speed) ease;
  background-color: var(--background-color);
}

.order-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

.order-header {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--disabled-color);
}

.order-number {
  font-weight: var(--font-weight-bold);
  color: var(--text-color);
  font-size: var(--font-size-md);
}

.order-date {
  color: var(--disabled-color);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

/* Status dos pedidos com ícones */
.order-status {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 16px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  margin-top: var(--spacing-xs);
}

.order-status::before {
  margin-right: var(--spacing-xs);
  font-family: "Material Icons";
  font-size: var(--font-size-sm);
}

.status-pending {
  background-color: #fff3cd;
  color: #856404;
}

.status-pending::before {
  content: "hourglass_empty";
}

.status-processing {
  background-color: #d1ecf1;
  color: #0c5460;
}

.status-processing::before {
  content: "sync";
}

.status-completed {
  background-color: #d4edda;
  color: #155724;
}

.status-completed::before {
  content: "check_circle";
}

.status-canceled {
  background-color: #f8d7da;
  color: #721c24;
}

.status-canceled::before {
  content: "cancel";
}

.order-body {
  padding: var(--spacing-lg);
}

.order-items {
  margin-bottom: var(--spacing-lg);
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.order-items::-webkit-scrollbar {
  width: 4px;
}

.order-items::-webkit-scrollbar-thumb {
  background-color: var(--disabled-color);
  border-radius: 4px;
}

.order-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.order-item:last-child {
  border-bottom: none;
}

.order-item-image {
  width: 60px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  background-color: #f9f9f9;
  padding: var(--spacing-xs);
}

.order-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.order-item-title {
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-md);
}

.order-item-author {
  color: var(--disabled-color);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs);
}

.order-item-price {
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  font-size: var(--font-size-sm);
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--disabled-color);
  font-weight: var(--font-weight-bold);
  color: var(--text-color);
  font-size: var(--font-size-md);
}

.order-actions {
  text-align: right;
  margin-top: var(--spacing-md);
}

.order-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 2rem; /* Consistente com outros botões */
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.order-button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.order-button::after {
  content: "chevron_right";
  font-family: "Material Icons";
  font-size: var(--font-size-md);
  transition: transform var(--transition-speed) ease;
}

.order-button:hover::after {
  transform: translateX(3px);
}

.no-orders {
  text-align: center;
  padding: 3rem var(--spacing-md);
  color: var(--disabled-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.no-orders .material-icons {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.7;
}

/* ==================== */
/* Melhorias para modais */
/* ==================== */

.modal {
  display: none;
  position: fixed;
  z-index: var(--z-index-modal);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-x: hidden;
  overflow-y: auto;
  justify-content: center;
  align-items: flex-start;
  padding: var(--spacing-md);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
  display: flex;
}

.modal-content {
  background-color: var(--background-color);
  margin: 3rem auto;
  width: 60%;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}

.modal.show .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--disabled-color);
  position: relative;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: var(--font-size-lg);
  margin: 0;
  color: var(--text-color);
  padding-right: 40px; /* Espaço para o botão fechar */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  position: absolute;
  right: var(--spacing-lg);
  top: var(--spacing-lg);
  width: 30px;
  height: 30px;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--disabled-color);
  transition: all var(--transition-speed) ease;
  z-index: 10;
  font-size: var(--font-size-lg);
}

.modal-close:hover {
  color: var(--primary-color);
  background-color: rgba(0, 0, 0, 0.05);
  transform: rotate(90deg);
}

.modal-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  max-height: calc(100vh - 12rem);
}

/* Compatibilidade com o carrinho de compras */
.cart-modal .modal-content {
  max-width: 1000px;
}

.cart-items {
  max-height: 50vh;
  overflow-y: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.cart-items::-webkit-scrollbar {
  width: 5px;
}

.cart-items::-webkit-scrollbar-thumb {
  background-color: var(--disabled-color);
  border-radius: 5px;
}

/* ==================== */
/* Melhorias para acessibilidade e animações */
/* ==================== */

/* Foco visível para controles interativos */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Animação para loading */
@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

.loading {
  animation: pulse 1.5s infinite ease-in-out;
}

/* ==================== */
/* Ajustes para tema escuro */
/* ==================== */
@media (prefers-color-scheme: dark) {
  .auth-container {
    background-color: var(--background-color);
  }

  .form-group input,
  .form-group select {
    background-color: var(--background-color);
    color: var(--text-color);
    border-color: var(--disabled-color);
  }

  .modal-content {
    background-color: var(--background-color);
  }

  .order-item-image,
  .address-card,
  .add-address-button {
    background-color: var(--background-color);
  }
}

/* ==================== */
/* Responsividade aprimorada */
/* ==================== */

@media screen and (max-width: 992px) {
  .profile-container {
    max-width: 90%;
  }

  .modal-content {
    width: 80%;
  }
}

@media screen and (max-width: 768px) {
  .auth-container {
    padding: var(--spacing-md);
    margin: var(--spacing-md) auto;
    max-width: 90%;
  }

  .profile-container {
    margin: var(--spacing-md) auto;
    padding: var(--spacing-md);
    max-width: 95%;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
  }

  .profile-info h1 {
    font-size: var(--font-size-lg);
  }

  .profile-tabs {
    padding-bottom: var(--spacing-xs);
  }

  .profile-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
  }

  .addresses-list {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .auth-social {
    flex-direction: column;
  }

  .auth-links {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .modal-content {
    width: 95%;
    max-height: 88vh;
    margin-top: 1rem;
    margin-bottom: 3rem;
  }

  .modal-header {
    padding: var(--spacing-md);
  }

  .modal-body {
    padding: var(--spacing-md);
    max-height: calc(100vh - 12rem);
  }

  .form-group label {
    font-size: var(--font-size-sm);
  }

  .form-group input,
  .form-group select {
    padding: 0.8rem;
    font-size: var(--font-size-sm);
  }

  .order-header {
    flex-direction: column;
    gap: var(--spacing-xs);
    align-items: flex-start;
  }

  .order-status {
    align-self: flex-start;
  }
}

@media screen and (max-width: 480px) {
  .auth-container {
    padding: var(--spacing-sm);
    margin: var(--spacing-sm) auto;
    max-width: 95%;
  }

  .auth-header h1 {
    font-size: var(--font-size-lg);
  }

  .profile-container {
    margin: var(--spacing-sm) auto;
    padding: var(--spacing-sm);
    max-width: 100%;
  }

  .profile-avatar {
    width: 70px;
    height: 70px;
    font-size: 1.75rem;
  }

  .profile-info h1 {
    font-size: var(--font-size-md);
  }

  .profile-tab {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
  }

  .modal-content {
    width: 98%;
    border-radius: var(--border-radius-md);
    margin: 0.5rem auto 2.5rem;
    max-height: calc(100vh - 3rem);
  }

  .modal-header {
    padding: var(--spacing-sm);
  }

  .modal-body {
    padding: var(--spacing-sm);
    max-height: calc(100vh - 9rem);
    padding-bottom: 5rem;
  }

  .modal-close {
    right: var(--spacing-sm);
    top: var(--spacing-sm);
  }

  .order-body {
    padding: var(--spacing-md);
  }

  .order-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-md) 0;
  }

  .order-item-image {
    margin-bottom: var(--spacing-sm);
  }

  /* Ajuste para modal de endereço em telas pequenas */
  #addressForm .auth-button {
    position: sticky;
    bottom: 0;
    margin-top: var(--spacing-lg);
    margin-bottom: 0.5rem;
    z-index: 5;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    padding: 1rem;
  }
}

/* ==================== */
/* Compatibilidade com botões da página principal */
/* ==================== */

/* Ajuste para compatibilidade com botões da index.html */
.auth-button,
.order-button,
.auth-social button {
  border-radius: 2rem;
  text-decoration: none;
  cursor: pointer;
  transition: 0.3s;
}

.auth-button:hover,
.order-button:hover {
  background-color: var(--primary-color);
  color: var(--background-color);
  border-color: var(--primary-color);
}

/* Cor de texto dos links consistente */
.account-link {
  color: var(--text-color) !important;
}

.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 99;
  border: none;
  opacity: 0.9;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle i {
  font-size: 20px;
}

/* Ajustes responsivos para o botão de tema */
@media screen and (max-width: 768px) {
  .theme-toggle {
    width: 35px;
    height: 35px;
    bottom: 15px;
    right: 15px;
  }

  .theme-toggle i {
    font-size: 18px;
  }
}

@media screen and (max-width: 480px) {
  .theme-toggle {
    width: 32px;
    height: 32px;
    bottom: 10px;
    right: 10px;
  }
}

/* Estilos específicos para posicionar o botão quando o modal do carrinho está aberto */
.modal.show ~ .theme-toggle {
  z-index: 50; /* Menor que o z-index do modal */
}

/* 3. Ajustes para lidar com conflitos de z-index com outras interfaces */
/* Ajuste para não sobrepor os modais e elementos flutuantes */
#addressModal,
#cartModal {
  z-index: 1001;
}

.toast-message {
  z-index: 2000;
}
