/* ==========================================================================
   cn-catalog-v5.css — Dark E-Commerce Catalogue (Ubiquiti Network Store)
   Requires: cn-theme.css v16 (CSS variables loaded on page)
   All classes use cnx- prefix
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO
   -------------------------------------------------------------------------- */

.cnx-hero {
  text-align: center;
  padding: 50px 20px 20px;
}

.cnx-hero h1,
.cnx-hero .cnx-hero-title {
  background: linear-gradient(135deg, var(--cn-blue-light), var(--cn-blue-glow), var(--cn-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.cnx-hero p,
.cnx-hero .cnx-hero-sub {
  color: var(--cn-text-dim);
  font-size: 1rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   2. NAVIGATION BAR
   -------------------------------------------------------------------------- */

.cnx-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--cn-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cn-glass-border);
  padding: 14px 20px 0;
}

/* Domain Pills Row */
.cnx-nav-domains {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cnx-domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--cn-glass-border);
  background: transparent;
  color: var(--cn-text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.cnx-domain-pill::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cnx-domain-pill[data-domain="Reseau"]::before  { background: #0080ff; }
.cnx-domain-pill[data-domain="Proteger"]::before { background: #7c3aed; }
.cnx-domain-pill[data-domain="Acceder"]::before  { background: #0ea5e9; }

.cnx-domain-pill.active {
  background: var(--cn-blue-dim);
  border-color: var(--cn-blue);
  color: var(--cn-text);
}

.cnx-domain-pill[data-domain="Proteger"].active {
  background: rgba(124, 58, 237, 0.15);
  border-color: #7c3aed;
}

.cnx-domain-pill[data-domain="Acceder"].active {
  background: rgba(14, 165, 233, 0.15);
  border-color: #0ea5e9;
}

.cnx-domain-pill:hover:not(.active) {
  border-color: rgba(0, 128, 255, 0.3);
  color: var(--cn-text);
}

/* Subcategory Pills Row */
.cnx-nav-subcats {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding-top: 4px;
}

.cnx-nav-subcats.visible {
  display: flex;
}

.cnx-subcat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--cn-glass-border);
  background: transparent;
  color: var(--cn-text-dim);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.cnx-subcat-pill .cnx-subcat-count {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 1px 5px;
  color: var(--cn-text-dim);
}

.cnx-subcat-pill.active {
  background: var(--cn-blue-dim);
  border-color: var(--cn-blue);
  color: var(--cn-text);
}

.cnx-subcat-pill.active .cnx-subcat-count {
  background: rgba(0, 128, 255, 0.2);
  color: var(--cn-blue-light);
}

.cnx-subcat-pill:hover:not(.active) {
  border-color: rgba(0, 128, 255, 0.25);
  color: var(--cn-text);
}

/* Filters Row */
.cnx-nav-filters {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 12px;
  border-top: 1px solid var(--cn-glass-border);
}

.cnx-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cn-text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.cnx-filter-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(0, 128, 255, 0.35);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.cnx-filter-check input[type="checkbox"]:checked {
  background: var(--cn-blue);
  border-color: var(--cn-blue);
}

.cnx-filter-check input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: #fff;
  line-height: 1;
}

.cnx-filter-check:hover {
  color: var(--cn-text);
}

.cnx-filter-search {
  min-width: 250px;
  padding: 7px 14px;
  background: rgba(6, 6, 15, 0.7);
  border: 1px solid var(--cn-glass-border);
  border-radius: 999px;
  color: var(--cn-text);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.cnx-filter-search::placeholder {
  color: var(--cn-text-dim);
}

.cnx-filter-search:focus {
  border-color: rgba(0, 128, 255, 0.4);
}

/* --------------------------------------------------------------------------
   3. PRODUCT GRID
   -------------------------------------------------------------------------- */

.cnx-product-count {
  font-size: 0.8rem;
  color: var(--cn-text-dim);
  margin-bottom: 14px;
}

.cnx-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px;
}

/* --------------------------------------------------------------------------
   4. PRODUCT CARD
   -------------------------------------------------------------------------- */

.cnx-card {
  background: var(--cn-glass);
  border: 1px solid var(--cn-glass-border);
  border-radius: var(--cn-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  animation: cnx-fadeIn 0.3s ease both;
}

.cnx-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 128, 255, 0.35);
  box-shadow: 0 8px 32px rgba(0, 128, 255, 0.15);
}

.cnx-card.out-of-stock {
  opacity: 0.5;
}

/* Card Image */
.cnx-card-img {
  aspect-ratio: 1;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cnx-card-img img {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

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

/* Card Body */
.cnx-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cnx-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.cnx-card-sku {
  font-size: 11px;
  color: var(--cn-text-dim);
  margin: 0 0 6px;
  font-family: 'Courier New', monospace;
}

.cnx-card-desc {
  font-size: 12px;
  color: var(--cn-text-dim);
  margin: 0 0 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
}

.cnx-card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--cn-blue-light);
  margin: 0 0 2px;
}

.cnx-card-price-ht {
  font-size: 11px;
  color: var(--cn-text-dim);
  margin: 0 0 8px;
}

/* Badge */
.cnx-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.cnx-badge.available {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.cnx-badge.out_of_stock {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Card Tags */
.cnx-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.cnx-card-tags .cnx-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 128, 255, 0.1);
  border: 1px solid rgba(0, 128, 255, 0.2);
  color: var(--cn-blue-light);
}

/* Card Actions */
.cnx-card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   5. QUICK PREVIEW MODAL
   -------------------------------------------------------------------------- */

.cnx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 15, 0.85);
  z-index: 100010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.cnx-modal {
  position: relative;
  max-width: 700px;
  width: 90vw;
  background: var(--cn-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--cn-glass-border);
  border-radius: var(--cn-radius);
  display: grid;
  grid-template-columns: 50% 50%;
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

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

.cnx-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--cn-glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cn-text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.2s ease;
  line-height: 1;
}

.cnx-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--cn-text);
}

