/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$	
	MAIN SYLES Billion Androids
	http://www.billionandroids.com
	GVZ + SMD + CURSORAI
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */

/* BA green: #A5C63B */

:root {
  --category-section-gap: 24px;
  --fallback-nav-offset: 60px;
  --fallback-header-offset: 160px;
}

body {
  margin: 0;
  padding: 0;
  background: #eaeaea;
  font-family: Arial, sans-serif;
  color: #333333;
  text-align: center;
  line-height: 150%;
  /*font-size: 100%; */
  font-size: 16px !important;
}

h1 {
  margin: 5px 0;
  padding: 0;
  font-family: "Copse", Arial, sans-serif;
  font-weight: normal;
  color: #ffffff;
  font-size: 250%;
}

h1 span {
  font-size: 50%;
  font-family: Arial, sans-serif;
}

h2 {
  color: #333333;
  font-family: "Copse", Arial, sans-serif;
  font-weight: normal;
  font-size: 180%;
  margin: 0 0 5px 0;
  padding: 0;
}

h3 {
  color: #333333;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: 120%;
  margin: 0;
  padding: 0;
}

p {
  margin: 0 0 30px 0;
  padding: 0;
  color: #666666;
}

a {
  color: #666666;
  text-decoration: underline;
}

a:hover {
  color: #333333;
}

table {
  margin: 0 0 30px 0;
  border: none;
  width: 100%;
  color: #666666;
}

table tr {
  margin: 0;
  padding: 0;
  vertical-align: top;
}

table td {
  width: 50%;
}

ul {
  margin: 0 0 30px 30px;
  padding: 0;
  list-style-type: disc;
}

ul ul,
ul ul ul {
  margin: 0 0 0 30px;
}

ol {
  margin: 0 0 30px 30px;
  padding: 0;
}

ol ol,
ol ol ol {
  margin: 0 0 0 30px;
}

#nav {
  text-transform: uppercase;
  font-size: 90%;
  border-top: 5px solid #cccccc;
}

#nav ol {
  margin: -3px 0 0 0;
  padding: 5px 0;
}

#nav ol li {
  list-style-type: none;
  padding: 0 5px;
  display: inline;
}

#nav ol li a {
  padding: 5px;
  text-decoration: none;
  color: #333333;
  border-top: 5px solid #cccccc;
}

#nav ol li a:hover {
  padding: 5px;
  text-decoration: none;
  color: #333333;
  border-top: 5px solid #333333;
}

#nav ol li.active a,
#nav ol li.active a:hover {
  font-weight: bold;
  border-top: 5px solid #333333;
}

#header {
  background: #ffffff;
  padding: 40px 0 20px;
  width: 100%;
}

#header h1,
#header p.pay-off {
  color: #666666;
  font-size: 140%;
  font-weight: normal;
  margin: 15px 0 0 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

#header h1 span,
#header p.pay-off span {
  color: #333333;
  font-weight: bold;
  font-family: Arial, sans-serif;
  font-size: 100%;
}

a.logo,
a.logo img {
  padding: 0;
  margin: 0;
  border: none;
}

#filtercontainer {
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  color: #ffffff;
  width: 100%;
  padding: 20px 0 15px 0;
  float: left;
  clear: both;
  min-height: 50px;
}
#filtercontainer p {
  margin: 10px 0 0 0;
  color: #fff;
}

#filtercontainer h1 {
  padding: 0 15px;
  max-width: 1400px;
  margin: 5px auto 10px auto;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word; /* Ensure long words break */
  font-size: clamp(
    1.5rem,
    5vw,
    2.5rem
  ); /* Responsive font size: 24px min, 40px max */
}

#filtercontainer .filter-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
  flex-wrap: nowrap;
  padding: 0 24px;
}

#filter,
#compare,
#search {
  display: flex;
  align-items: center;
}

#filter,
#compare {
  flex: 0 0 auto;
}

#search {
  flex: 0 0 auto;
  justify-content: center;
}

a.filterbutton,
a.comparebutton {
  background: #a5c63b;
  color: #ffffff;
  border-radius: 4px;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 110%;
  float: none;
  text-shadow: 0 1px 1px #666666;

  display: inline-flex; /* Use flexbox for inline alignment */
  align-items: center; /* Align items vertically */
  gap: 10px;
}

a.filterbutton {
  min-width: 115px;
  box-sizing: border-box;
}

a.filterbutton .filter-content {
  display: inline-flex;
  align-items: center;
}

a.filterbutton .icon,
a.comparebutton .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.filterbutton svg,
a.comparebutton svg {
  vertical-align: middle;
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

a.filterbutton:hover svg,
a.filterbutton.active svg {
  transform: scale(1.1);
}

a.filterbutton:hover,
a.comparebutton:hover,
a.filterbutton.active,
a.comparebutton.active,
a.filterbutton.active:hover,
a.comparebutton.active:hover {
  background: #48b379;
}

#search form {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
}

#search form label {
  display: none;
}

#search form input {
  border: none;
  padding: 0 16px;
  border-radius: 4px 0 0 4px;
  font-size: 110%;
  font-family: Arial, sans-serif;
  color: #333333;
  width: 250px;
  max-width: 100%;
  height: 43px;
  line-height: 43px;
  box-sizing: border-box;
  flex: 1 1 250px;
}

#search form .search-submit-btn {
  background: #ffffff;
  color: #a5c63b;
  border: none;
  border-radius: 0 4px 4px 0;
  padding: 0;
  font-size: 110%;
  text-shadow: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 43px;
  width: 43px;
  min-width: 43px;
  flex: 0 0 43px;
}

#search form .search-submit-btn .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

#search form .search-submit-btn svg {
  width: 16px;
  height: 16px;
}

#search form .search-submit-btn:hover {
  background: #f4f4f4;
}

/* Autocomplete Dropdown Styles */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}

.autocomplete-dropdown.visible {
  display: block;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: #f5f5f5;
}

.autocomplete-name {
  color: #333333;
  font-size: 14px;
  flex: 1;
  text-align: left;
}

.autocomplete-category {
  background: #a5c63b;
  color: #ffffff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 10px;
  text-transform: capitalize;
}

#chosenfilters {
  font-size: 90%;
  color: #999999;
  border-top: 1px solid #444;
  background: linear-gradient(135deg, #3d3d3d 0%, #2d2d2d 100%);
  width: 100%;
  clear: both;
  padding: 10px 0;
  /* Fixed height to prevent layout shift - single line on desktop */
  height: 38px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chosenfilters ul {
  margin: 0;
  padding: 0;
}

#chosenfilters ul li {
  list-style-type: none;
  display: inline;
  padding: 0 12px 0 0;
  margin: 0 3px;
  background: url(../../../../packages/billionandroids_package/themes/billionandroids//images/filter-plus.gif) no-repeat 100% 50% transparent;
  word-break: keep-all;
}

#chosenfilters ul li.camera-res-filter {
  background: none;
}

#chosenfilters ul li:last-child {
  background: none; /* Remove plus icon from last item */
}

#chosenfilters ul li.clear-all {
  background: transparent;
}

#chosenfilters ul li.clear-all a {
  color: #d90000;
  text-decoration: none;
}

/* Chosen Filters Highlighting */
#chosenfilters .active-filter {
  font-weight: bold;
  display: inline-block;
  color: #ffffff;
}

#chosenfilters .inactive-filter {
  font-weight: normal;
  display: inline-block;
}

#chosenfilters ul li {
  margin: 2px 5px 2px 0;
}

#filter-dropdown {
  background: #333333;
  z-index: 90;
  position: relative;
  color: #cccccc;
  padding: 20px 0 20px 0;
}

#filter-dropdown h2 {
  color: #ffffff;
  margin: 0 0 30px 0;
}

#filter-dropdown .filter-part {
  display: inline-block;
  width: 220px;
  vertical-align: top;
  text-align: left;
  margin: 0 5px;
}

#filter-dropdown .filter-part p.title {
  font-size: 150%;
  color: #cccccc;
  margin: 0;
  padding: 0 0 10px 0;
}

#filter-dropdown .filter-part select {
  margin-bottom: 20px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f9f9f9;
  font-size: 14px;
  color: #333;
  width: 175px;
}

#filter-dropdown .filter-part select:hover {
  border-color: #888;
}

#filter-dropdown .filter-part select:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

#filter-dropdown .filter-part p.subtitle {
  font-size: 100%;
  font-weight: bold;
  color: #eaeaea;
  margin: 0;
  padding: 0;
}

#filter-dropdown form {
  padding: 0;
}

#filter-dropdown form fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

#filter-dropdown form fieldset .row {
  clear: both;
  width: 100%;
}

#filter-dropdown form fieldset input {
  margin-right: 5px;
}

.device {
  background: #ffffff;
  border: 1px solid #cccccc;
  box-sizing: border-box;
  -o-box-sizing: boder-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  width: 220px;
  max-width: 220px; /* Prevent stretching on larger screens */
  margin: 0; /* Remove margin to let Flexbox gap handle spacing */
  padding: 10px;
  display: inline-block;
  height: 300px;
  text-align: left;
  position: relative;
}

.device::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  pointer-events: none;
}

.device:hover {
  border: 2px solid #a5c63b;
}

.device-image {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -62%);
  pointer-events: none;
  width: 100%;
  text-align: center;
}

.device-image img {
  max-width: 90%;
  max-height: 180px;
  width: auto;
  height: auto;
  display: inline-block;
}

.device-info {
  z-index: 3;
  position: absolute;
  bottom: 0px;
  left: 10px;
  right: 10px; /* Voeg toe: zorgt voor padding aan beide kanten */
  max-width: calc(100% - 20px); /* Voeg toe: voorkomt overflow */
}

.device .device-over {
  display: none;
}

.device:hover .device-over,
.device.selected .device-over,
.device.tapped .device-over {
  display: block; /* Show on hover */
}

.device .device-over {
  text-align: center;
  width: 218px; /* counting without border */
  height: 298px; /* counting without border */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
}

