/**
 * CUBIKO 3D — Estilos do E-commerce (Loja)
 * ══════════════════════════════════════════════════════════════
 * Tema: Titanium Dark Tech (Alta tecnologia, seriedade industrial)
 */

:root {
  --bg-primary: #0a0b0d;
  --bg-surface: #111317;
  --bg-surface-hover: #171a21;
  --border-cad: rgba(255, 255, 255, 0.07);
  --border-cad-active: rgba(0, 240, 168, 0.35);
  
  --accent-emerald: #00f0a8;
  --accent-emerald-hover: #33ffc4;
  --accent-emerald-dark: #008f64;
  --accent-emerald-bg: rgba(0, 240, 168, 0.08);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #001b0a;
  
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

/* Base styling */
body.loja-body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container-loja {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 2rem 0;
}

/* Header */
.loja-header {
  border-bottom: 1px solid var(--border-cad);
  background-color: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-main);
  font-size: 1.25rem;
}

.logo-icon {
  stroke: var(--accent-emerald);
}

.logo-text-accent {
  color: var(--accent-emerald);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.header-nav-link:hover,
.header-nav-link.active {
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-client-portal {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-cad);
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-client-portal:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--text-muted);
}

/* Layout Grid */
.loja-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.loja-grid > section {
  min-width: 0;
  width: 100%;
}

/* Sidebar / Filters */
.loja-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-cad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-cad);
  border-radius: 12px;
  padding: 1.25rem;
}

.filter-group-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 0.85rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.filter-item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.filter-item-link:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.02);
}

.filter-item-link.active {
  color: var(--text-dark);
  background-color: var(--accent-emerald);
  font-weight: 700;
}

.filter-item-link.active .filter-count {
  background-color: rgba(0, 0, 0, 0.15);
  color: var(--text-dark);
}

.filter-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Toolbar */
.catalog-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-cad);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
  min-width: 240px;
}

.search-input {
  width: 100%;
  box-sizing: border-box;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-cad);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px var(--accent-emerald-bg);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-select {
  background-color: var(--bg-primary);
  color: var(--text-main);
  border: 1px solid var(--border-cad);
  border-radius: 8px;
  padding: 0.6rem 2rem 0.6rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent-emerald);
}

/* Active filters list */
.active-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.active-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--accent-emerald-bg);
  border: 1px solid rgba(0, 240, 168, 0.15);
  color: var(--accent-emerald);
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-weight: 500;
}

.active-filter-remove {
  border: none;
  background: transparent;
  color: var(--accent-emerald);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

.active-filter-remove:hover {
  color: var(--text-main);
}

.btn-clear-filters {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
}

.btn-clear-filters:hover {
  color: var(--text-main);
}

/* Product Grid */
.products-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.no-products {
  grid-column: 1 / -1;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-cad);
  border-radius: 12px;
  padding: 3.5rem;
  text-align: center;
  color: var(--text-muted);
}

.no-products-icon {
  margin-bottom: 1rem;
  color: var(--border-cad-active);
}

/* Product Card */
.loja-product-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-cad);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s, box-shadow 0.25s;
  position: relative;
}

.loja-product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-cad-active);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.product-img-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.85;
  background-color: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid var(--border-cad);
  display: grid;
  place-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

.product-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
  transition: transform 0.3s;
}

.loja-product-card:hover .product-img {
  transform: scale(1.04);
}

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

.badge-featured {
  background-color: var(--accent-emerald);
  color: var(--text-dark);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.badge-bestseller {
  background-color: #3b82f6;
  color: var(--text-main);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.product-content {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-cat-tag {
  font-size: 0.75rem;
  color: var(--accent-emerald);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.product-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text-main);
  line-height: 1.3;
}

/* Technical Meta table */
.product-specs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-cad);
  padding-top: 0.75rem;
}

.spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spec-val {
  color: var(--text-main);
  font-weight: 600;
}

.product-card-footer {
  margin-top: auto;
}

.btn-request-quote {
  width: 100%;
  background-color: var(--accent-emerald);
  color: var(--text-dark);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-request-quote:hover {
  background-color: var(--accent-emerald-hover);
}

.btn-request-quote:active {
  transform: scale(0.98);
}

/* Pager */
.loja-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-cad);
  border-radius: 12px;
  padding: 0.75rem;
}

.pager-btn {
  background-color: var(--bg-primary);
  color: var(--text-main);
  border: 1px solid var(--border-cad);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s, border-color 0.2s;
}

.pager-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--text-muted);
}

.pager-btn.active {
  background-color: var(--accent-emerald);
  color: var(--text-dark);
  border-color: var(--accent-emerald);
  font-weight: 700;
}

.pager-btn.disabled {
  color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
  .loja-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .loja-sidebar {
    display: none; /* Em mobile, faremos filtros integrados ou retráteis */
  }
  
  .loja-sidebar.mobile-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: var(--bg-primary);
    padding: 2rem 1.5rem;
    overflow-y: auto;
  }
  
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-wrapper {
    max-width: none;
  }
  
  .sort-wrapper {
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .header-nav {
    display: none; /* Menu sanduíche ou link simples no celular */
  }
  
  .products-grid-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  
  .loja-product-card {
    border-radius: 8px;
  }
  
  .product-content {
    padding: 0.75rem;
  }
  
  .product-title-text {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
  }
  
  .product-specs {
    font-size: 0.7rem;
    gap: 0.25rem;
    margin-bottom: 0.85rem;
  }
  
  .btn-request-quote {
    padding: 0.6rem 0.5rem;
    font-size: 0.78rem;
    border-radius: 6px;
  }
}

/* Chips de Filtros para Mobile */
.mobile-filters-chips {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-cad);
  border-radius: 12px;
  padding: 1rem;
}

.chips-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chips-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.chips-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips-scroll::-webkit-scrollbar {
  display: none;
}

.chip-link {
  display: inline-block;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-cad);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.chip-link:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

.chip-link.active {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: var(--text-dark);
  font-weight: 700;
}

@media (max-width: 900px) {
  .mobile-filters-chips {
    display: flex;
  }
}

/* Bottom Navigation Bar for Mobile */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(17, 19, 23, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-sizing: border-box;
  }
  
  .mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 0.2rem;
    flex: 1;
    height: 100%;
    transition: color 0.15s;
  }
  
  .mobile-bottom-nav .nav-item:active {
    opacity: 0.7;
  }
  
  .mobile-bottom-nav .nav-item.active {
    color: var(--accent-emerald);
  }
  
  .mobile-bottom-nav .nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
  }
  
  /* Ajuste de Espaçamento do Rodapé */
  body {
    padding-bottom: 70px !important;
  }
  
  /* Ocultar elementos redundantes de menu superior */
  .mobile-menu-btn,
  .header-actions,
  .header-nav,
  .whatsapp-float {
    display: none !important;
  }

  /* Cabeçalho Minimalista Tipo App */
  .header-wrapper {
    height: 56px !important;
    justify-content: center !important;
  }

  .loja-header .container-loja {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* WhatsApp Float */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.3);
  z-index: 1000;
  transition: transform 0.3s;
}
.whatsapp-float:hover {
  transform: scale(1.1);
}

