/* ===== APPLE-INSPIRED DESIGN SYSTEM ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== VARIÁVEIS APPLE ===== */
:root {
  /* Cores principais */
  --apple-blue: #007AFF;
  --apple-blue-dark: #0056CC;
  --apple-gray: #8E8E93;
  --apple-gray-light: #F2F2F7;
  --apple-gray-dark: #1C1C1E;
  --apple-black: #000000;
  --apple-white: #FFFFFF;
  
  /* Cores de sistema */
  --apple-green: #34C759;
  --apple-red: #FF3B30;
  --apple-orange: #FF9500;
  --apple-yellow: #FFCC00;
  
  /* Backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F2F2F7;
  --bg-tertiary: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --bg-dark: #1C1C1E;
  --bg-dark-secondary: #2C2C2E;
  
  /* Texto */
  --text-primary: #000000;
  --text-secondary: #8E8E93;
  --text-tertiary: #C7C7CC;
  --text-white: #FFFFFF;
  
  /* Sombras Apple */
  --shadow-small: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-large: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.06);
  
  /* Bordas */
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 16px;
  --radius-xl: 24px;
  
  /* Espaçamentos */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Transições */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-smooth: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== RESET E BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 17px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== TIPOGRAFIA APPLE ===== */
.text-large-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-title-1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.text-title-2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
}

.text-title-3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.text-headline {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.text-body {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
}

.text-callout {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}

.text-subhead {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

.text-footnote {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
}

.text-caption {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}

/* ===== NAVBAR APPLE ===== */
.apple-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.apple-navbar .logo {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.apple-navbar .logo:hover {
  opacity: 0.7;
}

.apple-navbar .nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.apple-navbar .nav-link {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
  position: relative;
}

.apple-navbar .nav-link:hover {
  opacity: 0.7;
}

.apple-navbar .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--apple-blue);
  border-radius: 50%;
}

.apple-navbar .nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.apple-navbar .user-badge {
  padding: 4px 12px;
  background: var(--apple-blue);
  color: var(--text-white);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.apple-navbar .menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color var(--transition-fast);
}

.apple-navbar .menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.apple-navbar .menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition-fast);
  border-radius: 1px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .apple-navbar {
    padding: 0 var(--space-md);
  }
  
  .apple-navbar .nav-links {
    position: fixed;
    top: 44px;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  }
  
  .apple-navbar .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .apple-navbar .menu-toggle {
    display: block;
  }
  
  .apple-navbar .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .apple-navbar .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .apple-navbar .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
}

/* ===== HERO SECTION APPLE ===== */
.apple-hero {
  padding: calc(44px + var(--space-3xl)) var(--space-lg) var(--space-3xl);
  text-align: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.apple-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(0, 122, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.apple-hero .hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.apple-hero .hero-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--apple-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.apple-hero .hero-subtitle {
  font-size: 22px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.4;
}

.apple-hero .hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--apple-green);
  color: var(--text-white);
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: var(--space-lg);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ===== FILTROS APPLE ===== */
.apple-filters {
  background: transparent; /* Remove o fundo */
  border-radius: 0;
  padding: var(--space-lg) 0;
  margin: var(--space-lg) auto;
  max-width: 800px; /* Centraliza com largura máxima */
  box-shadow: none; /* Remove a sombra */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.apple-filters .filter-form {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: center; /* Centraliza os elementos */
  flex-wrap: wrap;
}

.apple-filters .filter-input {
  flex: 1;
  min-width: 200px;
  max-width: 300px; /* Limita a largura máxima */
  padding: 14px 18px;
  border: 2px solid var(--text-tertiary); /* Borda mais visível */
  border-radius: var(--radius-medium);
  font-size: 16px;
  font-weight: 500; /* Texto mais destacado */
  background: var(--bg-primary);
  color: var(--text-primary); /* Texto mais contrastante */
  transition: all var(--transition-fast);
}

.apple-filters .filter-input::placeholder {
  color: var(--text-secondary);
  font-weight: 400;
}

.apple-filters .filter-input:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
  color: var(--text-primary);
}

.apple-filters .filter-select {
  padding: 14px 18px;
  border: 2px solid var(--text-tertiary); /* Borda mais visível */
  border-radius: var(--radius-medium);
  font-size: 16px;
  font-weight: 500; /* Texto mais destacado */
  background: var(--bg-primary);
  color: var(--text-primary); /* Texto mais contrastante */
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 180px;
}

.apple-filters .filter-select:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.apple-filters .filter-select option {
  color: var(--text-primary);
  background: var(--bg-primary);
  font-weight: 500;
}

.filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--apple-red);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600; /* Texto mais destacado */
  transition: all var(--transition-fast);
  margin-left: var(--space-sm);
}