.device.selected .device-over {
  background: url(../../../../packages/billionandroids_package/themes/billionandroids//images/bg-device-selected.png) repeat top left transparent;
}

.device .device-over a {
  display: block;
  background: #a5c63b;
  color: #ffffff;
  border-radius: 4px;
  -o-border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 110%;
  margin: 10px 20px 0 20px;
  text-shadow: 0 1px 1px #666666;
}

.device .device-over a.more-info {
  background: #333333;
}

.device.selected .device-over a.dont-compare-device {
  background: #d90000;
}

.device p.type {
  margin: 0;
  padding: 0;
  font-weight: bold;
  color: #333333;
  line-height: 1.3;
  /* Limit to 2 lines with ellipsis for long device names */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device p.brand {
  font-size: 80%;
  margin: 0;
  padding: 0;
  font-weight: bold;
}

#content {
  padding: 5px 0;
  clear: both;
  position: relative;
  z-index: 1;
  min-height: 400px;
  overflow: visible; /* Changed from hidden to visible to allow sticky positioning */
}

/* Clearfix for main content */
#content:after {
  content: "";
  display: table;
  clear: both;
}

#devices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 10px; /* Explicit row-gap and column-gap for consistent spacing */
  margin: 10px auto;
  max-width: 1840px; /* 8 cards × 220px + 7 gaps × 10px = 1830px + padding */
  position: relative;
  overflow: visible; /* Ensure devices container doesn't interfere with footer */
}

#devices .device {
  flex: 0 0 220px;
  max-width: 220px; /* Prevent stretching on larger screens */
  margin-bottom: 0; /* Gap handles spacing */
  opacity: 1;
  transform: none;
  position: relative;
  overflow: visible;
}

/* Green overlay for selected devices - positioned above image */
.device.selected::before {
  background: url(../../../../packages/billionandroids_package/themes/billionandroids//images/bg-device-selected.png) repeat top left transparent;
  opacity: 1;
}

/* Exclude green overlay for devices in comparison */
#comparison .device.selected::before {
  display: none;
}

/* Device link overlay */
.device .device-link {
  display: block;
  text-decoration: none;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* Device overlay on hover */
.device .device-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 4;
  pointer-events: none; /* Allow clicks to pass through overlay */
}

.device:hover .device-overlay {
  opacity: 1;
}

/* Always show overlay for selected devices */
.device.selected .device-overlay {
  opacity: 1;
}

/* Device overlay buttons */
.device-overlay-btn {
  padding: 0 24px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, opacity 0.6s ease;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  height: 45px; /* Consistent height for buttons and links */
  pointer-events: auto; /* Buttons are clickable */
  /* Better iPad/touch device support */
  -webkit-tap-highlight-color: rgba(165, 198, 59, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation; /* Prevents double-tap zoom on buttons */
}

/* Fade animation for buttons in non-selected devices on hover */
.device:hover .device-overlay-btn {
  opacity: 0;
  animation: fadeInButton 0.6s ease forwards;
}

@keyframes fadeInButton {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Buttons in selected devices are always visible */
.device.selected .device-overlay-btn {
  opacity: 1;
  animation: none;
}

.device-overlay-btn.compare-btn.add-compare {
  background: #a5c63b;
  color: #ffffff;
}

.device-overlay-btn.compare-btn.add-compare:hover {
  background: #8fb328;
}

.device-overlay-btn.compare-btn.remove-compare {
  background: #d90000;
  color: #ffffff;
}

.device-overlay-btn.compare-btn.remove-compare:hover {
  background: #b80000;
}

.device-overlay-btn.specs-btn {
  background: #333333;
  color: #ffffff;
  /* Ensure touch events work properly */
  pointer-events: auto;
}

.device-overlay-btn.specs-btn:hover {
  background: #1a1a1a;
}

.device.tapped .device-overlay-btn.specs-btn,
.device.selected .device-overlay-btn.specs-btn {
  pointer-events: auto !important;
}

.device-overlay-btn.buy-btn {
  background: #e95e27;
  color: #ffffff;
  pointer-events: auto;
  position: relative; /* For tooltip positioning */
}

.device-overlay-btn.buy-btn:hover {
  background: #d45220;
}

/* Homepage Affiliate Tooltip Styles */
.device-overlay-btn.buy-btn .buy-device-info {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  cursor: help;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  z-index: 2;
}

.device-overlay-btn.buy-btn .buy-device-info:hover {
  opacity: 1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
  border-color: #ffffff;
}

.device-overlay-btn.buy-btn .affiliate-tooltip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: 10px;
  background: rgba(51, 51, 51, 0.95);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.3;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 10;
  font-weight: normal;
  text-shadow: none;
  width: auto;
  white-space: normal;
  text-transform: none;
  cursor: default;
}

.device-overlay-btn.buy-btn .affiliate-tooltip::after {
  content: "";
  position: absolute;
  left: 19px; /* Center over left:12px + 7px */
  bottom: -6px;
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(51, 51, 51, 0.95) transparent transparent transparent;
}

.device-overlay-btn.buy-btn .buy-device-info:hover + .affiliate-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Clearfix utility class */
.clearfix {
  clear: both;
  overflow: hidden;
}

.clearfix:after {
  content: "";
  display: table;
  clear: both;
}

/* Loading indicator styling */
.loading {
  text-align: center;
  padding: 40px 20px;
  font-size: 18px;
  color: #666;
  background: #f9f9f9;
  border-radius: 8px;
  margin: 20px 0;
  position: relative;
}

.loading:before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #a5c63b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Infinite scroll loading indicator */
.loading-more {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 20px;
  width: 100%;
}

.loading-spinner {
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(165, 198, 59, 0.2);
  border-top-color: #a5c63b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Error message styling */
.error {
  text-align: center;
  padding: 40px 20px;
  font-size: 16px;
  color: #d32f2f;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  margin: 20px 0;
}

/* Force footer to stay at bottom */
#footer {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #2d2d2d 0%, #1f1f1f 100%);
  color: #eaeaea;
  clear: both;
  padding: 60px 40px 30px;
  position: relative;
  z-index: 1;
  margin-top: 20px;
  border-top: 1px solid #3d3d3d;
}

/* Footer content grid */
.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  text-align: left;
}

/* Footer column base */
.footer-column {
  min-width: 0;
}

/* Branding column */
.footer-branding .footer-logo {
  display: block;
  margin-bottom: 15px;
}

.footer-branding .footer-logo-img {
  max-height: 45px;
  width: auto;
  /* Use moderate brightness with increased saturation to preserve green color */
  filter: brightness(1.25) saturate(1.3);
  transition: filter 0.3s ease;
}

.footer-branding .tagline {
  color: #888888;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 25px 0;
}

/* Social links */
.footer-social-links {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-social-link {
  width: 40px;
  height: 40px;
  background: #3d3d3d;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.footer-social-link:hover {
  background: #a5c63b;
  color: #ffffff;
  transform: translateY(-3px);
}

/* Footer link columns */
.footer-column h4 {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  padding: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

/* Green gradient underline accent */
.footer-column h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #a5c63b, transparent);
  border-radius: 2px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #888888;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Sliding line animation on hover */
.footer-links a::before {
  content: "";
  width: 0;
  height: 2px;
  background: #a5c63b;
  transition: width 0.3s ease;
}

.footer-links a:hover {
  color: #a5c63b;
}

.footer-links a:hover::before {
  width: 12px;
}

/* Footer bottom bar */
.footer-bottom {
  max-width: 1400px;
  margin: 40px auto 0;
  padding-top: 30px;
  border-top: 1px solid #3d3d3d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  text-align: left;
}

.footer-copyright {
  color: #666666;
  font-size: 0.9rem;
  margin: 0;
}

.footer-made-with {
  color: #666666;
  font-size: 0.9rem;
  margin: 0;
}

.footer-made-with .heart {
  color: #e74c3c;
}

/* Footer responsive - Tablet */
@media (max-width: 1024px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 40px 30px;
  }

  .footer-branding {
    grid-column: 1 / -1;
  }
}

/* Footer responsive - Mobile */
@media (max-width: 768px) {
  #footer {
    padding: 40px 20px 25px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 35px;
    text-align: center;
  }

  .footer-branding {
    text-align: center;
  }

  .footer-social-links {
    justify-content: center;
  }

  .footer-column h4 {
    margin-bottom: 15px;
  }

  /* Center the green underline on mobile */
  .footer-column h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-links li {
    margin-bottom: 10px;
  }

  /* Hide sliding line animation on mobile (centered text) */
  .footer-links a::before {
    display: none;
  }

  .footer-links a:hover {
    padding-left: 0;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
  }
}

/* Force footer to clear masonry */
#footer:before {
  content: "";
  display: block;
  clear: both;
  height: 0;
  visibility: hidden;
}

#content-container {
  width: 100%;
  max-width: 900px;
  border: 1px solid #cccccc;
  background: #ffffff;
  margin: 5px 0 25px 0;
  text-align: left;
  overflow: visible; /* Allow sticky positioning to work */
  padding: 20px 16px;
  display: inline-block;
  box-sizing: border-box;
}

#content-container-left {
  float: left;
  padding-right: 10px;
  width: 280px;
  max-width: 100%;
  text-align: center;
  box-sizing: border-box;
}

#content-container-right {
  float: right;
  padding-left: 10px;
  width: calc(100% - 280px);
  max-width: 100%;
  overflow: visible; /* Allow sticky positioning to work */
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  #content-container {
    padding: 20px 12px;
  }
}

#content-container a.compare-device,
#content-container a.share-device {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #a5c63b;
  color: #ffffff;
  border-radius: 4px;
  -o-border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  text-decoration: none;
  padding: 0 20px;
  font-size: 110%;
  margin: 10px 0;
  text-shadow: 0 1px 1px #666666;
  font-weight: 600;
  width: auto;
  text-align: center;
}

#content-container a.compare-device {
  height: 65px;
}

#content-container a.share-device {
  background: #333333;
  height: 55px;
}