.cnx-modal-img {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cnx-modal-img img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.cnx-modal-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cnx-modal-info .cnx-modal-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.cnx-modal-info .cnx-modal-sku {
  font-size: 12px;
  color: var(--cn-text-dim);
  font-family: 'Courier New', monospace;
}

.cnx-modal-info .cnx-modal-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cn-blue-light);
}

/* Modal Specs */
.cnx-modal-specs {
  border-top: 1px solid var(--cn-glass-border);
  padding-top: 12px;
}

.cnx-modal-specs dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 0;
}

.cnx-modal-specs dt {
  font-size: 11px;
  color: var(--cn-text-dim);
  font-weight: 500;
}

.cnx-modal-specs dd {
  font-size: 11px;
  color: var(--cn-text);
  margin: 0;
}

/* Modal Actions */
.cnx-modal-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.cnx-modal-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 128, 255, 0.35);
  background: transparent;
  color: var(--cn-blue-light);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cnx-modal-link:hover {
  background: var(--cn-blue-dim);
}

/* --------------------------------------------------------------------------
   6. PRODUCT DETAIL PAGE
   -------------------------------------------------------------------------- */

.cnx-detail {
  padding: 20px;
}

/* Breadcrumb */
.cnx-breadcrumb {
  font-size: 0.82rem;
  color: var(--cn-text-dim);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cnx-breadcrumb a {
  color: var(--cn-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cnx-breadcrumb a:hover {
  color: var(--cn-blue-light);
}

.cnx-breadcrumb .cnx-breadcrumb-sep {
  color: var(--cn-text-dim);
  opacity: 0.5;
}

/* Sibling Nav */
.cnx-detail-sibnav {
  overflow-x: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 128, 255, 0.2) transparent;
}

.cnx-detail-sibnav::-webkit-scrollbar {
  height: 4px;
}

.cnx-detail-sibnav::-webkit-scrollbar-track {
  background: transparent;
}

.cnx-detail-sibnav::-webkit-scrollbar-thumb {
  background: rgba(0, 128, 255, 0.2);
  border-radius: 2px;
}

.cnx-detail-sibnav a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--cn-glass-border);
  background: transparent;
  color: var(--cn-text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cnx-detail-sibnav a:hover {
  border-color: rgba(0, 128, 255, 0.3);
  color: var(--cn-text);
}

.cnx-detail-sibnav a.active {
  background: var(--cn-blue-dim);
  border-color: var(--cn-blue);
  color: var(--cn-blue-light);
}

/* Detail Body */
.cnx-detail-body {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 40px;
  align-items: start;
  margin-bottom: 32px;
}

/* Detail Gallery */
.cnx-detail-gallery {
  background: var(--cn-glass);
  border: 1px solid var(--cn-glass-border);
  border-radius: var(--cn-radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 500px;
  overflow: hidden;
}

.cnx-detail-gallery img {
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
}

/* Detail Info */
.cnx-detail-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cnx-detail-name {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.cnx-detail-sku {
  font-size: 12px;
  color: var(--cn-text-dim);
  font-family: 'Courier New', monospace;
}

.cnx-detail-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--cn-blue-light);
}

.cnx-detail-price-ht {
  font-size: 12px;
  color: var(--cn-text-dim);
  margin-top: 2px;
}

.cnx-detail-desc {
  font-size: 0.9rem;
  color: var(--cn-text-dim);
  line-height: 1.6;
}

.cnx-detail-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Detail Actions */
.cnx-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cnx-detail-actions .cnx-btn-primary {
  width: 100%;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   7. TABS
   -------------------------------------------------------------------------- */

.cnx-tabs {
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid var(--cn-glass-border);
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.cnx-tabs::-webkit-scrollbar {
  display: none;
}

.cnx-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--cn-text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
  bottom: -1px;
}

.cnx-tab:hover {
  color: var(--cn-text);
}

.cnx-tab.active {
  color: var(--cn-blue-light);
  border-bottom-color: var(--cn-blue);
}

.cnx-tab-content {
  padding: 24px;
  background: var(--cn-glass);
  border: 1px solid var(--cn-glass-border);
  border-top: none;
  border-radius: 0 0 var(--cn-radius) var(--cn-radius);
}

.cnx-tab-panel {
  display: none;
}

.cnx-tab-panel.active {
  display: block;
}

/* Specs Grid (Technical tab) */
.cnx-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--cn-glass-border);
  border-radius: 10px;
  overflow: hidden;
}

.cnx-specs-grid dt,
.cnx-specs-grid dd {
  padding: 10px 14px;
  font-size: 12px;
  margin: 0;
  border-bottom: 1px solid var(--cn-glass-border);
}

.cnx-specs-grid dt {
  color: var(--cn-text-dim);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.cnx-specs-grid dd {
  color: var(--cn-text);
}

.cnx-specs-grid dt:last-of-type,
.cnx-specs-grid dd:last-of-type {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   8. CART FLOAT BUTTON
   -------------------------------------------------------------------------- */

.cnx-cart-float {
  position: fixed !important;
  top: 18px !important;
  right: 24px !important;
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 2px solid #0080ff !important;
  box-shadow: 0 2px 16px rgba(0, 128, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 9999999 !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  user-select: none;
  overflow: visible !important;
}

.cnx-cart-float svg {
  stroke: #0080ff !important;
}

.cnx-cart-float:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 4px 24px rgba(0, 128, 255, 0.5), 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}


.cnx-cart-badge {
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  border-radius: 50% !important;
  background: #dc2626 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #ffffff !important;
  line-height: 1 !important;
  z-index: 10 !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
}

.cnx-cart-badge[data-count="0"],
.cnx-cart-badge:empty {
  display: none;
}

/* --------------------------------------------------------------------------
   9. CART DRAWER
   -------------------------------------------------------------------------- */

.cnx-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 15, 0.75);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.cnx-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100%;
  background: #0f1729;
  border-left: 2px solid #1e293b;
  display: flex;
  flex-direction: column;
  z-index: 100001;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
}

.cnx-cart-overlay.open .cnx-cart-drawer {
  transform: translateX(0);
}

.cnx-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--cn-glass-border);
  flex-shrink: 0;
}