.filter-clear:hover {
  background: #d70015;
  transform: scale(1.1);
}

/* Responsividade */
@media (max-width: 768px) {
  .apple-filters {
    padding: var(--space-md) var(--space-md);
  }
  
  .apple-filters .filter-form {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .apple-filters .filter-input,
  .apple-filters .filter-select {
    width: 100%;
    max-width: none;
  }
}

/* ===== BOTÕES APPLE ===== */
.apple-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-medium);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.apple-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.apple-button:hover::before {
  left: 100%;
}

.apple-button.primary {
  background: var(--apple-blue);
  color: var(--text-white);
}

.apple-button.primary:hover {
  background: var(--apple-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.apple-button.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.apple-button.secondary:hover {
  background: var(--apple-gray-light);
  transform: translateY(-1px);
}

.apple-button.success {
  background: var(--apple-green);
  color: var(--text-white);
}

.apple-button.success:hover {
  background: #28A745;
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* ===== CARDS APPLE ===== */
.apple-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.apple-product-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
  position: relative;
}

.apple-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-large);
}

.apple-product-card .card-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
}

.apple-product-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.apple-product-card:hover .card-image img {
  transform: scale(1.05);
}

.apple-product-card .card-content {
  padding: var(--space-lg);
}

.apple-product-card .card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.apple-product-card .card-category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.apple-product-card .card-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.4;
}

.apple-product-card .card-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.apple-product-card .price-current {
  font-size: 24px;
  font-weight: 700;
  color: var(--apple-blue);
}

.apple-product-card .price-original {
  font-size: 16px;
  color: var(--text-secondary);
  text-decoration: line-through;
}

.apple-product-card .price-discount {
  padding: 2px 8px;
  background: var(--apple-green);
  color: var(--text-white);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.apple-product-card .card-action {
  width: 100%;
}

/* ===== PAGINAÇÃO APPLE ===== */
.apple-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-3xl) var(--space-lg);
}

.apple-pagination .page-button {
  padding: 8px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-medium);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.apple-pagination .page-button:hover {
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

.apple-pagination .page-button.active {
  background: var(--apple-blue);
  color: var(--text-white);
  border-color: var(--apple-blue);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .apple-hero {
    padding: calc(44px + var(--space-xl)) var(--space-md) var(--space-xl);
  }
  
  .apple-filters {
    margin: var(--space-lg) var(--space-md);
    padding: var(--space-md);
  }
  
  .apple-filters .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .apple-filters .filter-input {
    min-width: auto;
  }
  
  .apple-products-grid {
    grid-template-columns: 1fr;
    padding: var(--space-md);
    gap: var(--space-md);
  }
  
  .apple-pagination {
    margin: var(--space-xl) var(--space-md);
    flex-wrap: wrap;
  }
}

/* ===== ANIMAÇÕES E EFEITOS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.stagger-children > * {
  animation: fadeInUp 0.6s ease-out;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --bg-glass: rgba(28, 28, 30, 0.8);
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-tertiary: #48484A;
  }
  
  .apple-navbar {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  
  .apple-filters .filter-input,
  .apple-filters .filter-select {
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .apple-pagination .page-button {
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* ===== FILTROS DISCRETOS ===== */
.apple-filters--subtle {
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: var(--space-md);
  margin: var(--space-md) var(--space-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.filter-form--compact {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: center;
}

.filter-group {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  border-radius: 25px;
  padding: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-input--subtle {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 15px;
  min-width: 180px;
  border-radius: 20px;
}

.filter-input--subtle:focus {
  outline: none;
  background: rgba(0, 122, 255, 0.05);
}

.filter-select--subtle {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 15px;
  border-radius: 20px;
  cursor: pointer;
}

.apple-button--subtle {
  background: var(--apple-blue);
  color: white;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 20px;
  opacity: 0.9;
}

.apple-button--subtle:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.filter-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 50%;
  text-decoration: none;
  font-size: 12px;
  transition: all 0.2s ease;
}

.filter-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

/* ===== RESPONSIVIDADE FILTROS DISCRETOS ===== */
@media (max-width: 768px) {
  .apple-filters--subtle {
    margin: var(--space-sm);
    padding: var(--space-sm);
  }
  
  .filter-group {
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-sm);
  }
  
  .filter-input--subtle {
    min-width: 100%;
  }
}