#content-container a.buy-device .buy-device-price {
  display: block;
  margin-top: 6px;
  font-size: 85%;
  font-weight: normal;
  color: #ffffff;
}

/* Selected state for compare-device button (red when device is in comparison) */
#content-container a.compare-device.selected {
  background: #d90000;
}

#content-container a.compare-device.selected:hover {
  background: #b80000;
}

#comparison {
  position: fixed;
  bottom: 0;
  width: 100%;
  margin: 0;
  padding: 10px 0;
  background: #a5c63b;
  z-index: 9998; /* Below overlay (9999) */
  display: none; /* Hidden by default, shown when devices are added */
}

#comparison #compare-head {
  padding: 0 0 10px 0;
  border-bottom: 1px dashed #333333;
  margin: 0 0 5px -10px;
}

#comparison #compare-head a {
  color: #ffffff;
  border-radius: 4px;
  -o-border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 90%;
  font-weight: bold;
  width: inherit;
  display: inline-block;
  margin: 0 5px;
}

#comparison p.title {
  margin: 0;
  padding: 0;
  font-size: 220%;
  color: #ffffff;
  font-family: "Copse", Arial, sans-serif;
  font-weight: normal;
  text-shadow: 0 1px 1px #666666;
  line-height: 120%;
}

#comparison .compare-info {
  box-sizing: border-box;
  -o-box-sizing: boder-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  width: 220px;
  margin: 0 5px;
  padding: 0 10px;
  display: inline-block;
  text-align: left;
  position: relative;
  vertical-align: top;
}

#comparison .compare-info p {
  color: #333333;
}

/* Comparison device styling */
/* Device cards in comparison - white background */
#comparison .device.selected {
  position: relative;
  display: inline-block;
  vertical-align: top;
  margin: 0;
  padding: 15px;
  background: #ffffff;
  border-radius: 8px;
  border: none;
  width: 200px;
  min-height: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#comparison .device.selected .device-image {
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
}

#comparison .device.selected .device-image img {
  max-width: 150px;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#comparison .device.selected .device-info {
  padding: 10px 0;
  text-align: left;
}

#comparison .device.selected .device-info .type {
  margin: 0;
  padding: 0;
  font-weight: bold;
  color: #333333;
}

#comparison .device.selected .device-info .brand {
  font-size: 80%;
  margin: 0;
  padding: 0;
  font-weight: bold;
}

#comparison .device.selected .remove-device {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  background: #e95e27;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  text-decoration: none;
  font-size: 22px;
  font-weight: bold;
  display: block;
  transition: all 0.2s ease;
  padding: 0;
}

#comparison .device.selected .remove-device:hover {
  background: #c9460f;
}

/* Comparison header styling */
#comparison #compare-head {
  cursor: pointer;
  position: relative;
  text-align: center;
}

#comparison #compare-head .show-device {
  background: #333333;
  color: #ffffff;
  border-radius: 4px;
  -o-border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 90%;
  font-weight: bold;
  width: inherit;
  display: inline-block;
  margin: 0 5px;
}

#comparison #compare-head .add-device {
  background: #333333;
  color: #ffffff;
  border-radius: 4px;
  -o-border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 90%;
  font-weight: bold;
  width: inherit;
  display: inline-block;
  margin: 0 5px;
}

#comparison #compare-head .clear-comparison {
  background: #e95e27;
  color: #ffffff;
  border-radius: 4px;
  -o-border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 90%;
  font-weight: bold;
  width: inherit;
  display: inline-block;
}

#comparison #compare-head .show-device:hover {
  background: #1a1a1a;
}

#comparison #compare-head .add-device:hover {
  background: #1a1a1a;
}

#comparison #compare-head .clear-comparison:hover {
  background: #c9460f;
}

#comparison #compare-head .compare-count {
  color: #ffffff;
  font-weight: bold;
}

/* ===============================================
   COMPARISON OVERLAY STYLES
   =============================================== */

#comparison-overlay {
  position: fixed;
  top: auto;
  bottom: -110vh;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 9999;
  transition: bottom 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  visibility: visible;
  opacity: 1;
  --category-nav-offset: var(--fallback-nav-offset);
  --device-header-offset: var(--fallback-header-offset);
  --category-stack-offset: calc(
    var(--category-nav-offset) + var(--device-header-offset)
  );
}

#comparison-overlay.active {
  bottom: 0;
  visibility: visible;
  opacity: 1;
}

#comparison-overlay.active.settled {
  bottom: 0;
  transition: none;
}

#comparison-overlay.closing {
  bottom: -110vh;
}

#comparison-overlay.closing,
#comparison-overlay:not(.active) {
  pointer-events: none;
}

@media (max-width: 768px) {
  #comparison-overlay {
    --fallback-nav-offset: 60px;
    --fallback-header-offset: 120px;
  }
}

/* Brand Banner (top of overlay) */
.comparison-brand-banner {
  background: #ffffff;
  padding: 18px 30px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.comparison-brand-banner a {
  display: block;
  line-height: 0;
  transition: opacity 0.3s ease;
}

.comparison-brand-banner a:hover {
  opacity: 0.8;
}

.comparison-brand-banner img {
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@media (max-width: 768px) {
  .comparison-brand-banner {
    padding: 12px 20px;
  }

  .comparison-brand-banner img {
    width: 70%;
    margin: 0 auto;
  }
}

/* Comparison Header Bar (shown at bottom when devices selected) */
.comparison-header-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #333333;
  color: #ffffff;
  padding: 20px 30px;
  border-top: 4px solid #a5c63b;
  z-index: 9998; /* Below overlay (9999) */
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
}

/* Header Bar */
.comparison-header {
  background: #333333;
  color: #ffffff;
  padding: 20px 30px;
  border-top: 4px solid #a5c63b;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.comparison-header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.comparison-header .comparison-header-content {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.comparison-header .comparison-title {
  justify-content: center;
}

.comparison-header .comparison-actions {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .comparison-header .comparison-actions {
    justify-content: center;
    text-align: center;
  }
}

@media (min-width: 769px) {
  .comparison-header .comparison-header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 20px;
  }

  .comparison-header .comparison-title {
    justify-content: flex-start;
  }

  .comparison-header .comparison-actions {
    width: auto;
    max-width: none;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }

  .comparison-header .comparison-actions .comparison-btn {
    flex: 0 0 auto;
  }
}

/* Tablet-specific adjustments for comparison header bar (iPad portrait and landscape) */
@media (min-width: 769px) and (max-width: 1200px) {
  #comparison-header-bar {
    padding: 15px 20px !important;
    box-sizing: border-box !important;
  }

  #comparison-header-bar .comparison-header-content {
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  #comparison-header-bar .comparison-title {
    font-size: 1.3rem !important;
    gap: 6px !important;
    flex-shrink: 1 !important;
  }

  #comparison-header-bar .device-count-badge {
    font-size: 0.75rem !important;
    padding: 3px 7px !important;
  }

  #comparison-header-bar .comparison-actions {
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  #comparison-header-bar .comparison-btn {
    padding: 8px 10px !important;
    font-size: 0.75rem !important;
    min-width: auto !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
}

.comparison-title {
  font-family: "Copse", Arial, sans-serif;
  font-size: 1.8rem;
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
}

.device-count-badge {
  background: #a5c63b;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
}

.comparison-actions {
  display: flex;
  gap: 10px;
}

.comparison-btn {
  background: #666666;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  /* Better iPad/touch device support */
  -webkit-tap-highlight-color: rgba(165, 198, 59, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.comparison-btn:hover {
  background: #4a4a4a;
}

.comparison-btn:focus {
  outline: 3px solid #a5c63b;
  outline-offset: 2px;
}

/* Green border for show/hide buttons - always visible on mobile and desktop */
.comparison-btn.show-device,
.comparison-btn.hide-overlay {
  border: 2px solid #a5c63b;
  background: #333333;
}

.comparison-btn.show-device:hover,
.comparison-btn.hide-overlay:hover {
  background: #1a1a1a;
  border-color: #8fb328;
}

.comparison-btn.clear-btn {
  background: #e95e27;
}

.comparison-btn.clear-btn:hover {
  background: #c9460f;
}

/* Table Container */
.comparison-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f9f9f9;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
}

.comparison-content::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.comparison-content::-webkit-scrollbar-track {
  background: #e0e0e0;
}

.comparison-content::-webkit-scrollbar-thumb {
  background: #a5c63b;
  border-radius: 6px;
}

.comparison-content::-webkit-scrollbar-thumb:hover {
  background: #8fb328;
}

.table-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 30px 20px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .table-wrapper {
    padding: 0 10px 20px 10px;
    overflow-x: hidden;
    width: 100%;
  }
}

