/* ================================================
   OTICAS ALAMANDA - Design System
   Cor Primaria: Marsala #9b1c47
   Estilo: Minimalista Premium
   ================================================ */

:root {
  /* Brand - Marsala */
  --primary: #9b1c47;
  --primary-light: #b8365e;
  --primary-dark: #7a1538;
  --primary-subtle: rgba(155, 28, 71, 0.06);
  --primary-hover: rgba(155, 28, 71, 0.08);
  --primary-ring: rgba(155, 28, 71, 0.12);

  /* Neutrals */
  --text: #1a1a1a;
  --text-secondary: #525252;
  --muted: #737373;
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --divider: #f5f5f5;

  /* Semantic */
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;

  /* Shadows (layered for premium depth) */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.06), 0 4px 10px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.04);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Typography */
  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ================================================
   ACESSIBILIDADE
   ================================================ */

/* Skip link: pula para conteudo principal (visivel ao Tab) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom-right-radius: var(--radius-sm);
  transform: translateY(-100%);
  transition: transform var(--duration-fast);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #fff;
  outline-offset: -3px;
}

/* Focus visivel consistente para teclado */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Respeitar reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen-reader only (visualmente oculto, mas acessivel) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================================================
   ICONES - Sistema minimalista (Feather-style)
   ================================================ */
/* Todos os SVGs do site herdam linecap/linejoin round */
svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg[stroke] {
  vector-effect: non-scaling-stroke;
}

/* ================================================
   RESET & BASE
   ================================================ */
* { box-sizing: border-box; margin: 0; padding: 0 }
html, body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container { max-width: 1240px; margin: 0 auto; padding: 0 var(--space-lg) }
a { text-decoration: none; color: inherit; transition: color var(--duration-fast) var(--ease-out) }
img { display: block; max-width: 100% }
button { cursor: pointer; font-family: inherit; border: none; background: none }
input, select, textarea { font-family: inherit }

/* ================================================
   HEADER - Minimalista Premium
   ================================================ */
.ec-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.ec-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  max-width: 1240px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px }
.brand img { height: 34px }
.brand span {
  font-weight: 400;
  letter-spacing: 0.16em;
  font-size: 14px;
  color: var(--text-secondary);
}
.nav { display: flex; align-items: center; gap: 8px }
.nav > a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}
.nav > a:hover { color: var(--text); background: var(--primary-subtle) }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  margin-left: 4px;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */
.page-title {
  font-weight: 300;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.2;
}
.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
  margin: 0;
}
.section-title {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ================================================
   BREADCRUMB
   ================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); transition: color var(--duration-fast) }
.breadcrumb a:hover { color: var(--primary) }
.breadcrumb .separator { color: var(--border); font-size: 11px }
.breadcrumb .current { color: var(--text-secondary); font-weight: 500 }

/* ================================================
   BUTTONS
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: all var(--duration-fast) var(--ease-out);
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { box-shadow: var(--shadow-sm); border-color: var(--border) }
.btn.primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}
.btn.primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md) }
.btn.outline-primary {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn.outline-primary:hover { background: var(--primary-subtle) }
.btn.full { width: 100% }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px }
.btn.lg { height: 50px; padding: 0 28px; font-size: 15px }
.btn:disabled, .btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ================================================
   INPUTS & FORMS
   ================================================ */
.input, .form-input {
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-elevated);
  width: 100%;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.input:focus, .form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.input::placeholder { color: var(--muted) }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5 }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group { display: flex; flex-direction: column; gap: 4px }
.form-error { font-size: 12px; color: var(--error); margin-top: 4px }

select, .search {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 32px 0 12px;
  width: 100%;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-elevated) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23737373' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
select:focus, .search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239b1c47' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* ================================================
   PRODUCT GRID
   ================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 20px;
}
@media(min-width:640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media(min-width:1024px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)) } }

