/* ==========================================================================
   PREMIUM CATALOG REDESIGN V2 (FLAWLESS)
   ========================================================================== */

/* --- Layout Reset --- */
.premium-catalog-container {
  max-width: 1600px !important;
  margin: 0 auto !important;
  padding: 2rem !important;
  width: 100% !important;
}
@media (max-width: 768px) {
  .premium-catalog-container {
    padding: 1rem !important;
  }
}
.premium-catalog-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 2rem !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
}

/* --- Hero Section --- */
#premiumHeroContainer.premium-catalog-hero {
  background: linear-gradient(135deg, #090e17 0%, #111827 100%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  padding: 5rem 2rem !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
}
#premiumHeroContainer.premium-catalog-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px) !important;
  background-size: 40px 40px !important;
  pointer-events: none !important;
}
.premium-hero-content {
  position: relative !important;
  z-index: 10 !important;
  max-width: 800px !important;
  margin: 0 auto !important;
}
/* Force white text always using ID for highest specificity */
#premiumHeroTitle {
  font-size: 3rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  letter-spacing: -0.025em !important;
  margin-bottom: 1rem !important;
  line-height: 1.2 !important;
}
html.light #premiumHeroTitle { color: #ffffff !important; }

#premiumHeroSubtitle {
  font-size: 1.125rem !important;
  color: #94a3b8 !important;
  line-height: 1.6 !important;
}
html.light #premiumHeroSubtitle { color: #94a3b8 !important; }

/* --- Horizontal Filter Bar --- */
#premiumFilterBar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 1.5rem !important;
  padding: 1rem 2rem !important;
  background: rgba(15,23,42,0.6) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  position: sticky !important;
  top: 80px !important;
  z-index: 40 !important;
}
html.light #premiumFilterBar {
  background: rgba(255,255,255,0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05) !important;
}

.premium-filter-container {
  display: flex !important;
  gap: 1.5rem !important;
  flex-wrap: wrap !important;
  flex: 1 !important;
}
.premium-filter-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
}
.premium-filter-group label {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}
html.light .premium-filter-group label { color: #64748b !important; }

/* Select Inputs - Bulletproof Specificity and Background Properties */
#filterType, #catalogFilterProcessor, #catalogFilterScreen, #catalogFilterBrand {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-color: rgba(255,255,255,0.05) !important;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%2394a3b8" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 20px !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #ffffff !important;
  padding: 0.75rem 2.5rem 0.75rem 1rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.875rem !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  min-width: 200px !important;
  height: auto !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
#filterType:hover, #catalogFilterProcessor:hover, #catalogFilterScreen:hover, #catalogFilterBrand:hover {
  background-color: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.2) !important;
}
#filterType:focus, #catalogFilterProcessor:focus, #catalogFilterScreen:focus, #catalogFilterBrand:focus {
  outline: none !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.2) !important;
  background-color: rgba(255,255,255,0.1) !important;
}

/* Light Mode Overrides for Inputs */
html.light #filterType, html.light #catalogFilterProcessor, html.light #catalogFilterScreen, html.light #catalogFilterBrand {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23475569" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 20px !important;
}
html.light #filterType:hover, html.light #catalogFilterProcessor:hover, html.light #catalogFilterScreen:hover, html.light #catalogFilterBrand:hover {
  background-color: #ffffff !important;
  border-color: #94a3b8 !important;
}
html.light #filterType:focus, html.light #catalogFilterProcessor:focus, html.light #catalogFilterScreen:focus, html.light #catalogFilterBrand:focus {
  border-color: #ea580c !important;
  box-shadow: 0 0 0 3px rgba(234,88,12,0.1) !important;
  background-color: #ffffff !important;
}

/* Search Box & Actions */
.premium-filter-actions {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
}
.premium-search-box {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}
.premium-search-box svg {
  position: absolute !important;
  left: 14px !important;
  color: #64748b !important;
  pointer-events: none !important;
}
#catalogSearch2 {
  background-color: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #ffffff !important;
  padding: 0.75rem 1rem 0.75rem 2.75rem !important;
  border-radius: 2rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  width: 280px !important;
  height: auto !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