/* Category nav is now inside comparison-table, inherit wrapper constraints */
.comparison-table .mobile-category-nav,
.comparison-table .desktop-category-nav {
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .comparison-table .mobile-category-nav {
    padding: 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Comparison Table - Div-based Grid Layout */
.comparison-table {
  display: block;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow-x: visible;
  box-sizing: border-box;
  position: relative;
}

/* Ensure spec-label-cell is visible on desktop - not cut off by overflow */
@media (min-width: 769px) {
  .comparison-table {
    overflow-x: visible;
  }

  .spec-row {
    overflow-x: visible;
  }

  /* Override mobile hiding rule - use same selector as mobile for higher specificity */
  .spec-row > .spec-label-cell {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Border radius on first/last cells */
.comparison-table > .device-header-row > .device-header-cell:first-child {
  border-top-left-radius: 8px;
}

.comparison-table > .device-header-row > .device-header-cell:last-child {
  border-top-right-radius: 8px;
}

/* Mobile Category Navigation - Above device header */
.mobile-category-nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 13; /* Highest */
  background: #ffffff;
  border-bottom: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  background: linear-gradient(to right, #ffffff 90%, rgba(255, 255, 255, 0.3));
  will-change: top;
}

/* Desktop Category Navigation - Above device header */
.desktop-category-nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 13; /* Highest */
  background: #f5f5f5;
  border-bottom: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: none; /* Hidden on mobile by default */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

/* Desktop category nav scrollbar styling - hidden to avoid conflict with active border */
.desktop-category-nav::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari, Edge */
}

/* Mobile category nav scrollbar styling - hidden to avoid conflict with active border */
.mobile-category-nav::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari, Edge */
}

/* Show desktop nav on desktop screens */
@media (min-width: 769px) {
  .desktop-category-nav {
    display: block;
  }

  /* Hide mobile nav on desktop */
  .mobile-category-nav {
    display: none !important;
  }
}

/* Device Header Row - Grid layout, sticky */
.device-header-row {
  display: grid;
  grid-template-columns: 25% 25% 25% 25%;
  position: -webkit-sticky;
  position: sticky;
  top: var(--category-nav-offset);
  z-index: 12;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.desktop-category-nav-list {
  display: flex;
  justify-content: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: max-content;
  white-space: nowrap;
}

.desktop-category-nav-item {
  flex: 0 0 auto;
  min-width: auto;
}

.desktop-category-nav-btn {
  width: auto;
  min-width: fit-content;
  background: transparent;
  border: none;
  padding: 15px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.desktop-category-nav-btn:hover,
.desktop-category-nav-btn:focus {
  background: #eaeaea;
  color: #333333;
}

.desktop-category-nav-btn.active {
  color: #a5c63b;
  border-bottom-color: #a5c63b;
  background: rgba(165, 198, 59, 0.05);
}

.desktop-category-nav-btn:focus {
  outline: 2px solid #333333;
  outline-offset: -2px;
}

/* Device Header Row - sticky with animated shrink */
.device-header-outer {
  display: contents;
}

.device-header-row {
  display: grid;
  position: sticky;
  top: var(--category-nav-offset, 48px);
  z-index: 12;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.device-header-cell {
  padding: 20px 14px;
  text-align: center;
  border-bottom: 3px solid #a5c63b;
  background: #ffffff;
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
  box-sizing: border-box;
  min-width: 0;
  transition: padding 0.3s ease, min-height 0.3s ease;
}

/* Scrolled state - smaller header */
#comparison-overlay.scrolled .device-header-cell {
  padding: 10px;
  min-height: 100px;
}

#comparison-overlay.scrolled .device-image-small {
  width: 60px;
  height: 60px;
  max-width: 60px;
  max-height: 60px;
}

#comparison-overlay.scrolled .device-name-large {
  font-size: 0.8rem;
}

#comparison-overlay.scrolled .device-brand-small {
  font-size: 0.65rem;
}

#comparison-overlay.scrolled .device-remove-small {
  width: 24px;
  height: 24px;
  font-size: 16px;
  top: 4px;
  right: 4px;
}

/* Content wrapper */
.device-header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Spacer for scroll compensation */
.header-height-spacer {
  height: 0;
  transition: height 0.3s ease;
}

#comparison-overlay.scrolled .device-header-cell:first-child {
  align-items: center;
  justify-content: flex-start;
}

.device-header-cell:first-child {
  background: #f5f5f5;
  border-bottom-color: #e0e0e0;
  text-align: left;
  font-weight: bold;
  color: #666666;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 11;
  align-items: center;
  justify-content: flex-start;
  will-change: padding, min-height, background-color, border-bottom-color;
}

.device-header-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: 100%;
  height: 100%;
}

.device-header-link:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.device-header-link:active {
  transform: translateY(0);
}

.device-header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  transition: gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  transform: translateZ(0); /* Force GPU acceleration */
  position: relative;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
  padding-top: 0;
}

.device-image-small {
  width: 120px;
  height: 120px;
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
  transform: translateZ(0);
  position: relative;
  z-index: 1;
  margin-top: 0;
  margin-bottom: 0;
  display: block;
  backface-visibility: hidden;
  transition: width 0.3s ease, height 0.3s ease, max-width 0.3s ease,
    max-height 0.3s ease;
  -webkit-backface-visibility: hidden;
}

.device-name-large {
  font-weight: bold;
  color: #333333;
  line-height: 1.3;
  transition: font-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: auto;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  margin: 0;
}

.device-brand-small {
  font-size: 0.85rem;
  color: #666666;
  font-weight: 600;
  line-height: 1;
  transition: font-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: auto;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  margin: 0;
}

/* Scrolled content styles defined earlier at line ~1721 */