/* ================================================
   PRODUCT CARDS - Premium
   ================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-out), border-color var(--duration-normal);
  box-shadow: var(--shadow-xs);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}
.card .thumb {
  aspect-ratio: 4 / 5;
  background: #f7f7f7;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}
.card .thumb img {
  width: 100%;
  height: 100%;
  /* contain: mostra a IMAGEM INTEIRA sem cortar (fiel ao upload do admin) */
  object-fit: contain;
  transition: transform var(--duration-slow) var(--ease-out);
}
.card:hover .thumb img { transform: scale(1.04) }
.card .body { padding: 18px 20px }
.brand-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 500;
}
.product-name {
  margin: 6px 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price { color: var(--text); font-weight: 600; font-size: 18px }
.compare {
  color: var(--muted);
  font-size: 13px;
  text-decoration: line-through;
  font-weight: 400;
}
.card .actions { display: flex; gap: 10px; margin-top: 14px }

/* Discount pill */
.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: var(--error-bg);
  color: var(--error);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Favorite / icon button */
.icon-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.92);
  display: grid;
  place-items: center;
  transition: all var(--duration-fast) var(--ease-out);
  backdrop-filter: blur(8px);
  z-index: 3;
}
.icon-btn:hover {
  background: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover svg { stroke: var(--primary) }
.icon-btn svg { width: 16px; height: 16px; transition: stroke var(--duration-fast) }

/* Product tag badges */
.product-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  background: var(--divider);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* ================================================
   PDP - Product Detail Page
   ================================================ */
.pdp { display: grid; gap: 48px }
@media(min-width:1024px) { .pdp { grid-template-columns: 1.1fr 0.9fr } }
.hero { border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden }
.thumbs { display: flex; gap: 10px; margin-top: 12px }
.thumbs button {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
  background: #fff;
  width: 72px;
  height: 72px;
  transition: border-color var(--duration-fast);
  cursor: pointer;
}
.thumbs button.active, .thumbs button:hover { border-color: var(--primary) }
.thumbs button img { width: 100%; height: 100%; object-fit: cover }

/* Quantity selector */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden }
.qty button {
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--bg-elevated);
  font-size: 18px;
  color: var(--text-secondary);
  transition: background var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty button:hover { background: var(--divider) }
.qty input { width: 52px; text-align: center; height: 42px; border: 0; font-size: 15px; font-weight: 500 }
.feature { color: var(--text-secondary); font-size: 14px; line-height: 1.7 }

/* Trust badges */
.trust-badges {
  display: flex;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--border-light);
  margin-top: 24px;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.trust-badge svg { color: var(--primary); flex-shrink: 0 }

/* Specs table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}
.specs-table tr { border-bottom: 1px solid var(--border-light) }
.specs-table tr:last-child { border-bottom: none }
.specs-table td { padding: 10px 0; font-size: 14px }
.specs-table td:first-child { color: var(--muted); width: 40%; font-weight: 500 }
.specs-table td:last-child { color: var(--text) }

/* ================================================
   CART
   ================================================ */
.cart-layout {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media(min-width:1024px) {
  .cart-layout { grid-template-columns: 1fr 380px }
}
.cart-list { display: flex; flex-direction: column; gap: 12px }
.cart-row {
  display: flex;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg-elevated);
  transition: box-shadow var(--duration-fast);
}
.cart-row:hover { box-shadow: var(--shadow-xs) }
.cart-row img {
  width: 100px !important;
  height: 84px !important;
  object-fit: contain !important;
  border-radius: var(--radius-sm);
  background: #f7f7f7;
  padding: 4px;
  box-sizing: border-box;
}

/* ================================================
   ORDER SUMMARY
   ================================================ */
.summary {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xs);
}
.summary .line {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  font-size: 14px;
  color: var(--text-secondary);
}
.summary .total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

/* ================================================
   CHECKOUT
   ================================================ */
.panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xs);
}
.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.grid-2 { display: grid; gap: 14px }
@media(min-width:768px) { .grid-2 { grid-template-columns: repeat(2, 1fr) } }
.grid-3 { display: grid; gap: 14px }
@media(min-width:768px) { .grid-3 { grid-template-columns: repeat(3, 1fr) } }