#catalogSearch2:focus {
  outline: none !important;
  border-color: #0ea5e9 !important;
  background-color: rgba(255,255,255,0.1) !important;
  width: 340px !important;
}
html.light #catalogSearch2 {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html.light #catalogSearch2:focus {
  border-color: #ea580c !important;
  background-color: #ffffff !important;
  width: 340px !important;
}
html.light .premium-search-box svg { color: #94a3b8 !important; }

/* Reset Button */
.premium-btn-reset {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #94a3b8 !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.premium-btn-reset:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}
html.light .premium-btn-reset {
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}
html.light .premium-btn-reset:hover {
  background: #fef2f2 !important;
  color: #ef4444 !important;
  border-color: #fecaca !important;
}

/* --- Catalog Grid Layout --- */
.premium-catalog-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 1.5rem !important;
}

/* Premium Cards */
.premium-catalog-grid .catalog-card {
  background: #111827 !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  border-radius: 12px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
}
.premium-catalog-grid .catalog-card:hover {
  transform: translateY(-6px) !important;
  border-color: rgba(255,255,255,0.2) !important;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.4) !important;
}
html.light .premium-catalog-grid .catalog-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}
html.light .premium-catalog-grid .catalog-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.01) !important;
}
.premium-catalog-grid .catalog-card__img-wrap {
  padding: 2rem !important;
  background: rgba(255,255,255,0.02) !important;
  border-bottom: 1px solid rgba(255,255,255,0.02) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  aspect-ratio: 1 / 1 !important;
}
html.light .premium-catalog-grid .catalog-card__img-wrap {
  background: #f8fafc !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
.premium-catalog-grid .catalog-card__img-wrap img {
  transform: scale(0.95);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.premium-catalog-grid .catalog-card:hover .catalog-card__img-wrap img {
  transform: scale(1.05);
}
.premium-catalog-grid .catalog-card__body {
  padding: 1.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}
.premium-catalog-grid .catalog-card__sku {
  font-size: 0.75rem !important;
  letter-spacing: 0.05em !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
}
.premium-catalog-grid .catalog-card__title {
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  margin-top: 0.5rem !important;
  line-height: 1.4 !important;
  color: #ffffff !important;
}
html.light .premium-catalog-grid .catalog-card__title {
  color: #0f172a !important;
}
.premium-catalog-grid .catalog-card__specs {
  margin-top: auto !important;
  padding-top: 1.25rem !important;
  border-top: 1px solid rgba(255,255,255,0.05) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
}
html.light .premium-catalog-grid .catalog-card__specs {
  border-top-color: #f1f5f9 !important;
}
.premium-catalog-grid .catalog-card__spec {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  font-size: 0.8125rem !important;
  color: #cbd5e1 !important;
}
html.light .premium-catalog-grid .catalog-card__spec {
  color: #475569 !important;
}
.premium-catalog-grid .catalog-card__spec svg {
  color: #64748b !important;
  flex-shrink: 0 !important;
}
html.light .premium-catalog-grid .catalog-card__spec svg {
  color: #94a3b8 !important;
}
.premium-catalog-grid .catalog-card__actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.75rem !important;
  margin-top: 1.5rem !important;
}
.premium-catalog-grid .catalog-card__btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  border-radius: 0.5rem !important;
  padding: 0.6rem !important;
  transition: all 0.2s !important;
  text-decoration: none !important;
}
.premium-catalog-grid .catalog-card__btn:hover {
  background: #ffffff !important;
  color: #0f172a !important;
}
.premium-catalog-grid .catalog-card__btn--view {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #ffffff !important;
}
.premium-catalog-grid .catalog-card__btn--view:hover {
  background: #e2e8f0 !important;
}
html.light .premium-catalog-grid .catalog-card__btn {
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}
html.light .premium-catalog-grid .catalog-card__btn:hover {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}
html.light .premium-catalog-grid .catalog-card__btn--view {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}
html.light .premium-catalog-grid .catalog-card__btn--view:hover {
  background: #1e293b !important;
}

