/**
 * MATRIX MOBILE BNS — Dedicated Device Guide Styles (دليل الأجهزة والمواصفات والمقارنات)
 * Inspired by MobileMasr Guide Architecture
 * Location: Beni Suef - Al-Abasiry St. (Since 2002)
 */

/* Breadcrumb Bar */
.guide-breadcrumb-bar {
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.guide-breadcrumb-bar a {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
}
.guide-breadcrumb-bar a:hover {
  text-decoration: underline;
}
.guide-breadcrumb-bar span.separator {
  margin: 0 8px;
  color: #94A3B8;
}

/* Hero Section */
.guide-hero {
  background: linear-gradient(135deg, #0A1128 0%, #162447 60%, #1F4068 100%);
  color: #FFFFFF;
  padding: 55px 0 65px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--primary-blue);
}
.guide-hero::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 150, 226, 0.25) 0%, rgba(41, 150, 226, 0) 70%);
  pointer-events: none;
}
.guide-hero::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.2) 0%, rgba(249, 115, 22, 0) 70%);
  pointer-events: none;
}
.guide-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}
.guide-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(41, 150, 226, 0.2);
  border: 1px solid rgba(41, 150, 226, 0.5);
  color: #60A5FA;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 18px;
}
.guide-hero h1 {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 14px;
}
.guide-hero h1 span {
  color: #F97316;
}
.guide-hero p {
  font-size: 1.05rem;
  color: #CBD5E1;
  line-height: 1.7;
  margin-bottom: 28px;
}

/* Fast Search in Hero */
.guide-search-wrapper {
  max-width: 680px;
  margin: 0 auto 24px;
  position: relative;
}
.guide-search-box {
  display: flex;
  background: #FFFFFF;
  border-radius: 50px;
  padding: 6px 8px 6px 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  border: 2px solid transparent;
  transition: all 0.25s ease;
}
.guide-search-box:focus-within {
  border-color: #F97316;
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.3);
}
.guide-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  color: #0F172A;
  background: transparent;
  padding: 8px 10px;
}
.guide-search-btn {
  background: linear-gradient(135deg, #F97316, #EA580C);
  color: #FFFFFF;
  border: none;
  border-radius: 40px;
  padding: 0 24px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.guide-search-btn:hover {
  opacity: 0.92;
}

/* Quick Brand Filter Pills */
.brand-pills-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.brand-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 7px 18px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.brand-pill:hover,
.brand-pill.active {
  background: #2563EB;
  border-color: #3B82F6;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Layout Section */
.guide-main-section {
  padding: 40px 0 80px;
  background: #F8FAFC;
}
.guide-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

/* Filter Sidebar */
.guide-sidebar {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 90px;
}
.guide-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #F1F5F9;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.guide-sidebar-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-reset-filters {
  background: none;
  border: none;
  color: #EF4444;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.btn-reset-filters:hover {
  background: #FEF2F2;
}

.filter-group {
  margin-bottom: 20px;
}
.filter-group-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
  display: block;
}
.filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #0F172A;
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.2s;
}
.filter-select:focus {
  border-color: #2563EB;
}

.filter-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filter-checkbox-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
}
.filter-checkbox-item input[type="checkbox"] {
  accent-color: #2563EB;
  width: 16px;
  height: 16px;
}
.filter-checkbox-item:hover {
  color: #0F172A;
}

/* In Store Toggle Switch */
.in-store-toggle-box {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.in-store-toggle-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1E40AF;
  line-height: 1.3;
}
.in-store-toggle-label small {
  display: block;
  font-size: 0.76rem;
  font-weight: 400;
  color: #3B82F6;
  margin-top: 2px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: .3s;
  border-radius: 34px;
}
.slider-toggle:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider-toggle {
  background-color: #10B981;
}
input:checked + .slider-toggle:before {
  transform: translateX(20px);
}

/* Content Area */
.guide-content-area {
  min-width: 0;
}

/* Toolbar */
.guide-toolbar {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.guide-count-badge {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0F172A;
}
.guide-count-badge span {
  color: #2563EB;
}
.guide-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #475569;
}
.sort-wrap select {
  padding: 6px 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #0F172A;
  outline: none;
}

/* Devices Grid */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

/* Device Card */
.device-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
.device-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: #93C5FD;
}

/* Image Wrap */
.device-img-wrap {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px;
  border-bottom: 1px solid #F1F5F9;
}
.device-img-wrap img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.device-card:hover .device-img-wrap img {
  transform: scale(1.05);
}