/* Checkout steps */
.checkout-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0;
}
.checkout-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  position: relative;
}
.checkout-step::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}
.checkout-step:last-child::after { display: none }
.step-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--divider);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-normal);
}
.checkout-step.active .step-number {
  background: var(--primary);
  color: #fff;
}
.checkout-step.completed .step-number {
  background: var(--success);
  color: #fff;
}
.step-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.checkout-step.active .step-label { color: var(--text) }
.checkout-step.completed .step-label { color: var(--success) }

/* Radio cards */
.radio-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
  background: var(--bg-elevated);
}
.radio-card:hover { border-color: var(--primary-light); background: var(--primary-subtle) }
.radio-card.selected { border-color: var(--primary); background: var(--primary-subtle) }
.radio-card input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; flex-shrink: 0 }
.radio-card-title { font-size: 14px; font-weight: 500; color: var(--text) }
.radio-card-desc { font-size: 13px; color: var(--muted); margin-top: 2px }

/* ================================================
   CATALOG LAYOUT
   ================================================ */
.catalog { display: grid; gap: 28px; grid-template-columns: 1fr }
@media(min-width:1024px) { .catalog { grid-template-columns: 260px 1fr } }

/* Filters sidebar */
.filters { position: sticky; top: 80px; align-self: start }
.filters .section { border-bottom: 1px solid var(--border-light); padding: 16px 0 }
.filters .section:first-child { padding-top: 0 }
.filters .title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  font-weight: 600;
}

/* Active filters chips */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--primary-ring);
}
.filter-chip button {
  display: flex;
  align-items: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  line-height: 1;
  color: var(--primary);
  transition: background var(--duration-fast);
}
.filter-chip button:hover { background: var(--primary-ring) }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ================================================
   STATUS BADGES
   ================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status-pending { background: #fef3c7; color: #92400e }
.status-confirmed { background: #dbeafe; color: #1e40af }
.status-processing { background: #ede9fe; color: #5b21b6 }
.status-shipped { background: #cffafe; color: #155e75 }
.status-delivered { background: #dcfce7; color: #166534 }
.status-cancelled { background: #fee2e2; color: #991b1b }

/* ================================================
   ORDER TIMELINE
   ================================================ */
.order-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 0;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}
.timeline-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(-50% + 14px);
  right: calc(50% + 14px);
  height: 2px;
  background: var(--border);
}
.timeline-step:first-child::before { display: none }
.timeline-step.active::before, .timeline-step.completed::before { background: var(--primary) }
.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.timeline-step.active .timeline-dot { background: var(--primary); color: #fff }
.timeline-step.completed .timeline-dot { background: var(--success); color: #fff }
.timeline-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
}
.timeline-step.active .timeline-label { color: var(--primary); font-weight: 600 }
.timeline-step.completed .timeline-label { color: var(--success) }

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 100000; /* Acima de modais (z 9999) e overlays */
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
#toast-container > * { pointer-events: auto }

/* SweetAlert2 sempre por cima do modal de produto */
.swal2-container { z-index: 100001 !important }
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  min-width: 280px;
  max-width: 400px;
  font-size: 14px;
  opacity: 0;
  transform: translateX(20px);
  transition: all var(--duration-normal) var(--ease-out);
}
.toast.show { opacity: 1; transform: translateX(0) }
.toast-success { border-left-color: var(--success) }
.toast-error { border-left-color: var(--error) }
.toast-warning { border-left-color: var(--warning) }
.toast-info { border-left-color: var(--primary) }

/* Loading overlay */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.loading-text { color: #fff; font-size: 15px; font-weight: 500 }

/* ================================================
   TABS
   ================================================ */
.tab {
  flex: 1;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--duration-fast);
  font-weight: 500;
  font-size: 14px;
}
.tab:hover { color: var(--text) }
.tab.active { color: var(--primary); border-bottom-color: var(--primary) }

/* ================================================
   FOOTER - Professional
   ================================================ */
.ec-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-3xl);
  padding: var(--space-3xl) 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 48px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
@media(max-width:768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px }
}
.footer-brand { display: flex; flex-direction: column; gap: 16px }
/* Defensiva: constraint dura em qualquer img dentro do footer-brand para evitar render
   em tamanho nativo caso uma versao antiga do CSS esteja em cache */
.footer-brand img { max-height: 48px; max-width: 200px; width: auto; height: auto; display: block }
.footer-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  width: fit-content;
}
.footer-brand-mark img {
  height: 44px;
  max-height: 44px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  display: block;
}
.footer-brand-mark span {
  font-weight: 400;
  letter-spacing: 0.18em;
  font-size: 13px;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
}
.footer-brand p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; max-width: 320px; margin: 0 }
.footer-heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 16px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px }
.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}
.footer-links a:hover { color: var(--primary) }
.footer-contact { display: flex; flex-direction: column; gap: 10px }
.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.footer-contact-item svg { color: var(--primary); flex-shrink: 0; width: 16px; height: 16px }
.footer-bottom {
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-2xl);
  padding: var(--space-lg) 0;
  text-align: center;
}
.footer-bottom p { font-size: 13px; color: var(--muted); max-width: 1240px; margin: 0 auto; padding: 0 var(--space-lg) }

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px) }
  to { opacity: 1; transform: translateY(0) }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) }
  to { opacity: 1; transform: translateY(0) }
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0 }
  to { transform: translateX(0); opacity: 1 }
}
.fade-in { animation: fadeIn var(--duration-slow) var(--ease-out) both }
.slide-up { animation: slideUp var(--duration-slow) var(--ease-out) both }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--divider) 25%, var(--border-light) 50%, var(--divider) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0 } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================
   UTILITIES
   ================================================ */
