/* ═══════════════════════════════════════════════════════════
   SUNCONNECT — Products Page Styles
   ═══════════════════════════════════════════════════════════ */

.page {
  --products-pad: 16px;
}

/* ── PAGE HEADER ── */
.page-header { padding: 20px var(--products-pad) 0; }
.page-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.page-header p { font-size: 13px; color: var(--text-secondary); }

.page .breadcrumb {
  padding: 12px var(--products-pad) 0;
}

/* ── SEARCH BAR ── */
.search-bar { margin: 14px var(--products-pad) 0; position: relative; }
.search-bar input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--gray-card);
  transition: border-color 0.15s, background 0.15s;
}
.search-bar input:focus { outline: none; border-color: var(--blue); background: var(--white); }
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }

/* ── FILTER PILLS ── */
.pills-row { padding: 14px var(--products-pad) 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.pills-row::-webkit-scrollbar { display: none; }
.pill { flex-shrink: 0; padding: 7px 16px; border-radius: 50px; border: 1.5px solid var(--border); background: var(--white); font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; font-family: inherit; text-decoration: none; }
.pill.active { background: var(--orange); border-color: var(--orange); color: var(--white); }
.pill:hover:not(.active) { background: var(--orange); border-color: var(--orange); color: var(--white); }
.pill-filter-chip { flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 50px; border: 1.5px solid var(--border); background: var(--white); font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.pill-filter-chip:hover { border-color: var(--blue); color: var(--blue); }
.pill-filter-chip.has-filters { background: var(--blue); border-color: var(--blue); color: var(--white); }
.pill-filter-chip i { font-size: 11px; }

/* ── FILTER DRAWER ── */
.filter-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; backdrop-filter: blur(2px); }
.filter-overlay.open { display: block; }
.filter-drawer {
  position: fixed;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--white);
  border-radius: 0 20px 20px 0;
  padding: 0 0 32px;
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-drawer::-webkit-scrollbar { display: none; }
.filter-drawer.open { transform: translateX(0); }
.filter-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.filter-drawer-header h3 { font-size: 16px; font-weight: 700; }
.filter-clear-btn { font-size: 13px; color: var(--blue); font-weight: 600; background: none; border: none; cursor: pointer; font-family: inherit; }
.filter-apply-btn { display: block; width: calc(100% - 40px); margin: 0 20px; padding: 14px; background: var(--blue); color: var(--white); border: none; border-radius: 50px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; transition: opacity 0.15s; }
.filter-apply-btn:hover { opacity: 0.9; }

.filter-count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--orange);
  color: var(--white);
  border-radius: 50px;
  font-size: 10px;
  font-weight: 700;
}
.filter-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 17px;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.15s;
}
.filter-drawer-close:hover { color: var(--text-primary); }