.device-remove-small {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e95e27;
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s ease, height 0.3s ease, font-size 0.3s ease,
    top 0.3s ease, right 0.3s ease;
  transition: all 0.2s ease;
  line-height: 0;
  padding: 0;
  margin: 0;
  text-align: center;
  z-index: 15; /* Ensure remove button is above the link */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.device-remove-small::before {
  content: "×";
  display: block;
  transform: translateY(
    -1px
  ); /* Shift up to compensate for font baseline offset */
}

.device-remove-small:hover {
  background: #c9460f;
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.device-remove-small:focus {
  outline: 3px solid #333333;
  outline-offset: 2px;
}

/* Category Header Rows */
.category-header-row {
  display: grid;
  grid-template-columns: 1fr;
  background: #f5f5f5;
  scroll-margin-top: calc(
    var(--category-stack-offset) + var(--category-section-gap)
  );
  width: 100%;
}

.category-header-cell {
  padding: 15px 20px;
  padding-left: 24px; /* Extra padding for colored border */
  text-align: left;
  font-weight: bold;
  font-size: 1.1rem;
  color: #333333;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-top: 2px solid #e0e0e0;
  border-bottom: 2px solid #e0e0e0;
}

/* Color-coded category borders - Comparison Overlay */
.category-general,
.category-device-general {
  border-left: 4px solid #a5c63b; /* BillionAndroids Brand Green */
}

.category-display,
.category-device-display,
.category-display-ii,
.category-device-display-ii,
.category-secondary-display {
  border-left: 4px solid #ffd700; /* Gold/Yellow */
}

.category-body,
.category-device-body {
  border-left: 4px solid #e17055; /* Coral/Orange */
}

.category-camera-main,
.category-device-camera-main,
.category-main-camera {
  border-left: 4px solid #4ecdc4; /* Teal/Turquoise */
}

.category-camera-selfie,
.category-device-camera-selfie,
.category-selfie-camera {
  border-left: 4px solid #00b894; /* Green */
}

.category-network,
.category-device-network {
  border-left: 4px solid #0984e3; /* Blue */
}

.category-platform,
.category-device-platform {
  border-left: 4px solid #a29bfe; /* Light Purple */
}

.category-memory,
.category-device-memory {
  border-left: 4px solid #fd79a8; /* Pink */
}

.category-sound,
.category-device-sound {
  border-left: 4px solid #fdcb6e; /* Light Orange/Yellow */
}

.category-comms,
.category-device-comms,
.category-connectivity {
  border-left: 4px solid #74b9ff; /* Light Blue */
}

.category-features,
.category-device-features {
  border-left: 4px solid #55efc4; /* Mint Green */
}

.category-battery,
.category-device-battery {
  border-left: 4px solid #00b894; /* Green - changed to match battery theme */
}

/* Spec Rows */
.spec-row {
  display: grid;
  grid-template-columns: 25% 25% 25% 25%;
  transition: background-color 0.2s ease;
  width: 100%;
  overflow: visible;
  box-sizing: border-box;
  min-width: 0;
}

/* Ensure spec-label-cell is visible on desktop (override mobile hiding) */
@media (min-width: 769px) {
  .spec-row > .spec-label-cell {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

.spec-row:nth-child(even) {
  background: #fafafa;
}

.spec-row:hover {
  background: #f0f8ff;
}

.spec-label-cell {
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  color: #333333;
  font-style: italic;
  border-right: 2px solid #e0e0e0;
  background: #f9f9f9;
  box-sizing: border-box;
  min-width: 0;
}

.spec-value-cell {
  padding: 16px 20px;
  text-align: center;
  color: #666666;
  border-left: 1px solid #f0f0f0;
  box-sizing: border-box;
  min-width: 0;
}

.spec-value-cell:last-child {
  border-right: none;
}

/* Better value - highlight */
.spec-value-best {
  font-weight: bold;
  color: #2c7a2f;
  background: #e8f5e9;
}

/* Responsive Design */
@media (max-width: 1400px) {
  .comparison-table {
    font-size: 0.9rem;
  }

  .device-header-cell {
    padding: 14px 8px;
    min-height: 168px;
  }

  #comparison-overlay.scrolled .device-header-cell {
    padding: 14px 8px;
    min-height: 168px;
  }

  #comparison-overlay.scrolled .device-header-content {
    gap: 10px;
  }

  .device-image-small {
    width: 112px;
    height: 112px;
    max-width: 112px;
    max-height: 112px;
    transform: translateZ(0) scale(1);
  }

  #comparison-overlay.scrolled .device-image-small {
    transform: translateZ(0) scale(1);
  }

  .spec-label-cell,
  .spec-value-cell {
    padding: 10px 10px; /* Reduced from 12px for tablets */
  }
}

/* IMPROVED MOBILE VIEW - Table-based with category navigation */
/* Only apply mobile styles to phones (≤768px), not tablets like iPad */
@media (max-width: 768px) {
  /* Prevent horizontal scroll on mobile */
  .comparison-content {
    overflow-x: hidden !important;
  }

  /* Mobile: Comparison header bar at bottom */
  #comparison-header-bar {
    padding: 15px 0 !important;
  }

  /* Mobile: Inner content container */
  #comparison-header-bar .comparison-header-content {
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 15px !important;
    gap: 10px !important;
  }

  /* Mobile: Title */
  #comparison-header-bar .comparison-title {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.5rem !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Mobile: Actions container */
  #comparison-header-bar .comparison-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    gap: 5px !important;
  }

  /* Mobile: Smaller buttons to fit in viewport */
  .comparison-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
    min-width: auto;
    flex: 0 1 auto;
    white-space: nowrap;
    box-sizing: border-box;
    border: 2px solid transparent;
  }

  /* Show button keeps its green border */
  .comparison-btn.show-device {
    border-color: #a5c63b;
  }

  /* Extra small for share button text */
  .comparison-btn.share-btn {
    padding: 8px 8px;
  }

  /* Very small screens - make buttons even smaller */
  @media (max-width: 390px) {
    .comparison-btn {
      padding: 8px 6px;
      font-size: 0.7rem;
    }

    .comparison-btn.show-device {
      border-color: #a5c63b;
    }

    .comparison-btn.share-btn {
      padding: 8px 4px;
    }
  }

  .device-image-small {
    width: 98px;
    height: 98px;
    max-width: 98px;
    max-height: 98px;
    transform: translateZ(0) scale(1);
  }

  .device-header-cell {
    padding: 14px 7px;
    min-height: 140px;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      min-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #comparison-overlay.scrolled .device-header-cell {
    padding: 8px 5px;
    min-height: 100px;
  }

  #comparison-overlay.scrolled .device-header-content {
    gap: 6px;
  }

  #comparison-overlay.scrolled .device-image-small {
    width: 70px;
    height: 70px;
    max-width: 70px;
    max-height: 70px;
    transform: translateZ(0) scale(1);
  }

  /* Hide desktop category navigation */
  .desktop-category-nav {
    display: none !important;
  }

  /* Show mobile category navigation */
  .mobile-category-nav {
    display: flex !important;
  }

  /* Mobile nav at very top */
  .mobile-category-nav {
    position: sticky;
    top: 0;
    z-index: 13; /* Highest */
    display: flex !important;
  }

  .category-header-cell {
    font-size: 1rem;
    padding: 12px 10px;
  }

  /* Device header restructure on mobile */
  .device-header-row {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
    box-sizing: border-box;
    display: grid;
  }

  /* Hide "Specification" label on mobile and adjust grid */
  .device-header-cell:first-child {
    display: none !important;
    grid-column: 1;
  }

  /* Ensure device header cells fit properly on mobile - dynamic based on device count */
  .device-header-row[data-device-count="1"] {
    grid-template-columns: 1fr !important;
  }
  .device-header-row[data-device-count="2"] {
    grid-template-columns: 1fr 1fr !important;
  }
  .device-header-row[data-device-count="3"] {
    grid-template-columns: 1fr 1fr 1fr !important;
  }

  .device-header-cell:not(:first-child) {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Ensure device images are visible on mobile */
  .device-header-cell:not(:first-child) .device-image-small {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Ensure sticky positioning works on mobile */
  .device-header-row {
    position: sticky !important;
    display: grid !important;
    -webkit-position: sticky !important;
  }

  /* Ensure category nav is sticky on mobile */
  .mobile-category-nav {
    position: sticky !important;
    -webkit-position: -webkit-sticky !important;
    top: 0 !important;
    z-index: 13 !important;
    display: flex !important;
  }

  /* Ensure comparison-table allows sticky positioning - no overflow on parent */
  .comparison-table {
    position: relative;
    overflow: visible;
  }

  /* Ensure comparison-content is the scrolling container */
  .comparison-content {
    position: relative;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* Sticky positioning works when parent has overflow */
  }

  /* Ensure table-wrapper doesn't break sticky */
  .table-wrapper {
    overflow: visible !important;
  }

  .device-name-large {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .device-brand-small {
    font-size: 0.75rem;
    line-height: 1;
  }

  #comparison-overlay.scrolled .device-image-small {
    transform: translateZ(0) scale(1);
  }

  #comparison-overlay.scrolled .device-name-large {
    font-size: 0.65rem;
    line-height: 1.2;
    margin: 0;
  }

  #comparison-overlay.scrolled .device-brand-small {
    font-size: 0.6rem;
    line-height: 1;
    margin: 0;
  }

  /* MOBILE: Parameter name above values */
  .spec-row {
    display: grid !important;
    padding: 10px 0 5px 0;
    border-bottom: 1px solid #e0e0e0;
    background: #ffffff;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* Mobile grid columns based on device count */
  .spec-row[data-device-count="1"] {
    grid-template-columns: 1fr !important;
  }
  .spec-row[data-device-count="2"] {
    grid-template-columns: 1fr 1fr !important;
  }
  .spec-row[data-device-count="3"] {
    grid-template-columns: 1fr 1fr 1fr !important;
  }

  /* Ensure spec-label-cell is visible on mobile - displayed above values */
  .spec-row > .spec-label-cell {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Ensure spec value cells fit properly on mobile - centered alignment */
  .spec-row > .spec-value-cell {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    text-align: center !important;
    padding: 0;
  }

  .spec-row > .spec-value-cell:first-of-type {
    text-align: center !important;
  }

  .spec-row:nth-child(even) {
    background: #fafafa;
  }

  .spec-row:hover {
    background: #f0f8ff;
  }

  .spec-label-cell {
    grid-column: 1 / -1;
    width: 100%;
    padding: 0 10px 8px 10px; /* Reduced from 12px to 8px for compactness */
    font-size: 0.95rem;
    font-weight: bold;
    color: #333333;
    border-right: none;
    background: transparent;
    text-align: left;
    border-bottom: 2px solid #a5c63b;
    margin-bottom: 8px; /* Reduced from 12px to 8px */
  }

  .spec-value-cell {
    padding: 6px 5px; /* Reduced from 8px to 6px for compactness */
    font-size: 0.85rem;
    text-align: center;
    border-left: none;
    vertical-align: top;
    word-break: break-word;
    box-sizing: border-box;
    overflow: hidden;
    max-width: 33.333%;
  }

  .spec-value-cell:first-of-type {
    text-align: left;
    padding-left: 8px; /* Slightly reduced for compactness */
  }

  .spec-value-cell:last-of-type {
    text-align: right;
    padding-right: 8px; /* Slightly reduced for compactness */
  }

  /* Remove button smaller */
  .device-remove-small {
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 0;
    padding: 0;
    top: 6px;
    right: 6px;
    z-index: 15;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }

  .device-remove-small::before {
    transform: translateY(-1px); /* Same offset for mobile */
  }
}

/* Mobile Category Navigation Bar */
.mobile-category-nav {
  display: none;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  border-bottom: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.mobile-category-nav::-webkit-scrollbar {
  height: 4px;
}

.mobile-category-nav::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.mobile-category-nav::-webkit-scrollbar-thumb {
  background: #a5c63b;
  border-radius: 2px;
}

.category-nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-nav-item {
  flex: 0 0 auto; /* Don't shrink, allow natural width */
  min-width: auto;
}

.category-nav-btn {
  background: transparent;
  border: none;
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap; /* Never wrap */
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-nav-btn:hover,
.category-nav-btn:focus {
  background: #f5f5f5;
  color: #333333;
}

.category-nav-btn.active {
  color: #a5c63b;
  border-bottom-color: #a5c63b;
  background: rgba(165, 198, 59, 0.05);
}

.category-nav-btn:focus {
  outline: 2px solid #333333;
  outline-offset: -2px;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 3px solid #333333;
  outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* No devices message styling */
.no-devices-message {
  padding: 20px;
  margin: 20px auto;
  max-width: 600px;
  text-align: center;
}

.no-device-error-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.no-device-filters {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
  text-align: left;
}

.no-device-filter-item {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

.no-device-filter-item:last-child {
  border-bottom: none;
}

.no-device-filter-item strong {
  color: #495057;
  font-weight: 600;
  margin-right: 8px;
}

/* Mobile-specific styles (for devices with a width of 768px or less) */
@media (max-width: 992px) {
  #filtercontainer .filter-controls {
    gap: 16px;
    padding: 0 20px;
  }

  #search {
    flex: 0 0 auto;
  }

  #search form {
    gap: 0;
  }

  #search form input {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: 1 1 220px;
  }
}

@media only screen and (max-width: 768px) {
  /* Homepage */
  a.logo,
  a.logo img {
    width: 70%;
  }

  /* Footer logo - same sizing as header logo on mobile */
  .footer-branding .footer-logo,
  .footer-branding .footer-logo-img {
    width: 90%;
    max-height: none;
    margin: 0 auto;
    padding-bottom: 10px;
  }
  a.filterbutton,
  a.comparebutton {
    padding: 10px 16px;
    margin-left: 0;
  }

  #filtercontainer .filter-controls {
    gap: 12px;
    padding: 0 16px;
  }

  #filter,
  #compare,
  #search {
    width: auto;
  }
  #search form input {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: 1 1 auto;
  }
  #search form {
    gap: 0;
  }
  #search form .search-submit-btn {
    flex: 0 0 43px;
  }
  .device {
    width: 45%;
    height: 250px;
    margin: 0;
  } /* Remove any margins that could affect spacing */

  /* Override height for comparison cards (3 items instead of 2) */
  #comparison .device.selected {
    height: 185px !important; /* 250px * (33.333/45) = proportioneel */
  }
  .device .device-over {
    width: 100%;
    height: 250px;
  }
  .device img {
    height: 150px;
  }

  /* Mobile device image positioning - closer to top */
  .device-image {
    top: 5%; /* Half of the current 50% positioning */
    transform: translateX(-50%); /* Only horizontal centering for mobile */
    pointer-events: auto !important; /* Enable clicks on mobile for tap-to-toggle */
  }

  /* Also enable clicks on image itself - override any pointer-events: none */
  .device-image img,
  .device .device-link img {
    pointer-events: auto !important; /* Enable clicks on image on mobile */
  }

  /* Flexbox mobile adjustments */
  #devices .device {
    flex: 0 0 45%; /* Mobile: 45% width instead of fixed 220px */
  }
  #header h1,
  #header p.pay-off {
    margin: 15px 10px 0 10px;
  }
  #filter-dropdown .filter-part {
    width: 44%;
    margin-bottom: 25px;
  }
  #filter-dropdown .filter-part select {
    width: 95%;
  }

  /* Device page */
  #filtercontainer h1 span {
    display: block;
    padding: 15px 0 0 0;
  }
  #content-container {
    width: 90%;
  }
  #content-container-left {
    width: 100%;
    text-align: center;
  }
  #content-container-left img {
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
  }
  #content-container-right {
    float: left;
    padding: 20px 5px 0 5px;
    width: 100%;
    overflow: visible; /* Allow sticky positioning to work */
  }

  /* Mobile: Allow chosenfilters to wrap and expand */
  #chosenfilters {
    height: auto;
    min-height: 38px;
    overflow: visible;
  }

  /* Mobile: Clear filters on separate line */
  #chosenfilters ul li.clear-all {
    display: block;
    width: 100%;
    margin-top: 10px;
  }

  /* Mobile: Show overlay when device is tapped */
  .device.tapped .device-overlay,
  .device.selected .device-overlay {
    opacity: 1 !important;
  }

  /* Mobile: Green border for tapped cards (same as hover on desktop) */
  .device.tapped {
    border: 2px solid #a5c63b;
  }

  /* Mobile: Disable hover effects (not applicable on touch devices) */
  .device:hover .device-overlay:not(.tapped):not(.selected) {
    opacity: 0; /* Keep hidden on hover for mobile, unless tapped/selected */
  }

  /* Mobile: Only enable pointer events when overlay is visible (tapped or selected) */
  .device .device-overlay {
    pointer-events: none !important; /* Disable clicks when hidden */
  }

  .device.tapped .device-overlay,
  .device.selected .device-overlay {
    pointer-events: auto !important; /* Enable clicks when visible */
  }

  /* Buttons should only be clickable when overlay is visible */
  .device:not(.tapped):not(.selected) .device-overlay-btn {
    pointer-events: none !important; /* Disable button clicks when overlay is hidden */
  }

  /* Ensure buttons are touch-enabled on iPad and other touch devices when visible */
  .device.tapped .device-overlay-btn,
  .device.selected .device-overlay-btn {
    pointer-events: auto !important;
    cursor: pointer;
  }

  /* Mobile: Comparison layout adjustments */
  .comparison-devices-header {
    gap: 8px;
    margin-bottom: 30px;
    padding: 0 2px;
  }

  #comparison .device.selected {
    width: calc(33.333% - 6px);
    min-width: 100px;
    max-width: 120px;
    height: 185px; /* 250px * (33.333/45) = proportioneel met mobile device cards (2 items -> 3 items) */
    padding: 5px 3px;
  }

  #comparison .device.selected .device-image {
    margin-top: 27px; /* Ruimte voor remove button (22px hoogte + 3px top + iets extra) */
    margin-bottom: 3px;
  }

  #comparison .device.selected .device-image img {
    max-width: 95px; /* Iets kleiner om overlap met button te voorkomen */
    max-height: 95px; /* Iets kleiner om overlap met button te voorkomen */
  }

  #comparison .device.selected .remove-device {
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 16px;
    top: 3px;
    right: 3px;
  }

  #comparison .device.selected .device-info {
    padding: 2px 0;
  }

  #comparison .device.selected .device-info .type {
    font-size: 13px;
    line-height: 1.2;
  }

  #comparison .device.selected .device-info .brand {
    font-size: 11px;
    line-height: 1.2;
  }

  .comparison-category-title {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
  }

  .comparison-parameter {
    margin-bottom: 20px;
  }

  .comparison-parameter-name {
    font-size: 14px;
  }

  .comparison-parameter-values-row {
    gap: 15px;
    flex-direction: column;
  }

  .comparison-parameter-value {
    font-size: 14px;
    min-width: 100%;
    max-width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
  }

  .comparison-parameter-value:last-child {
    border-bottom: none;
  }

  /* Mobile: Show device labels for clarity */
  .comparison-parameter-value .device-value-label {
    display: inline;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-right: 8px;
  }

  .comparison-parameter-value .device-value {
    display: inline;
    color: rgba(255, 255, 255, 0.85);
  }
}