.cnx-cart-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cn-text);
}

.cnx-cart-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--cn-glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cn-text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.cnx-cart-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cn-text);
}

/* Cart Items */
.cnx-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 128, 255, 0.2) transparent;
}

.cnx-cart-items::-webkit-scrollbar {
  width: 4px;
}

.cnx-cart-items::-webkit-scrollbar-thumb {
  background: rgba(0, 128, 255, 0.2);
  border-radius: 2px;
}

.cnx-cart-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: var(--cn-glass);
  border: 1px solid var(--cn-glass-border);
  border-radius: 12px;
  padding: 10px;
}

.cnx-cart-item-img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cnx-cart-item-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cnx-cart-item-info {
  flex: 1;
  min-width: 0;
}

.cnx-cart-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cn-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.cnx-cart-item-sku {
  font-size: 10px;
  color: var(--cn-text-dim);
  font-family: 'Courier New', monospace;
}

.cnx-cart-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--cn-blue-light);
  margin-top: 4px;
}

.cnx-cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.cnx-cart-item-remove {
  background: none;
  border: none;
  color: var(--cn-text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 2px;
  transition: color 0.2s ease;
  line-height: 1;
}

.cnx-cart-item-remove:hover {
  color: #f87171;
}

/* Cart Footer */
.cnx-cart-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--cn-glass-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cnx-cart-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.cnx-cart-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--cn-text-dim);
}