/* Badges on Image */
.device-badge-row {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}
.badge-brand {
  background: rgba(15, 23, 42, 0.85);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.badge-instore {
  background: #10B981;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Compare Toggle Box on Card */
.device-compare-check {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #CBD5E1;
  padding: 4px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  user-select: none;
  transition: all 0.2s ease;
}
.device-compare-check:hover {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1D4ED8;
}
.device-compare-check input {
  accent-color: #2563EB;
  cursor: pointer;
}

/* Device Body */
.device-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.device-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 6px;
  line-height: 1.4;
}
.device-subtitle {
  font-size: 0.8rem;
  color: #64748B;
  margin-bottom: 14px;
}

/* Specs Badges Matrix */
.device-specs-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-bottom: 18px;
  background: #F8FAFC;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #F1F5F9;
}
.spec-row {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: #334155;
  gap: 8px;
}
.spec-icon {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.spec-label {
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}
.spec-val {
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Card Actions */
.device-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-view-details {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1.5px solid #BFDBFE;
  padding: 9px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-view-details:hover {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}
.btn-store-order {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-store-order:hover {
  opacity: 0.92;
  color: #FFFFFF;
}

/* Empty State */
.guide-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px dashed #CBD5E1;
  grid-column: 1 / -1;
}
.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}
.guide-empty-state h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 8px;
}
.guide-empty-state p {
  color: #64748B;
  font-size: 0.92rem;
  margin-bottom: 18px;
}

/* ==========================================================================
   FLOATING COMPARISON DOCK
   ========================================================================== */
.comparison-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-top: 2px solid #3B82F6;
  padding: 14px 20px;
  z-index: 999;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.25);
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.comparison-dock.active {
  transform: translateY(0);
}
.dock-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.dock-info {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dock-title {
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dock-badge {
  background: #F97316;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}
.dock-devices-previews {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dock-device-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 4px 12px 4px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #E2E8F0;
  font-size: 0.8rem;
  font-weight: 600;
}
.dock-device-pill img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: #FFFFFF;
}
.btn-remove-dock {
  background: none;
  border: none;
  color: #F87171;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.dock-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-dock-clear {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #CBD5E1;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-dock-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}
.btn-dock-compare {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  border: none;
  padding: 8px 22px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: transform 0.2s, opacity 0.2s;
}
.btn-dock-compare:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

/* ==========================================================================
   MODALS: DEVICE DETAILS & COMPARISON
   ========================================================================== */
.guide-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.guide-modal-overlay.active {
  display: flex;
}
.guide-modal-card {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: modalFadeIn 0.25s ease-out;
}
.guide-modal-card.wide {
  max-width: 1200px;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-bar {
  padding: 18px 24px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
}
.modal-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-close-modal {
  background: #E2E8F0;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.btn-close-modal:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.modal-scroll-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Device Detail Modal Styles */
.detail-hero-box {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  align-items: center;
}
.detail-hero-img {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-hero-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.detail-hero-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 8px;
}
.detail-hero-info .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.meta-chip {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.in-store-banner-box {
  background: #ECFDF5;
  border: 1.5px solid #10B981;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.in-store-banner-text {
  color: #065F46;
  font-size: 0.88rem;
  font-weight: 700;
}

/* Detailed Spec Grid */
.specs-detail-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.spec-section-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px;
}
.spec-section-card h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1E3A8A;
  border-bottom: 2px solid #EFF6FF;
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.spec-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px dashed #F1F5F9;
  gap: 12px;
}
.spec-item:last-child {
  border-bottom: none;
}
.spec-item-key {
  color: #64748B;
  font-weight: 600;
  flex-shrink: 0;
}
.spec-item-val {
  color: #0F172A;
  font-weight: 700;
  text-align: left;
  direction: ltr;
}

/* Side-by-Side Comparison Table */
.compare-table-wrapper {
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}
.compare-table th,
.compare-table td {
  border: 1px solid #E2E8F0;
  padding: 14px 16px;
  text-align: right;
  font-size: 0.88rem;
  vertical-align: top;
}
.compare-table th {
  background: #F8FAFC;
  color: #1E293B;
  font-weight: 800;
  width: 180px;
}
.compare-table td.device-col {
  background: #FFFFFF;
}
.compare-header-card {
  text-align: center;
}
.compare-header-card img {
  height: 120px;
  object-fit: contain;
  margin-bottom: 8px;
}
.compare-header-card h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 992px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }
  .guide-sidebar {
    position: static;
  }
}
@media (max-width: 768px) {
  .guide-hero {
    padding: 35px 0 45px;
  }
  .guide-hero h1 {
    font-size: 1.6rem;
  }
  .guide-hero p {
    font-size: 0.9rem;
  }
  .brand-pills-bar {
    gap: 6px;
  }
  .brand-pill {
    padding: 5px 12px;
    font-size: 0.8rem;
  }
  .detail-hero-box {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .specs-detail-sections {
    grid-template-columns: 1fr;
  }
  .comparison-dock {
    padding: 10px 14px;
  }
  .dock-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .dock-info {
    justify-content: space-between;
  }
}