@media (max-width: 480px) {
  #filtercontainer .filter-controls {
    gap: 6px;
    padding: 0 10px;
    flex-wrap: nowrap;
  }

  a.filterbutton,
  a.comparebutton {
    padding: 8px 10px;
    font-size: 95%;
    min-width: auto;
  }

  #filter,
  #search {
    width: auto;
  }

  #filter {
    justify-content: center;
  }

  #search form {
    gap: 0;
    width: auto;
  }

  #search form input {
    width: auto;
    max-width: none;
    height: 38px;
    line-height: 38px;
    padding: 0 10px;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 100%;
  }

  #search form .search-submit-btn {
    height: 38px;
    width: 38px;
    min-width: 38px;
    flex: 0 0 38px;
  }
}

/* Device Image Carousel Styles */
.device-image-carousel {
  position: relative;
  width: 100%;
  max-width: 270px;
  margin: 0 auto;
  padding-bottom: 25px;
}

.device-image-carousel .carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.device-image-carousel .carousel-slide {
  display: none;
  width: 100%;
  height: 270px;
  justify-content: center;
  align-items: center;
}

.device-image-carousel .carousel-slide.active {
  display: flex;
}

.device-image-carousel .carousel-slide picture {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.device-image-carousel .carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.device-image-carousel .carousel-btn {
  position: absolute;
  top: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border: none;
  width: 40px;
  height: 40px;
  font-size: 28px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  margin: 0;
  text-align: center;
  transform: translateY(-50%);
  font-family: Arial, sans-serif;
}

.device-image-carousel .carousel-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.device-image-carousel .carousel-prev {
  left: 10px;
  transform: translate(0, -50%);
  padding-bottom: 3px; /* Compensate for baseline offset */
}

.device-image-carousel .carousel-next {
  right: 10px;
  transform: translate(0, -50%);
  padding-bottom: 3px; /* Compensate for baseline offset */
}

.device-image-carousel .carousel-dots-wrapper {
  overflow: hidden;
  max-width: 166px; /* 10 dots: 10*14px (10px dot + ~4px gap) */
  margin: 15px auto 0;
  display: flex;
  justify-content: center;
}

.device-image-carousel .carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0;
  transition: transform 0.3s ease;
}

.device-image-carousel .carousel-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  border: 2px solid #a5c63b;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.device-image-carousel .carousel-dot:hover {
  background: rgba(165, 198, 59, 0.5);
}

.device-image-carousel .carousel-dot.active {
  background: #a5c63b;
}

/* Clickable carousel images */
.device-image-carousel .carousel-image-trigger,
.device-image-single .single-image-trigger,
.device-image-single picture.single-image-trigger {
  cursor: zoom-in;
}

.device-image-single {
  width: 100%;
  max-width: 150px;
  margin: 0 auto;
  padding-bottom: 25px;
}

.device-image-single img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Mobile adjustments for carousel */
@media (max-width: 768px) {
  .device-image-carousel {
    max-width: 100%;
  }

  .device-image-carousel .carousel-slide {
    height: 300px; /* Fixed height to prevent page jumping between slides */
    min-height: 300px;
  }

  .device-image-carousel .carousel-slide picture {
    width: 100%;
    justify-content: center;
  }

  .device-image-carousel .carousel-slide img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 290px; /* Slightly less than container height for padding */
    margin: 0 auto;
    object-fit: contain;
  }

  .device-image-single {
    max-width: 100%;
  }

  .device-image-single img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 250px;
    margin: 0 auto;
    object-fit: contain;
  }

  .device-image-carousel .carousel-btn {
    width: 35px;
    height: 35px;
    font-size: 24px;
  }

  .device-image-carousel .carousel-prev {
    left: 5px;
    transform: translate(0, -50%);
    padding-bottom: 3px;
  }

  .device-image-carousel .carousel-next {
    right: 5px;
    transform: translate(0, -50%);
    padding-bottom: 3px;
  }
}

/* ===============================================
   FULLSCREEN IMAGE LIGHTBOX
   =============================================== */

.image-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.image-lightbox.active {
  display: flex;
}

.lightbox-content {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90vw;
  max-height: 85vh;
}

.lightbox-picture {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: #333;
  font-size: 40px;
  cursor: pointer;
  z-index: 10001;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 15px 20px;
  z-index: 10001;
  opacity: 0.9;
  transition: opacity 0.2s ease, background 0.2s ease;
  line-height: 1;
}

.lightbox-nav:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(51, 51, 51, 0.8);
  color: #fff;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 20px;
  opacity: 0.9;
}

/* Hide nav buttons when only one image */
.image-lightbox.single-image .lightbox-nav,
.image-lightbox.single-image .lightbox-counter {
  display: none;
}

/* Mobile adjustments for lightbox */
@media (max-width: 768px) {
  .lightbox-nav {
    padding: 10px 15px;
    font-size: 20px;
  }

  .lightbox-prev {
    left: 5px;
  }

  .lightbox-next {
    right: 5px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    font-size: 32px;
  }

  .lightbox-image {
    max-width: 95vw;
    max-height: 80vh;
  }

  .lightbox-counter {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ===============================================
   SHARE COMPARISON MODAL STYLES
   =============================================== */

/* Share button styling (matches existing comparison buttons) */
.comparison-btn.share-btn {
  background: #4caf50;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.comparison-btn.share-btn:hover {
  background: #45a049;
}

/* Share modal overlay */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.share-modal.active {
  display: flex !important;
}

/* Share modal content box */
.share-modal-content {
  background: #ffffff;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  position: relative;
  margin: auto;
}

/* Share modal header */
.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.share-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
  color: #333333;
}

.share-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #999999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  transition: color 0.3s ease;
  /* Better iPad/touch device support */
  -webkit-tap-highlight-color: rgba(165, 198, 59, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.share-modal-close:hover {
  color: #333333;
}

/* Share modal body */
.share-modal-body {
  padding: 24px;
}

/* Share link container (input + button) */
.share-link-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
}

#share-link-input {
  flex: 1;
  padding: 12px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: monospace;
  color: #333333;
  background: #f9f9f9;
}

#share-link-input:focus {
  outline: none;
  border-color: #4caf50;
  background: #ffffff;
}