/* Filter groups */
.filter-group { border-bottom: 1px solid var(--border); }
.filter-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.1s;
}
.filter-group-header:hover { background: var(--gray-bg); }
.filter-group-count {
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 50px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  flex-shrink: 0;
}
.filter-toggle-icon {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.filter-group.collapsed .filter-toggle-icon { transform: rotate(-90deg); }
.filter-group-body { padding: 4px 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.filter-group.collapsed .filter-group-body { display: none; }

/* Checkboxes */
.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}
.filter-checkbox-label input[type=checkbox] {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 3px;
}
.filter-checkbox-label:hover span { color: var(--text-primary); }
.filter-checkbox-label input:checked + span { color: var(--text-primary); font-weight: 600; }

/* Price range inputs */
.price-range-hint { font-size: 11.5px; color: var(--text-muted); margin-bottom: 10px; }
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--gray-card);
  transition: border-color 0.15s;
}
.price-input-wrap:focus-within { border-color: var(--blue); background: var(--white); }
.price-currency { font-size: 12px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.price-input {
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
}
.price-input::-webkit-inner-spin-button,
.price-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.price-dash { font-size: 13px; color: var(--text-muted); flex-shrink: 0; }

/* Active filter chips */
.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px var(--products-pad) 0;
}
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 50px;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.active-chip:hover { background: #c9ecea; }
.active-chip i { font-size: 9px; }

/* ── SORT / RESULTS BAR ── */
.results-bar { padding: 14px var(--products-pad) 0; display: flex; align-items: center; justify-content: space-between; }
.results-count { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.results-count span { color: var(--text-primary); font-weight: 700; }
.sort-select-wrap { position: relative; }
.sort-select { display: none; }
.sort-dropdown { position: relative; }
.sort-dropdown-trigger { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 50px; background: var(--white); font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; white-space: nowrap; }
.sort-dropdown-trigger:hover { border-color: var(--blue); color: var(--text-primary); }
.sort-dropdown.is-open .sort-dropdown-trigger { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.sort-dropdown-chevron { font-size: 9px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.sort-dropdown.is-open .sort-dropdown-chevron { transform: rotate(180deg); }
.sort-dropdown-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 200; list-style: none; margin: 0; padding: 4px; background: var(--white); border: 1.5px solid var(--border); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,0.08); min-width: 160px; }
.sort-dropdown-menu[hidden] { display: none; }
.sort-dropdown-option { display: block; width: 100%; padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: none; border: none; font-family: inherit; text-align: left; cursor: pointer; transition: background 0.15s; white-space: nowrap; }
.sort-dropdown-option:hover { background: var(--blue-light); color: var(--blue); }
.sort-dropdown-option.is-active { background: var(--gray-card); color: var(--text-primary); }

/* ── PRODUCTS GRID ── */
.products-section { padding: 16px var(--products-pad) 24px; }
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.product-card { background: var(--gray-card); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; position: relative; text-decoration: none; color: inherit; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.product-card-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; }
.product-img { position: relative; }
.product-card-overlay { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 2; }
.product-card-action { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.95); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text-secondary); box-shadow: 0 2px 8px rgba(0,0,0,0.12); transition: transform 0.15s, color 0.15s; }
.product-card-action:hover { transform: scale(1.08); color: var(--orange); }
.product-card-action.active { color: #e11d48; }.product-badge { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 50px; font-size: 10px; font-weight: 700; z-index: 2; letter-spacing: 0.02em; }
.badge-new { background: var(--blue); color: var(--white); }
.badge-sale { background: var(--orange); color: var(--white); }
.badge-hot { background: #1a2e2c; color: var(--white); }
.product-img { aspect-ratio: 1 / 1; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-info { padding: 11px 13px 13px; }
.product-category { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.product-name { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; line-height: 1.3; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.product-price { font-size: 14px; font-weight: 700; color: var(--orange); }
.product-price-old { font-size: 11px; font-weight: 500; color: var(--text-muted); text-decoration: line-through; display: block; line-height: 1; margin-bottom: 1px; }
.add-to-cart-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--white); flex-shrink: 0; transition: background 0.15s, transform 0.15s; }
.add-to-cart-btn:hover { background: var(--orange); transform: scale(1.08); }

/* ── EMPTY STATE ── */
.empty-state { padding: 60px var(--products-pad); text-align: center; display: none; }
.empty-state i { font-size: 40px; color: var(--border); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; color: var(--text-muted); }

/* ── PAGINATION ── */
.pagination-wrap { padding: 8px var(--products-pad) 24px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.page-btn { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--white); color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.page-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.page-btn.active { background: var(--blue); border-color: var(--blue); color: var(--white); }
.page-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* ── CONDITION CHIP + SHORT SPECS ── */
.product-cond-chip { display: inline-block; font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 50px; margin-bottom: 5px; letter-spacing: 0.03em; }
.cond-new { background: #e0f2fe; color: #0369a1; }
.cond-used { background: #fef3c7; color: #92400e; }
.cond-refurbished { background: #dcfce7; color: #15803d; }
.cond-unavailable { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; opacity: 0.75; }
.product-spec-snip { display: block; font-size: 10.5px; color: var(--text-muted); font-weight: 500; margin-bottom: 3px; line-height: 1.3; }
.condition-options-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.condition-options-row .product-cond-chip { margin-bottom: 0; }
.price-from-label { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-right: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.product-price-out { font-size: 12px; color: #991b1b; font-weight: 700; }
.grade-chip { display: inline-block; font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 50px; margin-bottom: 5px; background: #ccfbf1; color: #0f766e; letter-spacing: 0.03em; }

/* ── ADD TO CART ANIMATION ── */
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.add-to-cart-btn.added { animation: pop 0.25s ease; background: var(--orange); }

/* ── RESPONSIVE ── */
@media (min-width: 640px) {
  .page { --products-pad: 32px; }

  .page-header { padding-top: 28px; }
  .page-header h1 { font-size: 26px; }
  .search-bar { margin-top: 16px; }
  .pills-row { padding-top: 16px; }
  .results-bar { padding-top: 16px; }
  .products-section { padding-bottom: 28px; }
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .pagination-wrap { padding-bottom: 28px; }
}

@media (min-width: 1024px) {
  .page { --products-pad: 48px; }

  .page-header { padding-top: 32px; }
  .search-bar { margin-top: 18px; }
  .pills-row { padding-top: 18px; }
  .products-section { padding-bottom: 32px; }
  .products-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .pagination-wrap { padding-bottom: 32px; }
}

@media (max-height: 520px) {
  .filter-drawer {
    top: 0;
    bottom: 0;
    border-radius: 0;
  }
}