.cnx-cart-total-ttc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cn-blue-light);
  padding-top: 8px;
  border-top: 1px solid var(--cn-glass-border);
}

.cnx-cart-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Cart Empty */
.cnx-cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--cn-text-dim);
  font-size: 0.9rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.cnx-cart-empty-icon {
  font-size: 3rem;
  opacity: 0.4;
}

/* --------------------------------------------------------------------------
   10. CHECKOUT OVERLAY
   -------------------------------------------------------------------------- */

.cnx-checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 15, 0.88);
  z-index: 100020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.cnx-checkout-form {
  max-width: 440px;
  width: 100%;
  background: var(--cn-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--cn-glass-border);
  border-radius: var(--cn-radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(10px);
  transition: transform 0.25s ease;
}

.cnx-checkout-overlay.open .cnx-checkout-form {
  transform: translateY(0);
}

.cnx-checkout-form h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.cnx-checkout-form .cnx-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cnx-checkout-form label {
  font-size: 0.8rem;
  color: var(--cn-text-dim);
  font-weight: 500;
}

.cnx-checkout-form input,
.cnx-checkout-form select,
.cnx-checkout-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(6, 6, 15, 0.7);
  border: 1px solid var(--cn-glass-border);
  border-radius: 10px;
  color: var(--cn-text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.cnx-checkout-form input::placeholder,
.cnx-checkout-form textarea::placeholder {
  color: var(--cn-text-dim);
}

.cnx-checkout-form input:focus,
.cnx-checkout-form select:focus,
.cnx-checkout-form textarea:focus {
  border-color: rgba(0, 128, 255, 0.45);
}

.cnx-checkout-form select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.cnx-checkout-form .cnx-btn-primary {
  width: 100%;
  justify-content: center;
}

.cnx-checkout-form .cnx-btn-ghost {
  width: 100%;
  justify-content: center;
}

.cnx-checkout-error {
  font-size: 0.82rem;
  color: #f87171;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  display: none;
}

.cnx-checkout-error.visible {
  display: block;
}

/* --------------------------------------------------------------------------
   11. QTY SELECTOR
   -------------------------------------------------------------------------- */

.cnx-qty {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  border: 1px solid var(--cn-glass-border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(6, 6, 15, 0.5);
}

.cnx-qty-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--cn-text-dim);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}

.cnx-qty-btn:hover {
  background: rgba(0, 128, 255, 0.12);
  color: var(--cn-blue-light);
}

.cnx-qty-val {
  width: 36px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cn-text);
  border-left: 1px solid var(--cn-glass-border);
  border-right: 1px solid var(--cn-glass-border);
  user-select: none;
  line-height: 32px;
}

