/* =============================================
   DESAPEGA — Design System
   Inspirado no Magazine Luiza + OLX
   ============================================= */

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

/* === TOKENS === */
:root {
  /* Cores Primárias */
  --primary:       #0086FF;
  --primary-dark:  #005BB5;
  --primary-light: #E8F3FF;
  --accent:        #FF6500;
  --accent-dark:   #D95200;
  --accent-light:  #FFF0E8;

  /* Cores de Status */
  --success: #08A022;
  --success-light: #DEF7E2;
  --warning: #F8BF1B;
  --warning-light: #FFFDF0;
  --danger:  #D30D31;
  --danger-light: #FFF6F7;

  /* Superfícies */
  --bg:           #F0F3F4;
  --surface:      #FFFFFF;
  --surface-2:    #F7F9FA;
  --border:       #E3E8EA;
  --border-light: #F0F3F4;

  /* Texto */
  --text-primary:   #1E2428;
  --text-secondary: #697277;
  --text-muted:     #949EA2;
  --text-inverse:   #FFFFFF;

  /* Admin Sidebar */
  --admin-bg:      #0F172A;
  --admin-sidebar: #1E293B;
  --admin-accent:  #3B82F6;

  /* Tipografia */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

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

  /* Bordas */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.20);
  --shadow-primary: 0 8px 25px rgba(0,134,255,0.30);
  --shadow-accent:  0 8px 25px rgba(255,101,0,0.30);

  /* Transições */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }

/* === UTILITÁRIOS === */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-new     { background: var(--success-light); color: var(--success); }
.badge-used    { background: var(--warning-light); color: #997800; }
.badge-semi    { background: var(--primary-light); color: var(--primary-dark); }
.badge-active  { background: var(--success-light); color: var(--success); }
.badge-inactive{ background: var(--danger-light); color: var(--danger); }

/* =============================================
   HEADER — LOJA PÚBLICA
   ============================================= */
.store-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.header-top {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: white;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(10px);
}

.header-logo .logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-logo .logo-sub {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.8;
  display: block;
  line-height: 1;
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 var(--space-md);
  gap: var(--space-sm);
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: #FF6500;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  padding: 12px 0;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar .search-icon {
  color: var(--text-muted);
  font-size: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.btn-whatsapp {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: #25D366;
  color: white;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37,211,102,0.35);
}

.btn-whatsapp:hover {
  background: #1EBE57;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,211,102,0.45);
}

.btn-whatsapp svg { width: 18px; height: 18px; }

/* === DEPARTMENT TABS === */
.dept-tabs {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.dept-tabs-inner {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
}

.dept-tabs-inner::-webkit-scrollbar { display: none; }

.dept-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  border: none;
  flex-shrink: 0;
}

.dept-tab:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.dept-tab.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
}

.dept-tab .tab-icon { font-size: 15px; }

/* =============================================
   HERO BANNER
   ============================================= */
.hero-banner {
  padding: var(--space-xl) 0;
  position: relative;
}

.hero-content {
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  color: white;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-content::after {
  content: '';
  position: absolute;
  right: -5%;
  bottom: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.hero-content h1 {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 1;
}

.hero-content p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: white;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-accent);
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* =============================================
   PRODUCT GRID
   ============================================= */
.section {
  padding: var(--space-xl) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title::after {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: var(--radius-full);
  margin-left: 4px;
}

.product-count {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--border-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-md);
}

/* === PRODUCT CARD === */
.product-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: none;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
}

.product-card-image {
  position: relative;
  width: 100%;
  padding-top: 75%;
  overflow: hidden;
  background: var(--surface-2);
}

.product-card-image img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.product-card-image .no-image {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--text-muted);
  background: var(--surface-2);
}

.card-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 1;
}

.card-dept-tag {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.product-card-body {
  padding: var(--space-md);
}

.product-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.product-card-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.product-card-price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}

.btn-see-more {
  flex: 1;
  background: var(--success);
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
}

.btn-see-more:hover {
  background: #06801B;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: var(--space-md);
  display: block;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

/* === SKELETON LOADING === */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =============================================
   PÁGINA DE PRODUTO
   ============================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-secondary);
  padding: var(--space-md) 0;
  flex-wrap: wrap;
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-muted); }

.product-page {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
}

/* Gallery */
.product-gallery {
  position: sticky;
  top: 90px;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: var(--space-md);
  border: 1.5px solid var(--border);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-main img:hover { transform: scale(1.02); }

.gallery-thumbs {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.gallery-thumb:hover, .gallery-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Info */
.product-info-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.product-dept-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.product-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: var(--space-md);
}

.product-price-block {
  background: var(--accent-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border: 1.5px solid rgba(255,101,0,0.15);
}

.product-price {
  font-size: 36px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.product-price-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-2);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.product-desc-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.product-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.btn-contact-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  background: #25D366;
  color: white;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  transition: var(--transition);
  margin-top: var(--space-lg);
  box-shadow: 0 6px 20px rgba(37,211,102,0.35);
  text-decoration: none;
}

.btn-contact-whatsapp:hover {
  background: #1EBE57;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37,211,102,0.45);
}

/* Related Products */
.related-section {
  padding: var(--space-xl) 0 var(--space-2xl);
}

/* =============================================
   FOOTER
   ============================================= */
.store-footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.7);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-2xl);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo-text {
  font-size: 24px;
  font-weight: 900;
  color: white;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-brand p {
  margin-top: var(--space-sm);
  font-size: 13px;
  line-height: 1.6;
}

.footer-contact h4 {
  color: white;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.footer-admin-link {
  color: rgba(255,255,255,0.3);
  transition: var(--transition);
  font-size: 11px;
}

.footer-admin-link:hover { color: rgba(255,255,255,0.7); }

/* =============================================
   ADMIN — LAYOUT
   ============================================= */
.admin-body {
  background: var(--admin-bg);
  min-height: 100vh;
  display: flex;
}

.admin-sidebar {
  width: 240px;
  background: var(--admin-sidebar);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo .logo {
  font-size: 20px;
  font-weight: 900;
  color: white;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-logo .logo-badge {
  font-size: 10px;
  background: var(--admin-accent);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) 0;
}

.sidebar-section {
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: var(--space-sm) var(--space-sm);
  margin-bottom: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.sidebar-link .link-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}

.sidebar-link.active {
  background: var(--admin-accent);
  color: white;
}

.sidebar-link.active .link-icon {
  background: rgba(255,255,255,0.2);
}

.sidebar-footer {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.07);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  background: none;
  border: none;
  cursor: pointer;
}

.btn-logout:hover {
  background: rgba(211,13,49,0.2);
  color: #FF6B80;
}

/* Admin Main Content */
.admin-main {
  margin-left: 240px;
  flex: 1;
  background: #F1F5F9;
  min-height: 100vh;
}

.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-xl);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-xs);
}