.copy-link-btn {
  background: #2196f3;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  /* Better iPad/touch device support */
  -webkit-tap-highlight-color: rgba(33, 150, 243, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.copy-link-btn:hover {
  background: #1976d2;
}

/* Social share section */
.share-social {
  margin-top: 24px;
}

.share-social p {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #666666;
  font-weight: bold;
}

.share-social-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Social share buttons */
.share-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 4px;
  text-decoration: none;
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  /* Better iPad/touch device support */
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.share-social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-social-btn.facebook {
  background: #1877f2;
}

.share-social-btn.facebook:hover {
  background: #145dbf;
}

.share-social-btn.twitter {
  background: #1da1f2;
}

.share-social-btn.twitter:hover {
  background: #0d8bd9;
}

.share-social-btn.whatsapp {
  background: #25d366;
}

.share-social-btn.whatsapp:hover {
  background: #1eaa52;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .share-modal-content {
    width: 95%;
  }

  .share-modal-header {
    padding: 16px 20px;
  }

  .share-modal-header h3 {
    font-size: 18px;
  }

  .share-modal-body {
    padding: 20px;
  }

  .share-link-container {
    flex-direction: column;
    gap: 8px;
  }

  #share-link-input {
    width: 100%;
    font-size: 12px;
  }

  .copy-link-btn {
    width: 100%;
    padding: 12px;
  }

  .share-social-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .comparison-btn {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 100px;
  }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
  .share-modal-header h3 {
    font-size: 16px;
  }

  .share-modal-body {
    padding: 16px;
  }

  #share-link-input {
    font-size: 11px;
    padding: 10px;
  }
}

/* ============================================================================
   DEVICE DETAIL PAGE SPECS TABLE
   ============================================================================ */

/* Device Specs Container */
.device-specs-container {
  width: 100%;
  margin-top: 30px;
  position: relative;
}

.device-specs-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 0 30px 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: visible !important; /* Ensure sticky positioning works - same as comparison overlay */
}

@media (max-width: 768px) {
  .device-specs-wrapper {
    padding: 0 0 20px 0;
  }
}

/* Category Navigation (sticky on detail page) - same approach as comparison overlay */
.device-specs-category-nav {
  position: -webkit-sticky;
  position: sticky !important;
  top: 0 !important;
  z-index: 13; /* Same as comparison overlay */
  background: #f5f5f5;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  will-change: top; /* Same as comparison overlay */
}

.device-category-nav-list {
  display: flex;
  justify-content: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: max-content;
  white-space: nowrap;
}

.device-category-nav-item {
  flex: 0 0 auto;
  min-width: auto;
}

.device-category-nav-btn {
  width: auto;
  min-width: fit-content;
  background: transparent;
  border: none;
  padding: 15px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  font-family: inherit;
}

.device-category-nav-btn:hover,
.device-category-nav-btn:focus {
  background: #eaeaea;
  color: #333333;
}

.device-category-nav-btn.active {
  color: #a5c63b;
  border-bottom-color: #a5c63b;
  background: rgba(165, 198, 59, 0.05);
}

/* Category nav scrollbar styling - hidden to avoid conflict with active border */
.device-specs-category-nav::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari, Edge */
}

/* Device Specs Table */
.device-specs-table-wrapper {
  width: 100%;
  box-sizing: border-box;
  overflow: visible !important; /* Ensure sticky positioning works - same as comparison overlay */
}

.device-specs-table {
  display: block;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow-x: visible;
  overflow-y: visible; /* Ensure no overflow blocks sticky */
  box-sizing: border-box;
  position: relative;
}

/* Category Header Row */
.device-category-header-row {
  display: grid;
  grid-template-columns: 50% 50%;
  background: #f5f5f5 !important; /* !important for Chrome compatibility */
  border-bottom: 2px solid #e0e0e0; /* Grey instead of green */
  scroll-margin-top: 70px; /* Offset for sticky category nav when scrolling */
}

.device-category-header-cell {
  padding: 18px 20px; /* Keep original size for category headers */
  font-weight: 700;
  font-size: 1.1rem;
  color: #333333;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-right: 1px solid #e0e0e0;
  position: relative;
  padding-left: 24px; /* Original padding for colored border */
  background: transparent !important; /* Prevent Chrome override */
}

/* Color-coded category borders for detail page - match comparison overlay */
.device-category-header-cell.category-general {
  border-left: 4px solid #a5c63b; /* BillionAndroids Brand Green */
}

.device-category-header-cell.category-display {
  border-left: 4px solid #ffd700; /* Gold/Yellow */
}

.device-category-header-cell.category-body {
  border-left: 4px solid #e17055; /* Coral/Orange */
}

.device-category-header-cell.category-camera-main,
.device-category-header-cell.category-main-camera {
  border-left: 4px solid #4ecdc4; /* Teal/Turquoise */
}

.device-category-header-cell.category-camera-selfie,
.device-category-header-cell.category-selfie-camera {
  border-left: 4px solid #00b894; /* Green */
}

.device-category-header-cell.category-network {
  border-left: 4px solid #0984e3; /* Blue */
}

.device-category-header-cell.category-platform {
  border-left: 4px solid #a29bfe; /* Light Purple */
}

.device-category-header-cell.category-memory {
  border-left: 4px solid #fd79a8; /* Pink */
}

.device-category-header-cell.category-sound {
  border-left: 4px solid #fdcb6e; /* Light Orange/Yellow */
}

.device-category-header-cell.category-comms,
.device-category-header-cell.category-connectivity {
  border-left: 4px solid #74b9ff; /* Light Blue */
}

.device-category-header-cell.category-features {
  border-left: 4px solid #55efc4; /* Mint Green */
}

.device-category-header-cell.category-battery {
  border-left: 4px solid #00b894; /* Green */
}

.device-category-header-cell:last-child {
  border-right: none;
}

/* Spec Row - Desktop: 2 columns (label | value) */
.device-spec-row {
  display: grid;
  grid-template-columns: 50% 50%;
  border-bottom: 1px solid #e0e0e0;
  background: #ffffff;
}

.device-spec-row:last-child {
  border-bottom: none;
}

.device-spec-label-cell {
  padding: 15px 20px; /* Original desktop padding */
  font-weight: 600;
  color: #666666;
  border-right: 1px solid #e0e0e0;
  background: #fafafa !important; /* !important for Chrome compatibility */
  display: flex;
  align-items: center; /* Perfect vertical centering */
}

.device-spec-value-cell {
  padding: 15px 20px; /* Original desktop padding */
  color: #333333;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: #ffffff !important; /* !important for Chrome compatibility */
  display: flex;
  align-items: center; /* Perfect vertical centering */
}

/* Empty category message */
.device-spec-row.device-spec-empty-message {
  grid-template-columns: 1fr;
}

.device-spec-empty-message .device-spec-value-cell {
  text-align: center;
  font-style: italic;
  color: #999999;
  padding: 20px;
}

/* Mobile: Stack layout (label above value) */
@media (max-width: 768px) {
  .device-specs-wrapper {
    padding: 0 0 20px 0;
    overflow: visible !important; /* Ensure sticky positioning works */
  }

  /* Ensure sticky positioning works on mobile - same as comparison overlay */
  .device-specs-category-nav {
    position: sticky !important;
    -webkit-position: -webkit-sticky !important;
    top: 0 !important;
    z-index: 13 !important;
    display: block !important;
  }

  .device-specs-table-wrapper {
    overflow: visible !important;
  }

  .device-specs-table {
    overflow: visible !important;
    position: relative;
  }

  .device-category-header-row {
    grid-template-columns: 1fr;
  }

  .device-category-header-cell {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 14px 15px; /* Keep headers reasonably sized on mobile */
    padding-left: 19px; /* For colored border */
  }

  .device-category-header-cell:last-child {
    border-bottom: none;
  }

  .device-spec-row {
    grid-template-columns: 1fr;
    padding: 0; /* Remove row padding, use cell padding instead */
  }

  .device-spec-label-cell {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 12px; /* Compact padding */
    min-height: 36px; /* Slightly smaller on mobile */
  }

  .device-spec-value-cell {
    padding: 8px 12px; /* Consistent padding */
    min-height: 36px; /* Slightly smaller on mobile */
  }

  .device-category-nav-btn {
    padding: 12px 16px;
    font-size: 0.85rem;
  }
}

/* Hover effect on rows */
.device-spec-row:hover {
  background: #f9f9f9 !important;
}

.device-spec-row:hover .device-spec-label-cell {
  background: #f5f5f5 !important;
}

.device-spec-row:hover .device-spec-value-cell {
  background: #f9f9f9 !important;
}

/* Device Cards Template Styling */

.featured-comparisons-cards {
  background: transparent;
  padding: 20px 20px 40px 20px;
  margin: 20px 0;
}

.featured-comparisons-cards-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.featured-comparisons-cards h3 {
  color: #333;
  font-size: 28px;
  font-weight: bold;
  margin: 0 0 10px 0;
}

.featured-comparisons-cards-intro {
  color: #666;
  font-size: 16px;
  margin: 0 0 30px 0;
}

.featured-comparisons-cards .comparison-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 400px));
  gap: 20px;
  justify-content: center;
  align-items: start;
}

.featured-comparisons-cards .comparison-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  padding: 15px;
  text-decoration: none;
  display: block;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.featured-comparisons-cards .comparison-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #a5c63b 0%, #8ab02e 100%);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.featured-comparisons-cards .comparison-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

.featured-comparisons-cards .comparison-card:hover::before {
  transform: scaleX(1);
}

.featured-comparisons-cards .comparison-card-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 60px;
  position: relative;
}

/* Scope all device card styles to avoid conflicts with existing CSS */
.featured-comparisons-cards .device-card {
  flex: 1 1 0%;
  text-align: center;
  min-width: 0;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  box-sizing: border-box;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 15px;
  transition: all 0.3s ease;
}