/* --------------------------------------------------------------------------
   12. BUTTONS
   -------------------------------------------------------------------------- */

.cnx-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--cn-blue), var(--cn-blue-glow));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 128, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.cnx-btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(0, 128, 255, 0.45);
}

.cnx-btn-primary:active {
  transform: scale(0.98);
}

.cnx-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--cn-blue);
  border-radius: 10px;
  color: var(--cn-blue-light);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
}

.cnx-btn-secondary:hover {
  background: var(--cn-blue-dim);
  border-color: var(--cn-blue-glow);
}

.cnx-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(136, 153, 180, 0.25);
  border-radius: 10px;
  color: var(--cn-text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
}

.cnx-btn-ghost:hover {
  border-color: rgba(136, 153, 180, 0.45);
  color: var(--cn-text);
}

/* --------------------------------------------------------------------------
   13. EMPTY STATE
   -------------------------------------------------------------------------- */

.cnx-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--cn-text-dim);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.cnx-empty-icon {
  font-size: 3.5rem;
  opacity: 0.35;
}

.cnx-empty h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--cn-text);
}

.cnx-empty p {
  margin: 0;
  max-width: 400px;
}

/* --------------------------------------------------------------------------
   13b. MODAL GRID & DETAIL BODY (base + responsive)
   -------------------------------------------------------------------------- */

.cnx-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.cnx-modal-img-col {
  background: #0f172a;
  border-radius: 16px 0 0 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.cnx-detail-body {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
}

/* --------------------------------------------------------------------------
   14. RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  .cnx-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .cnx-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .cnx-modal-grid {
    grid-template-columns: 1fr;
  }

  .cnx-modal-img-col {
    border-radius: 16px 16px 0 0;
    min-height: 180px;
    padding: 16px;
  }

  .cnx-detail-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cnx-detail-gallery {
    max-height: 320px;
  }

  .cnx-filter-search {
    min-width: 100%;
    width: 100%;
  }

  .cnx-nav-filters {
    flex-wrap: wrap;
  }

  .cnx-cart-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .cnx-tabs {
    overflow-x: auto;
  }

  .cnx-specs-grid {
    grid-template-columns: 1fr;
  }

  .cnx-specs-grid dt,
  .cnx-specs-grid dd {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .cnx-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .cnx-cart-float {
    top: auto;
    bottom: 20px;
    right: 16px;
  }

  .cnx-hero {
    padding: 30px 16px 16px;
  }

  .cnx-hero h1,
  .cnx-hero .cnx-hero-title {
    font-size: 1.7rem;
  }

  .cnx-detail-name {
    font-size: 22px;
  }

  .cnx-checkout-form {
    padding: 24px 20px;
  }

  .cnx-modal {
    width: 96vw;
  }
}

/* --------------------------------------------------------------------------
   15. ANIMATIONS
   -------------------------------------------------------------------------- */

@keyframes cnx-fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered card animation via inline style --cnx-i */
.cnx-card {
  animation-delay: calc(var(--cnx-i, 0) * 0.05s);
}

/* General smooth transitions */
a,
button {
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