/* Botão de menu: só aparece no mobile, onde a sidebar sai da tela */
.admin-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  margin-right: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.admin-menu-btn:hover { background: var(--surface-2); }

/* Fundo escuro atrás da sidebar aberta; fechar é tocar fora */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: calc(var(--z-modal) - 1);
}

.topbar-title { margin-right: auto; }

.topbar-title h2 {
  font-size: 18px;
  font-weight: 800;
}

.topbar-title p {
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-content {
  padding: var(--space-xl);
}

/* === ADMIN CARDS/STATS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-xs);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue  { background: var(--primary-light); }
.stat-icon.orange{ background: var(--accent-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.purple{ background: #F0E8FF; }

.stat-value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* === ADMIN TABLES === */
.table-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1.5px solid var(--border);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.table-header h3 {
  font-size: 15px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--surface-2);
}

thead th {
  padding: 12px var(--space-xl);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 14px var(--space-xl);
  font-size: 13px;
  vertical-align: middle;
}

.product-thumb-cell {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

.product-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.product-name-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.product-name-cell small {
  font-size: 11px;
  color: var(--text-secondary);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(0,134,255,0.25);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary);
}

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-accent);
}
.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #B01636; transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--border-light); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-icon { padding: 8px; border-radius: var(--radius-md); }

.action-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* === TOGGLE SWITCH === */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

input:checked + .toggle-slider { background: var(--success); }
input:checked + .toggle-slider::before { transform: translateX(18px); }

/* === FORMS === */
.form-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1.5px solid var(--border);
  overflow: hidden;
}

.form-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.form-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.form-body {
  padding: var(--space-xl);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: white;
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
}

/* === IMAGE UPLOAD === */
.image-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
}

.image-upload-zone:hover, .image-upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.image-upload-zone .upload-icon { font-size: 36px; margin-bottom: var(--space-sm); }
.image-upload-zone p { font-size: 13px; color: var(--text-secondary); }
.image-upload-zone strong { color: var(--primary); }

.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.image-preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-item.primary {
  border-color: var(--primary);
}

.image-preview-item .remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.image-preview-item .remove-image:hover { background: var(--danger); }

.image-preview-item .primary-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: var(--primary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--danger);
}

.modal-body { padding: var(--space-xl); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  animation: toast-in 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon { font-size: 18px; }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* === ADMIN LOGIN === */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.login-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-logo .icon {
  font-size: 48px;
  display: block;
  margin-bottom: var(--space-md);
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 900;
  color: white;
}

.login-logo p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

.login-card label {
  color: rgba(255,255,255,0.6);
}

.login-card .form-control {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
  color: white;
}

.login-card .form-control:focus {
  border-color: var(--admin-accent);
  background: rgba(255,255,255,0.12);
}

.login-card .form-control::placeholder { color: rgba(255,255,255,0.3); }

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--admin-accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: var(--space-lg);
  box-shadow: 0 6px 20px rgba(59,130,246,0.35);
}

.btn-login:hover {
  background: #2563EB;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(59,130,246,0.45);
}

.login-error {
  background: rgba(211,13,49,0.15);
  border: 1px solid rgba(211,13,49,0.3);
  color: #FF6B80;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 13px;
  text-align: center;
  margin-top: var(--space-md);
}

/* === DEPT COLOR PICKER === */
.color-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.color-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition);
}

.color-option:hover, .color-option.selected {
  border-color: var(--text-primary);
  transform: scale(1.15);
}

/* === DEPT CARD (public) === */
.dept-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.dept-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.dept-card:hover, .dept-card.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dept-card .icon { font-size: 32px; margin-bottom: var(--space-sm); display: block; }
.dept-card .name { font-size: 13px; font-weight: 600; }

/* =============================================
   RESPONSIVO
   ============================================= */
@media (max-width: 1024px) {
  .product-page {
    grid-template-columns: 1fr;
  }
  .product-gallery {
    position: static;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .header-logo .logo-sub { display: none; }

  .search-bar { order: 3; width: 100%; }

  .admin-menu-btn { display: inline-flex; }

  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    z-index: var(--z-modal);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .admin-main { margin-left: 0; }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .footer-top { grid-template-columns: 1fr; }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .hero-content h1 { font-size: 24px; }

  thead { display: none; }
  tbody tr { display: block; padding: var(--space-md) var(--space-xl); }
  tbody td { display: block; padding: 4px 0; border: none; }
  tbody td:before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
}

/* === ANIMATIONS === */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fade-in 0.3s ease forwards; }

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

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* Price formatting */
.price-currency { font-size: 0.55em; vertical-align: super; margin-right: 2px; }