.featured-comparisons-cards .comparison-card:hover .device-card {
  background: linear-gradient(135deg, #f5f9eb 0%, #e8f0d8 100%);
}

.featured-comparisons-cards .device-image-wrapper {
  min-height: 140px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.featured-comparisons-cards .device-image {
  max-width: 90%;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
  display: block;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
}

.featured-comparisons-cards .device-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 100%;
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.featured-comparisons-cards .device-brand {
  color: #a5c63b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.featured-comparisons-cards .device-model {
  color: #2d3748;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.featured-comparisons-cards .vs-divider {
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-comparisons-cards .vs-text {
  background: linear-gradient(135deg, #a5c63b 0%, #8fb328 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  padding: 0;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  letter-spacing: 1px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.featured-comparisons-cards .comparison-card:hover .vs-text {
  transform: rotate(360deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(165, 198, 59, 0.6);
}

.featured-comparisons-cards .vs-text::before,
.featured-comparisons-cards .vs-text::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #667eea);
  z-index: -1;
}

.featured-comparisons-cards .vs-text::before {
  right: 100%;
  margin-right: 6px;
}

.featured-comparisons-cards .vs-text::after {
  left: 100%;
  margin-left: 6px;
  background: linear-gradient(90deg, #8fb328, transparent);
}

.featured-comparisons-cards .comparison-card-description {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: #4a5568;
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .featured-comparisons-cards {
    padding: 10px 15px 40px 15px;
    margin: 10px 0;
  }

  .featured-comparisons-cards h3 {
    font-size: 22px;
  }

  .featured-comparisons-cards-intro {
    font-size: 14px;
  }

  .featured-comparisons-cards .comparison-cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .featured-comparisons-cards .comparison-card-inner {
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
  }

  .featured-comparisons-cards .device-card {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: relative;
    box-sizing: border-box;
    padding: 12px;
  }

  .featured-comparisons-cards .vs-divider {
    top: 60px;
  }

  .featured-comparisons-cards .device-image-wrapper {
    min-height: 120px;
    margin-bottom: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
  }

  .featured-comparisons-cards .device-image {
    max-width: 90%;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
  }

  .featured-comparisons-cards .vs-text {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    font-size: 14px;
    padding: 0;
    box-sizing: border-box;
  }

  .featured-comparisons-cards .device-brand {
    font-size: 10px;
  }

  .featured-comparisons-cards .device-name {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .featured-comparisons-cards .comparison-card {
    padding: 10px;
  }

  .featured-comparisons-cards .comparison-card-inner {
    gap: 30px;
    align-items: flex-start;
  }

  .featured-comparisons-cards .device-card {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: relative;
    box-sizing: border-box;
    padding: 10px;
  }

  .featured-comparisons-cards .device-image-wrapper {
    min-height: 100px;
    margin-bottom: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
  }

  .featured-comparisons-cards .device-image {
    max-width: 90%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
  }

  .featured-comparisons-cards .vs-text {
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
    max-width: 35px;
    max-height: 35px;
    font-size: 12px;
    padding: 0;
    box-sizing: border-box;
  }

  .featured-comparisons-cards .vs-text::before,
  .featured-comparisons-cards .vs-text::after {
    width: 15px;
  }

  .featured-comparisons-cards .vs-divider {
    top: 50px;
  }

  .featured-comparisons-cards .device-brand {
    font-size: 9px;
  }

  .featured-comparisons-cards .device-name {
    font-size: 11px;
  }

  .featured-comparisons-cards .device-model {
    font-size: 11px;
  }
}

/* Comparison overlay value cell alignment */
.comparison-table .device-spec-value-cell {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  border-left: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  padding-top: 8px;
}

.comparison-table .spec-row > .device-spec-value-cell:first-of-type {
  border-left: none;
}

.comparison-table .spec-row > .device-spec-value-cell:last-of-type {
  border-right: none;
}

.comparison-table .spec-row:nth-child(even) .device-spec-value-cell {
  background: #fafafa !important;
}

.comparison-table .spec-row:hover .device-spec-value-cell {
  background: #f0f8ff !important;
}

#content-container .buy-device-group {
  margin-top: 10px;
}

#content-container a.buy-device-single,
#content-container button.buy-device-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #e95e27;
  color: #ffffff;
  border-radius: 4px;
  -o-border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  text-decoration: none;
  padding: 0 16px;
  font-size: 110%;
  margin: 10px 0;
  text-shadow: 0 1px 1px #666666;
  width: auto;
  height: 45px;
  text-align: center;
  position: relative;
  border: none;
  cursor: pointer;
  font-weight: 600;
  box-sizing: border-box;
}

#content-container button.buy-device-toggle {
  font-family: inherit;
  padding: 0 64px;
  width: 100%;
}

#content-container a.buy-device-single:focus,
#content-container button.buy-device-toggle:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

#content-container .buy-device-label,
#content-container .buy-device-toggle-label {
  pointer-events: none;
}

#content-container .buy-device-single .buy-device-price {
  display: block;
  margin-top: 6px;
  font-size: 85%;
  font-weight: normal;
  color: #ffffff;
}

#content-container .buy-device-info {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  opacity: 0.85;
}

#content-container .buy-device-info:hover {
  opacity: 1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
  border-color: #ffffff;
}

#content-container .buy-device-info:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

#content-container .affiliate-tooltip {
  position: absolute;
  left: 16px;
  right: 16px;
  top: -14px;
  transform: translateY(-100%);
  background: rgba(51, 51, 51, 0.95);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 85%;
  line-height: 1.4;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

#content-container .affiliate-tooltip::after {
  content: "";
  position: absolute;
  left: 32px;
  bottom: -8px;
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: rgba(51, 51, 51, 0.95) transparent transparent transparent;
}

#content-container .buy-device-single.show-tooltip .affiliate-tooltip,
#content-container .buy-device-toggle.show-tooltip .affiliate-tooltip,
#content-container .buy-device-info:hover + .affiliate-tooltip,
#content-container .buy-device-info:focus + .affiliate-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(calc(-100% - 6px));
}

#content-container .buy-device-toggle-icon {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transition: transform 0.2s ease;
}

#content-container .buy-device-group.is-open .buy-device-toggle-icon {
  transform: translateY(-50%) rotate(-135deg);
}

.buy-device-options {
  margin: 10px 0 0 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.buy-device-group.has-multiple .buy-device-options[hidden] {
  display: none;
}

.buy-device.buy-device-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  text-decoration: none;
  color: #333333;
  font-weight: 600;
  transition: background 0.2s ease;
  border-bottom: 1px solid #ededed;
}

.buy-device.buy-device-option:last-of-type {
  border-bottom: none;
}

.buy-device.buy-device-option:hover,
.buy-device.buy-device-option:focus {
  background: #f7f7f7;
}

.buy-device-option-price {
  font-size: 90%;
  font-weight: normal;
  color: #666666;
}

#content-container .buy-device-options .buy-device {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: transparent;
  color: #333333;
  margin: 0;
  text-shadow: none;
  width: 100%;
}

#content-container .affiliate-disclaimer {
  margin: 12px 20px 18px;
  font-size: 80%;
  color: #777777;
  line-height: 1.4;
  text-align: left;
}

@media (min-width: 1025px) {
  #content-container-left {
    position: sticky;
    top: 20px;
  }
}

/* ===============================================
   EXPRESS FORM / CONTACT FORM STYLES
   =============================================== */

.ba-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.ba-form .ccm-form {
  width: 100%;
}

/* Form field groups */
.ba-form .mb-3,
.ba-form .form-group {
  margin-bottom: 20px;
}

/* Labels */
.ba-form .form-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  font-size: 14px;
}

/* Required indicator */
.ba-form .text-muted.small {
  color: #a5c63b !important;
  font-size: 12px;
  font-weight: 500;
  margin-left: 4px;
}

/* Input fields */
.ba-form .form-control,
.ba-form .form-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  color: #333;
  transition: all 0.2s ease;
}

.ba-form .form-control:focus,
.ba-form .form-select:focus {
  outline: none;
  border-color: #a5c63b;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(165, 198, 59, 0.15);
}

.ba-form .form-control::placeholder {
  color: #999;
}

/* Textarea specific */
.ba-form textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

/* Select dropdown */
.ba-form .form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 12px;
  padding-right: 40px;
}

/* Captcha section */
.ba-captcha-group {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.ba-captcha-group .form-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.ba-captcha-image {
  margin-bottom: 12px;
}

.ba-captcha-image img {
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.ba-captcha-image img:hover {
  opacity: 0.8;
}

.ba-captcha-input .form-control {
  max-width: 200px;
}

/* Submit button */
.ba-form-actions {
  margin-top: 24px;
}

.ba-submit-btn {
  background: #a5c63b;
  border: none;
  color: #fff;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ba-submit-btn:hover {
  background: #8ab02e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(165, 198, 59, 0.4);
}

.ba-submit-btn:active {
  transform: translateY(0);
}

/* Success alert */
.ba-alert-success {
  background: #e8f5e9;
  border: 1px solid #a5c63b;
  color: #2e7d32;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Error alert */
.ba-alert-error {
  background: #ffebee;
  border: 1px solid #ef5350;
  color: #c62828;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Fieldset styling */
.ba-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ba-form {
    padding: 20px;
    margin: 0 10px;
    border-radius: 8px;
  }

  .ba-form .form-control,
  .ba-form .form-select {
    padding: 10px 14px;
    font-size: 16px; /* Prevents iOS zoom */
  }

  .ba-submit-btn {
    width: 100%;
    padding: 14px 20px;
  }

  .ba-captcha-input .form-control {
    max-width: 100%;
  }
}

/* Secondary Display Sub-section */
.device-sub-category {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color, #e0e0e0);
}

.device-sub-category h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary, #666);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-sub-category h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background-color: var(--accent-color, #4CAF50);
    border-radius: 2px;
}

/* Hide secondary display section when empty */
.device-sub-category:empty {
    display: none;
}

/* Comparison table section headers */
.comparison-table .section-header td {
    background-color: var(--bg-tertiary, #f5f5f5);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border-top: 2px solid var(--border-color, #e0e0e0);
    color: var(--text-secondary, #666);
}