.text-primary { color: var(--primary) }
.text-muted { color: var(--muted) }
.text-success { color: var(--success) }
.text-error { color: var(--error) }
.bg-primary-subtle { background: var(--primary-subtle) }
.gap-sm { gap: var(--space-sm) }
.gap-md { gap: var(--space-md) }
.gap-lg { gap: var(--space-lg) }
.mt-sm { margin-top: var(--space-sm) }
.mt-md { margin-top: var(--space-md) }
.mt-lg { margin-top: var(--space-lg) }
.mb-sm { margin-bottom: var(--space-sm) }
.mb-md { margin-bottom: var(--space-md) }
.mb-lg { margin-bottom: var(--space-lg) }

/* ================================================
   MOBILE BOTTOM NAV
   ================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  z-index: 50;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
@media(max-width:768px) {
  .mobile-nav { display: flex }
  body { padding-bottom: 72px }
}

/* ============================
   MOBILE HEADER FIX
============================ */
@media (max-width: 768px) {
  .ec-header .inner {
    padding: 12px 16px;
    gap: 8px;
  }
  /* Esconde o texto "ÓTICAS ALAMANDA" no mobile (mantem soh a logo) */
  .brand span { display: none }
  .brand img { height: 36px }

  /* Nav: compacta os links e prioriza icones */
  .nav { gap: 4px; align-items: center }
  .nav > a {
    padding: 6px 8px;
    font-size: 12px;
  }
  /* Esconde texto de coleção/sobre/localização no mobile -- abre espaço pro login */
  .nav > a[href*="colecao"],
  .nav > a[href*="#sobre"],
  .nav > a[href*="#localizacao"] {
    display: none;
  }
  /* User menu (login/perfil) - garante visibilidade */
  #userMenu, #adminUserMenu {
    flex-shrink: 0;
  }
  /* Carrinho icone-only no mobile */
  #cartLink span,
  .nav a[id="cartLink"] span {
    display: none;
  }
}

/* Telas muito pequenas (~iPhone SE) */
@media (max-width: 380px) {
  .ec-header .inner { padding: 10px 12px }
  .brand img { height: 32px }
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--duration-fast);
}
.mobile-nav-item.active { color: var(--primary) }
.mobile-nav-item svg { width: 22px; height: 22px }
