/* ============================================================================
   CTVA STORE (ctvastore.com.br) - TEMA DARK TATAME (PRETO, CHUMBO E DOURADO)
   Design Responsivo Mobile-First (Otimizado para tráfego do Instagram e Desktop)
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Oswald:wght@500;600;700&display=swap');

:root {
  --bg-tatame: #090b0f;
  --bg-surface: #12161f;
  --bg-card: #171c28;
  --bg-elevated: #1e2536;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(229, 169, 60, 0.4);

  --gold-primary: #e5a93c;
  --gold-bright: #f5c156;
  --gold-dark: #b8811d;
  --gold-glow: rgba(229, 169, 60, 0.16);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.14);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.14);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.14);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-tatame);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, .font-display {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

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

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

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ============================================================================
   TOPBAR & HEADER DA LOJA
   ============================================================================ */
.topbar {
  background: linear-gradient(90deg, #12161f 0%, #1c1810 50%, #12161f 100%);
  border-bottom: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 0.45rem 1rem;
  letter-spacing: 0.04em;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 11, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-crest {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #090b0f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 0 18px var(--gold-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.brand-title span {
  color: var(--gold-primary);
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ============================================================================
   BOTÕES E BADGES
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #090b0f;
  font-weight: 700;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 169, 60, 0.3);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--gold-primary);
  color: var(--gold-bright);
  background: var(--gold-glow);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.cart-trigger {
  position: relative;
}

.cart-badge {
  background: #090b0f;
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-gold {
  background: var(--gold-glow);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
}

.badge-success {
  background: var(--success-bg);
  color: #34d399;
}

.badge-warning {
  background: var(--warning-bg);
  color: #fbbf24;
}

.badge-danger {
  background: var(--danger-bg);
  color: #f87171;
}

.badge-info {
  background: var(--info-bg);
  color: #60a5fa;
}

/* ============================================================================
   HERO BANNER (TEXTURA DE TATAME)
   ============================================================================ */
.hero {
  position: relative;
  padding: 3.5rem 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(229, 169, 60, 0.14), transparent 45%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.012) 0px,
      rgba(255, 255, 255, 0.012) 2px,
      transparent 2px,
      transparent 8px
    ),
    linear-gradient(180deg, #0d1017 0%, var(--bg-tatame) 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.hero h1 span {
  color: var(--gold-primary);
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 580px;
  margin-bottom: 1.75rem;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.highlight-item strong {
  display: block;
  color: var(--gold-bright);
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
}

.highlight-item span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* ============================================================================
   FILTROS E CATÁLOGO DE PRODUTOS
   ============================================================================ */
.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.25rem 0 1.5rem;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-pill {
  padding: 0.5rem 1rem;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.category-pill:hover,
.category-pill.active {
  background: var(--gold-primary);
  color: #090b0f;
  border-color: var(--gold-primary);
}

.search-box {
  position: relative;
  min-width: 260px;
  flex: 1;
  max-width: 360px;
}

.input, .select, .textarea {
  width: 100%;
  padding: 0.68rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: var(--transition);
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-lg);
}

.product-img-wrap {
  position: relative;
  height: 250px;
  background: #0d1017;
  overflow: hidden;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

.product-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-primary);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.product-sizes-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.5rem 0 1rem;
}

.size-chip-mini {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.size-chip-mini.out {
  opacity: 0.35;
  text-decoration: line-through;
}

.product-price-box {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.price-old {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
  display: block;
}

.price-current {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1.1;
}

.price-pix-hint {
  font-size: 0.74rem;
  color: var(--success);
  font-weight: 600;
}

/* ============================================================================
   MODAIS E GAVETA DO CARRINHO
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn 0.2s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}

.modal-body {
  padding: 1.5rem;
}

.close-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
}

.close-btn:hover {
  color: var(--text-primary);
  border-color: var(--gold-primary);
}

/* Seletor de Tamanhos e Cores no Modal de Produto */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.75rem;
}

.selector-group {
  margin-bottom: 1.15rem;
}

.selector-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.option-pill {
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.option-pill:hover:not(:disabled) {
  border-color: var(--gold-primary);
}

.option-pill.selected {
  background: var(--gold-glow);
  border-color: var(--gold-primary);
  color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold-primary);
}

.option-pill:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ============================================================================
   PAINEL ADMINISTRATIVO (DASHBOARD, ESTOQUE, KARDEX, PEDIDOS, APIS)
   ============================================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 72px);
}

.admin-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.admin-nav-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.admin-nav-btn.active {
  background: var(--gold-glow);
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

.admin-main {
  padding: 1.75rem;
  overflow-x: auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
}

.kpi-card.gold {
  border-color: var(--border-gold);
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-family: 'Oswald', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.shipping-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.shipping-option.selected {
  border-color: var(--gold-primary);
  background: var(--gold-glow);
}

.pix-qr-box {
  background: #fff;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 1rem auto;
}

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-elevated);
  border-left: 4px solid var(--gold-primary);
  color: var(--text-primary);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
}

.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
  margin-top: 4rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

@media (max-width: 860px) {
  .hero-grid,
  .product-detail-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .admin-nav-btn {
    white-space: nowrap;
    width: auto;
  }
}