/* --- New Redesign Layout --- */
.premium-layout-container {
  display: flex;
  gap: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 2rem 2rem 2rem;
  align-items: flex-start;
}

.premium-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 1.5rem;
  position: sticky;
  top: 100px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.premium-sidebar::-webkit-scrollbar { width: 6px; }
.premium-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

html.light .premium-sidebar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
}

.premium-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
html.light .premium-sidebar-header { border-bottom: 1px solid #e2e8f0; }

.premium-sidebar-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
html.light .premium-sidebar-header h3 { color: #0f172a; }

.premium-filter-section {
  margin-bottom: 1.5rem;
}
.premium-filter-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
html.light .premium-filter-section h4 { color: #64748b; }

.premium-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.premium-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: #cbd5e1;
  transition: all 0.2s;
}
.premium-checkbox-label:hover { color: #fff; }
html.light .premium-checkbox-label { color: #475569; }
html.light .premium-checkbox-label:hover { color: #0f172a; }

.premium-checkbox-label input[type="checkbox"] {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
}
html.light .premium-checkbox-label input[type="checkbox"] {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

.premium-checkbox-label input[type="checkbox"]:checked {
  background: #f97316;
  border-color: #f97316;
}
.premium-checkbox-label input[type="checkbox"]:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background-color: white;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5L4.5 8.5L13 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5L4.5 8.5L13 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}

.premium-grid-area {
  flex: 1;
  min-width: 0;
}

/* Toolbar */
.premium-toolbar {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem 2rem;
}
.premium-toolbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15,23,42,0.4);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
html.light .premium-toolbar-inner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}
.premium-toolbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Redesigned Premium Catalog Card */
.catalog-card {
  background: rgba(15,23,42,0.8) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  display: flex;
  flex-direction: column;
}
.catalog-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(249,115,22,0.4) !important;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5), 0 0 20px rgba(249,115,22,0.1) !important;
}
html.light .catalog-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}
html.light .catalog-card:hover {
  border-color: #f97316 !important;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1) !important;
}

.catalog-card__media {
  background: #fff;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  height: 200px;
}
.catalog-card__media img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.catalog-card__body {
  padding: 1.5rem !important;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalog-card__brand {
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f97316 !important;
  font-weight: 700 !important;
  margin-bottom: 0.5rem !important;
}

.catalog-card__title {
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin-bottom: 1rem !important;
  line-height: 1.4 !important;
}
html.light .catalog-card__title { color: #0f172a !important; }

.catalog-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  margin-top: auto;
}
.catalog-card__badge {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
html.light .catalog-card__badge {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.catalog-card__actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 1rem;
}
html.light .catalog-card__actions { border-top: 1px solid #e2e8f0; }

.catalog-card__btn {
  flex: 1;
  text-align: center;
  padding: 0.6rem !important;
  border-radius: 8px !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
  cursor: pointer;
  text-decoration: none;
}
.catalog-card__btn--view {
  background: #f97316 !important;
  color: #fff !important;
  border: none !important;
}
.catalog-card__btn--view:hover { background: #ea580c !important; }
.catalog-card__btn--compare {
  background: rgba(255,255,255,0.05) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
}
html.light .catalog-card__btn--compare {
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}
.catalog-card__btn--compare:hover, .catalog-card__btn--compare[aria-pressed="true"] {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}
html.light .catalog-card__btn--compare:hover, html.light .catalog-card__btn--compare[aria-pressed="true"] {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

@media (max-width: 992px) {
  .premium-layout-container {
    flex-direction: column;
  }
  .premium-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  .premium-toolbar-inner {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}
