@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --green: #16A34A;
  --green-light: #DCFCE7;
  --green-dark: #15803D;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --yellow: #D97706;
  --yellow-light: #FEF3C7;
  --blue: #2563EB;
  --blue-light: #DBEAFE;
  --bg: #F9FAFB;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}

body.no-scroll,
body.search-active {
  overflow: hidden;
}

/* ===== HEADER ===== */
header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--green);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.header-search {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .header-search {
    display: block;
  }
}

.header-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--gray-900);
  outline: none;
  transition: var(--transition);
}

#searchInput:focus {
  background: var(--white);
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

#searchInput::placeholder {
  color: var(--gray-400);
}

/* ===== AUTOCOMPLETE DROPDOWN ===== */
.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px -8px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 500;
  overflow: hidden;
  animation: acDropIn 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@keyframes acDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: inherit;
}

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

.autocomplete-item:hover,
.autocomplete-item.ac-active {
  background: var(--gray-50);
}

.ac-thumb {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  flex-shrink: 0;
}

.ac-thumb-placeholder {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
}

.ac-info {
  flex: 1;
  min-width: 0;
}

.ac-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-brand {
  font-size: 0.75rem;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  flex-shrink: 0;
}

.ac-price.ac-sale {
  color: var(--red);
}

.ac-footer {
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green);
  text-align: center;
  cursor: pointer;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  transition: background 0.12s ease;
}

.ac-footer:hover {
  background: var(--green-light);
}

/* Dark mode autocomplete */
body.dark-mode .autocomplete-dropdown {
  background: var(--gray-800);
  border-color: var(--gray-700);
  box-shadow: 0 16px 48px -8px rgba(0, 0, 0, 0.5);
}

body.dark-mode .autocomplete-item {
  border-bottom-color: var(--gray-700);
  color: var(--gray-100);
}

body.dark-mode .autocomplete-item:hover,
body.dark-mode .autocomplete-item.ac-active {
  background: var(--gray-700);
}

body.dark-mode .ac-name { color: var(--gray-50); }
body.dark-mode .ac-price { color: var(--gray-200); }
body.dark-mode .ac-footer {
  background: var(--gray-700);
  border-top-color: var(--gray-600);
}
body.dark-mode .ac-footer:hover { background: var(--gray-600); }


.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  transition: var(--transition);
}

.cart-btn:hover {
  background: var(--gray-100);
}

.cart-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

#cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  /* Bright red */
  color: white;
  font-size: 10px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  pointer-events: none;
  line-height: 1;
}

@keyframes cartBadgePop {
  0% {
    transform: scale(0.5);
  }

  70% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}


.hamburger-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}


@media (min-width: 768px) {
  .hamburger-btn {
    display: none;
  }
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== CATEGORY NAV ===== */
.category-nav {
  border-top: 1px solid var(--gray-200);
  background: var(--white);
  overflow-x: auto;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-nav ul {
  display: flex;
  gap: 0;
  list-style: none;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.category-nav li a {
  display: block;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
}

.category-nav li a:hover {
  color: var(--green);
}

.category-nav li a.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 600;
}

/* ===== MOBILE MENU ===== */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.mobile-menu-overlay.active {
  display: block;
}

#nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(360px, 90vw);
  height: 100vh;
  background: var(--white);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#nav-menu.active {
  transform: translateX(0);
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.nav-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

.nav-search-wrap {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}

.nav-category-label {
  padding: 16px 20px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 24px;
}

.nav-category-btn {
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-700);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: var(--transition);
}

.nav-category-btn:hover,
.nav-category-btn.active {
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 600;
}

.close-button {
  background: var(--gray-100);
  border: none;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--gray-500);
  transition: var(--transition);
}

.close-button:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

/* ===== MAIN / GRID ===== */
main {
  padding: 0;
}

.page-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== STORE FILTER ===== */
.filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 1024px) {
  .filters-wrapper {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-end;
  }
}

.advanced-filters-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.advanced-filters-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full, 50px);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.advanced-filters-toggle svg {
  width: 14px;
  height: 14px;
}

.advanced-filters-toggle:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-1px);
}

.advanced-filters-toggle.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.advanced-filters {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 340px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl, 16px);
  padding: 24px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
  z-index: 100;
  flex-direction: column;
  gap: 20px;
  animation: filterFadeIn 0.2s ease-out;
  box-sizing: border-box;
  /* Ensure padding is included in width */
}

@media (max-width: 480px) {
  .advanced-filters {
    width: calc(100vw - 40px);
    right: -10px;
  }
}

@keyframes filterFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.advanced-filters.active {
  display: flex;
}

.filter-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md, 10px);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--gray-800);
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.filter-select:focus,
.filter-input:focus {
  background: var(--white);
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-light);
}

.price-inputs,
.weight-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: var(--gray-50);
  padding: 14px;
  border-radius: var(--radius-md, 10px);
  box-sizing: border-box;
}

.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  user-select: none;
}

.filter-checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

.filter-reset-btn {
  width: 100%;
  margin-top: 4px;
  padding: 12px;
  background: transparent;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md, 10px);
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.filter-reset-btn:hover {
  background: var(--red-light);
  border-color: var(--red-light);
  color: var(--red);
}

.subcategory-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-wrap: wrap;
}

.subcategory-bar::-webkit-scrollbar {
  display: none;
}

.subcategory-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.subcategory-pill:hover {
  border-color: var(--green);
  color: var(--green);
}

.subcategory-pill.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.store-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.store-filters::-webkit-scrollbar {
  display: none;
}

.store-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.store-filter-btn:hover {
  border-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.store-filter-btn:active {
  transform: translateY(0);
}

.store-filter-btn.inactive {
  opacity: 0.4;
  background: var(--gray-50);
  color: var(--gray-400);
  border-style: dashed;
  box-shadow: none;
}

.store-filter-btn.inactive:hover {
  opacity: 0.6;
}

.store-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Colors matching store badges */
.store-filter-btn[data-store="Rema 1000"] .store-filter-dot {
  background: var(--blue);
}

.store-filter-btn[data-store="Bilka"] .store-filter-dot {
  background: var(--yellow);
}

.store-filter-btn[data-store="Meny"] .store-filter-dot {
  background: #ef4444;
}

.store-filter-btn[data-store="Spar"] .store-filter-dot {
  background: #10b981;
}

.store-filter-btn[data-store="Min Købmand"] .store-filter-dot {
  background: var(--green);
}

.store-filter-btn[data-store="SuperBrugsen"] .store-filter-dot {
  background: #991b1b;
}

.store-filter-btn[data-store="Brugsen"] .store-filter-dot {
  background: #065f46;
}

.store-filter-btn[data-store="Kvickly"] .store-filter-dot {
  background: #7c3aed;
}

.store-filter-btn[data-store="365 Discount"] .store-filter-dot {
  background: #b45309;
}

.product.store-hidden {
  display: none !important;
}

.filter-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
}

.filter-count {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 10px;
  color: var(--gray-500);
}

.reset-filters-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red-light);
  color: var(--red);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.reset-filters-btn:hover {
  background: #FCA5A5;
}

.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .products {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1280px) {
  .products {
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
  }
}

/* ===== PRODUCT CARD ===== */
.product {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeInCard 0.3s ease forwards;
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.product:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-image-container {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--gray-50);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product:hover .product-image {
  transform: scale(1.05);
}

.sale-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  width: auto !important;
  height: auto !important;
  max-width: fit-content !important;
  object-fit: unset !important;
  aspect-ratio: unset !important;
}

.product-kg-price {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-top: 2px;
}

.store-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  z-index: 2;
}

.store-badge.rema {
  background: var(--blue-light);
  color: var(--blue);
}

.store-badge.bilka {
  background: var(--yellow-light);
  color: var(--yellow);
}

.store-badge.mk {
  background: var(--green-light);
  color: var(--green-dark);
}

.store-badge.meny {
  background: #fde0e0;
  color: #b91c1c;
}

.store-badge.spar {
  background: #d1fae5;
  color: #065f46;
}

.store-badge.brugsen {
  background: #d1fae5;
  color: #065f46;
}

.store-badge.sb {
  background: #fee2e2;
  color: #991b1b;
}

.store-badge.kvickly {
  background: #ede9fe;
  color: #6d28d9;
}

.store-badge.netto {
  background: #fef9c3;
  color: #854d0e;
}

.store-badge.foetex {
  background: #dbeafe;
  color: #1d4ed8;
}

.store-badge.discount365 {
  background: #fef3c7;
  color: #b45309;
}

.product-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.product-brand {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-content h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.product:hover .product-content h3 {
  color: var(--green);
}

.product-weight {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.compare-badge {
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 4px;
}

.compare-badge.cheapest {
  background: var(--green-light);
  color: var(--green-dark);
}

.compare-badge.pricier {
  background: var(--red-light);
  color: var(--red);
}

.compare-badge.only {
  background: var(--gray-100);
  color: var(--gray-500);
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 12px;
  gap: 8px;
}

.product-price {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.price-main {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1;
}

.price-sale {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -0.02em;
  line-height: 1;
}

.price-original {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-400);
  text-decoration: line-through;
  line-height: 1;
}

.price-unit {
  font-size: 0.68rem;
  color: var(--gray-400);
}

.add-to-cart-btn {
  background: var(--gray-900);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-md);
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
}

.add-to-cart-btn.clicked {
  width: 80px;
  background: var(--green);
  color: #ffffff;
}

.add-to-cart-btn:hover {
  background: var(--green);
  color: #ffffff;
}

.add-to-cart-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== OVERLAY ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.overlay.active {
  display: flex;
}

.overlay-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 672px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: overlayIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes overlayIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.overlay-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--white);
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-500);
  z-index: 10;
  transition: var(--transition);
}

.overlay-close-btn:hover {
  color: var(--gray-900);
  background: var(--gray-100);
}

.overlay-close-btn svg {
  width: 18px;
  height: 18px;
}

.overlay-body {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 24px;
}

@media (min-width: 640px) {
  .overlay-body {
    flex-direction: row;
    gap: 24px;
  }

  .overlay-left {
    width: 240px;
    flex-shrink: 0;
  }

  .overlay-right {
    flex: 1;
  }
}

.overlay-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  cursor: zoom-in;
  transition: var(--transition);
}

.overlay-img:hover {
  transform: scale(1.02);
  border-color: var(--green);
}

/* ===== IMAGE ZOOM OVERLAY ===== */
#image-zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#image-zoom-overlay.active {
  display: flex;
  opacity: 1;
}

.zoom-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

#zoomed-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.zoom-close-btn {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
}

.zoom-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.zoom-close-btn svg {
  width: 20px;
  height: 20px;
}

.overlay-brand {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 12px;
}

.overlay-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gray-900);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

.overlay-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.overlay-pill {
  background: var(--gray-100);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
}

.overlay-description {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 8px;
}

.overlay-right {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comp-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#comp-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comp-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  border: 1.5px solid transparent;
  transition: var(--transition);
}

.comp-multideal {
  width: 100%;
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: 0.01em;
}
.comp-multideal:empty {
  display: none;
}


.comp-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comp-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.comp-store-name,
.comp-store {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 0.95rem;
}

.comp-price {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--gray-900);
}

.comp-kg-price {
  font-size: 0.75rem;
  color: var(--gray-400);
  text-align: right;
}


#overlay-store-only-msg {
  display: none;
  background: var(--yellow-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #92400E;
}

.overlay-actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.quantity-btn {
  background: none;
  border: none;
  width: 32px;
  height: 36px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--gray-700);
  transition: var(--transition);
}

.quantity-btn:hover {
  background: var(--gray-200);
}

.quantity {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.overlay-add-btn {
  flex: 1;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.overlay-add-btn:hover {
  background: var(--green-dark);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.sale-end-date {
  font-size: 0.8rem;
  color: var(--red);
  font-weight: 600;
}

#overlay-price-value .price {
  margin: 0;
}

#overlay-price-value {
  margin-top: 4px;
}

/* overlay when shown */
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  z-index: 300;
  overflow-y: auto;
  padding: 20px;
}

#overlay .overlay-content {
  margin: auto;
}

.overlay-header {
  display: none;
}

.product-details {
  display: contents;
}

.product-info {
  display: contents;
}

/* ===== CART DRAWER ===== */
#cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(448px, 100vw);
  height: 100vh;
  background: var(--white);
  z-index: 301;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

#cart-panel.active {
  transform: translateX(0);
}

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

.cart-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-header-left svg {
  color: var(--green);
  width: 22px;
  height: 22px;
}

.cart-header-left h2 {
  font-size: 1rem;
  font-weight: 700;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gray-400);
  padding: 40px 20px;
  text-align: center;
}

.cart-empty svg {
  width: 56px;
  height: 56px;
}

.cart-empty p {
  font-size: 0.95rem;
  font-weight: 500;
}

.cart-empty-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: var(--transition);
}

.cart-empty-btn:hover {
  background: var(--green-dark);
}

.cart-category-header {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 0 4px;
}


.sco-group-store-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--gray-600, #4b5563);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sco-group-store-btn:hover {
  background: var(--gray-200, #e5e7eb);
}
.sco-group-store-btn.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.sco-group-store-btn.active svg {
  stroke: #1d4ed8;
}

.cart-item {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: var(--transition);
}

.cart-item.removing {
  opacity: 0;
  transform: translateX(20px);
}

.cart-item-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cart-item-image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
  overflow: hidden;
}

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

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
}

.cart-item-extra {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 2px;
}

.cart-item-multideal {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border-radius: 5px;
  padding: 2px 6px;
}

.cart-item-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-top: 2px;
}

.delete-item-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 1rem;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.delete-item-btn:hover {
  color: var(--red);
  background: var(--red-light);
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  width: fit-content;
}

.cart-footer {
  border-top: 1px solid var(--gray-200);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}


.cart-best-deal {
  background: var(--green);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.cart-best-deal:hover {
  background: var(--green-dark);
}

.cart-best-deal-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.cart-best-label {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}

.cart-best-savings {
  font-size: 0.95rem;
  font-weight: 800;
}

#cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  backdrop-filter: blur(2px);
}

#cart-overlay.active {
  display: block;
}


.clear-cart-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--red-light);
  color: var(--red);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  transition: var(--transition);
}

.clear-cart-btn:hover {
  background: #FCA5A5;
}


.cart-total {
  display: none;
}

.show-reference-btn {
  display: none;
}

/* ===== SEARCH RESULTS ===== */
#searchResults {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  overflow-y: auto;
  padding: 80px 16px 40px;
}

#searchResults.visible {
  display: block;
}

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

.search-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.container-search {
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== SECTION PRODUCT GRID (index) ===== */
.container-index {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#dynamic-content {
  display: flex;
  flex-direction: column;
  gap: 100px;
}

/* ===== SAVINGS WIDGET ===== */
.savings-widget {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  border-radius: var(--radius-xl);
  padding: 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.3);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.savings-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(5, 150, 105, 0.4);
}

.savings-widget::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
}

.savings-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.savings-content {
  flex: 1;
}

.savings-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.savings-amount {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.savings-amount span {
  font-size: 1.1rem;
  font-weight: 700;
  margin-left: 2px;
  opacity: 0.9;
}

.savings-badge {
  background: rgba(255, 255, 255, 1);
  color: #059669;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .savings-widget {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    gap: 12px;
  }

  .savings-badge {
    align-self: center;
  }
}

.container-category {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-type {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-type h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-type h2 a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.category-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.banner-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.banner-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  min-width: 38px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover {
  background: var(--gray-100);
}

.page-btn.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
  cursor: default;
}

.page-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.page-btn.page-ellipsis {
  border-color: transparent;
  background: transparent;
  cursor: default;
  pointer-events: none;
  min-width: 20px;
  padding: 8px 4px;
}

.pagination-jump {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pagination-jump-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-family: 'Inter', sans-serif;
}

.pagination-jump-input {
  width: 58px;
  padding: 8px 6px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  text-align: center;
  background: var(--white);
  color: var(--gray-700);
  -moz-appearance: textfield;
}

.pagination-jump-input::-webkit-outer-spin-button,
.pagination-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pagination-jump-input:focus {
  outline: none;
  border-color: var(--green);
}

.pagination-jump-btn {
  padding: 8px 12px;
}

.pagination-jump-of {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-family: 'Inter', sans-serif;
}

[data-theme="dark"] .pagination-jump-input {
  background: var(--surface);
  border-color: var(--gray-300);
  color: var(--text-primary);
}

/* ===== STORE COMPARISON OVERLAY ===== */
#store-comparison-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 480px) {
  #store-comparison-overlay {
    align-items: center;
    padding: 16px;
  }
}

.sco-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}

.sco-modal {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 780px;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  max-height: 96vh;
  overflow-y: auto;
}

@media (min-width: 480px) {
  .sco-modal {
    border-radius: 24px;
    max-height: 92vh;
  }
}

[data-theme="dark"] .sco-modal {
  background: #1c1c1e;
}

.sco-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 22px 0;
}

.sco-title {
  font-size: 19px;
  font-weight: 600;
  color: #111;
}

[data-theme="dark"] .sco-title {
  color: #f5f5f5;
}

.sco-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  flex-shrink: 0;
}

[data-theme="dark"] .sco-close {
  background: #2c2c2e;
  color: #9ca3af;
}

/* Winner card */
.sco-winner {
  margin: 16px 22px 12px;
  background: #173404;
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.sco-winner-deco {
  position: absolute;
  right: -14px;
  top: -14px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.sco-winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #C0DD97;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.sco-winner-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.sco-winner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sco-winner-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  padding: 2px;
}

.sco-winner-name {
  font-size: 28px;
  font-weight: 600;
  color: #fff;
}

.sco-winner-price {
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  text-align: right;
}

.sco-winner-save {
  font-size: 13px;
  color: #97C459;
  margin-top: 3px;
  text-align: right;
}

/* Ranked list */
.sco-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 22px;
  margin-bottom: 10px;
}

.sco-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

[data-theme="dark"] .sco-card {
  background: #2c2c2e;
  border-color: #3a3a3c;
}

.sco-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .sco-rank {
  background: #3a3a3c;
  color: #9ca3af;
}

.sco-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.sco-name {
  flex: 1;
  font-size: 17px;
  color: #111;
}

[data-theme="dark"] .sco-name {
  color: #f5f5f5;
}

.sco-diff {
  font-size: 15px;
  color: #9ca3af;
  margin-right: 4px;
}

.sco-price {
  font-size: 17px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
}

[data-theme="dark"] .sco-price {
  color: #f5f5f5;
}

/* Per-store item breakdown (inline under each store card) */
.sco-card-wrap {
  display: block;
}
.sco-store-items {
  padding: 6px 12px 8px;
  border-top: 1px solid var(--gray-100, #f3f4f6);
}
.sco-store-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.sco-store-item-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.sco-store-item-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--gray-800, #1f2937);
}
.sco-store-item-qty {
  color: var(--gray-400, #9ca3af);
  font-size: 0.78rem;
}
.sco-store-item-price {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700, #374151);
  white-space: nowrap;
}
.sco-winner .sco-store-items {
  border-top-color: rgba(255,255,255,0.15);
  margin-top: 10px;
}
.sco-winner .sco-store-item-name {
  color: rgba(255,255,255,0.85);
}
.sco-winner .sco-store-item-price {
  color: #fff;
}
[data-theme="dark"] .sco-store-items { border-color: #333; }
[data-theme="dark"] .sco-store-item-name { color: #e5e7eb; }
[data-theme="dark"] .sco-store-item-price { color: #e5e7eb; }

/* Collapsible missing items */
.sco-missing-wrap {
  padding: 0 22px 22px;
}

.sco-missing-toggle {
  width: 100%;
  background: #fef9ec;
  border: 1px solid #fac775;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  color: #854f0b;
}

[data-theme="dark"] .sco-missing-toggle {
  background: #2a1f08;
  border-color: #7a4f10;
  color: #fac775;
}

.sco-missing-toggle span {
  flex: 1;
}

.sco-chev {
  color: #ba7517;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sco-missing-toggle.open .sco-chev {
  transform: rotate(180deg);
}

.sco-missing-body {
  display: none;
  border: 1px solid #fac775;
  border-top: none;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  margin-top: -4px;
  background: #fff;
}

[data-theme="dark"] .sco-missing-body {
  background: #1c1c1e;
  border-color: #7a4f10;
}

.sco-missing-body.open {
  display: block;
}

.sco-missing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #fef3c7;
}

[data-theme="dark"] .sco-missing-item {
  border-bottom-color: #2a1f08;
}

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

.sco-missing-item-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.sco-missing-item-name {
  font-size: 15px;
  font-weight: 600;
  color: #111;
}

[data-theme="dark"] .sco-missing-item-name {
  color: #f5f5f5;
}

.sco-missing-item-stores {
  font-size: 14px;
  color: #9ca3af;
  margin-top: 2px;
  line-height: 1.4;
}

.store-exclusive-container {
  margin: 4px 0 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.store-exclusive-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.store-exclusive-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-exclusive-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.store-exclusive-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--white);
}

.store-exclusive-img--empty {
  background: var(--gray-200);
}

.store-exclusive-name {
  font-size: 0.8rem;
  font-weight: 600;
  flex: 1;
}

.store-exclusive-lineprice {
  font-size: 0.8rem;
  font-weight: 700;
}

.store-exclusive-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: space-between;
}

/* ===== ALTERNATIVES IN STORE COMPARISON ===== */
.sco-alternatives-header {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 12px;
  padding: 0 4px;
}

[data-theme="dark"] .sco-alternatives-header {
  color: #f5f5f5;
}

.sco-alternative-card {
  background: #fdfaf5;
  border: 1px solid #f2e3c6;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-theme="dark"] .sco-alternative-card {
  background: #2a251c;
  border-color: #4a4030;
}

.sco-alt-info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sco-alt-info img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eee;
  flex-shrink: 0;
}

[data-theme="dark"] .sco-alt-info img {
  border-color: #333;
}

.sco-alt-store {
  font-size: 12px;
  font-weight: 700;
  color: #c2410c;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.sco-alt-name {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

[data-theme="dark"] .sco-alt-name {
  color: #e5e7eb;
}

.sco-alt-accept-btn {
  background: #c2410c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.sco-alt-accept-btn:hover {
  background: #9a3412;
}

#confirmation-modal {
  display: none;
}

/* ===== STORE COMPARISON – NY BUTIKSRÆKKE + VARELISTE ===== */
.sco-store-row {
  display: flex;
  gap: 8px;
  padding: 14px 22px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sco-store-row::-webkit-scrollbar { display: none; }

.sco-store-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: #f3f4f6;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 10px 8px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.sco-store-card.active {
  border-color: #1a3f0a;
  background: #f0f7ea;
}
[data-theme="dark"] .sco-store-card {
  background: #2c2c2e;
}
[data-theme="dark"] .sco-store-card.active {
  border-color: #5fa83b;
  background: #1c2e16;
}
.sco-sc-count {
  font-size: 12px;
  font-weight: 700;
  color: #1a3f0a;
  background: #d6ecc4;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}
[data-theme="dark"] .sco-sc-count {
  color: #b0de80;
  background: #1e3b0e;
}
.sco-sc-logo {
  width: 48px;
  height: 28px;
  object-fit: contain;
}
.sco-sc-name-fallback {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  text-align: center;
  line-height: 1.3;
}
[data-theme="dark"] .sco-sc-name-fallback { color: #d1d5db; }
.sco-sc-price {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
[data-theme="dark"] .sco-sc-price { color: #9ca3af; }

/* Vareliste */
.sco-item-list {
  padding: 0 22px 22px;
}
.sco-il-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin: 4px 0 8px;
}
[data-theme="dark"] .sco-il-section-label { color: #9ca3af; }
.sco-il-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 12px 0 14px;
}
[data-theme="dark"] .sco-il-divider { background: #333; }
.sco-il-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f3f4f6;
  flex-wrap: nowrap;
}
[data-theme="dark"] .sco-il-row { border-color: #2c2c2e; }
.sco-il-row:last-of-type { border-bottom: none; }
.sco-il-row--missing {
  flex-direction: column;
  align-items: stretch;
  background: #fffbf5;
  border: 1px solid #f2e3c6;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
[data-theme="dark"] .sco-il-row--missing {
  background: #2a251c;
  border-color: #4a4030;
}
.sco-il-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.sco-il-img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}
[data-theme="dark"] .sco-il-img { border-color: #333; background: #1c1c1e; }
.sco-il-img--empty {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f3f4f6;
  flex-shrink: 0;
}
[data-theme="dark"] .sco-il-img--empty { background: #2c2c2e; }
.sco-il-name {
  font-size: 14px;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-theme="dark"] .sco-il-name { color: #e5e7eb; }
.sco-il-qty {
  font-size: 12px;
  color: #6b7280;
}
.sco-il-price {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .sco-il-price { color: #e5e7eb; }
.sco-il-alt {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 6px 8px;
  margin-top: 6px;
}
[data-theme="dark"] .sco-il-alt {
  background: #2a1f0e;
  border-color: #5a3d1c;
}
.sco-il-alt-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eee;
  flex-shrink: 0;
}
.sco-il-alt-info {
  flex: 1;
  min-width: 0;
}
.sco-il-alt-name {
  font-size: 13px;
  color: #92400e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-theme="dark"] .sco-il-alt-name { color: #fbbf24; }
.sco-il-alt-price {
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
}
[data-theme="dark"] .sco-il-alt-price { color: #fb923c; }
.sco-il-alt-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ea580c;
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.sco-il-alt-btn:hover { background: #c2410c; }
.sco-il-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  border-top: 2px solid #e5e7eb;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}
[data-theme="dark"] .sco-il-total {
  border-color: #333;
  color: #f5f5f5;
}


/* ===== FOOTER ===== */
footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 28px 24px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.footer-links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--green);
}

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

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ===== STATIC PAGES ===== */
.static-page {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}

.static-page h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.static-page-lead {
  font-size: 1.05rem;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.static-page-updated {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 28px;
}

.static-page section {
  margin-bottom: 24px;
}

.static-page section:last-child {
  margin-bottom: 0;
}

.static-page h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.static-page p,
.static-page li {
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.65;
}

.static-page ul,
.static-page ol {
  margin: 8px 0 0 1.25rem;
}

.static-page ol {
  list-style: decimal;
}

.static-page h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 14px 0 6px;
  color: var(--gray-700);
}

.static-page-toc {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.static-page-toc p {
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.static-page-toc ol {
  margin: 0 0 0 1.25rem;
}

.static-page-toc a {
  font-weight: 500;
}

.static-page-note {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
}

.static-page-note p {
  color: var(--gray-700);
  margin: 0;
}

.static-page a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.static-page a:hover {
  text-decoration: underline;
}

.feedback-form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feedback-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .feedback-row {
    grid-template-columns: 1fr;
  }
}

.feedback-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.feedback-field .optional {
  font-weight: 400;
  color: var(--gray-400);
}

.feedback-field .required {
  color: var(--red);
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--gray-900);
  background: var(--white);
  transition: var(--transition);
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}

.feedback-field textarea {
  resize: vertical;
  min-height: 120px;
}

.feedback-status {
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 1.25rem;
}

.feedback-status.success {
  color: var(--green-dark);
}

.feedback-status.error {
  color: var(--red);
}

.feedback-submit {
  align-self: flex-start;
  padding: 12px 28px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.feedback-submit:hover:not(:disabled) {
  background: var(--green-dark);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
}

.feedback-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.footer-data-note {
  font-size: 0.65rem;
  color: var(--gray-400);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ===== MISC ===== */
.no-results {
  text-align: center;
  padding: 40px;
  color: var(--gray-400);
  font-size: 0.9rem;
}

.added-to-cart {
  animation: pulse 0.3s ease;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.97);
  }
}

/* Hide old structures */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.nav-menu {
  z-index: 201;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: none;
}

.menu-overlay.active {
  display: block;
}

.loading-spinner {
  display: none;
}

.show-reference-btn.loading .button-text {
  display: none;
}

.show-reference-btn.loading .loading-spinner {
  display: block;
}

/* price classes used in search results */
.price {
  margin: 0;
}

.brand {
  display: none;
}

.price.original {
  text-decoration: line-through;
  color: var(--gray-400);
  font-size: 0.8rem;
}

.price.sale {
  color: var(--red);
  font-weight: 900;
}

.price:not(.sale):not(.original) {
  color: var(--gray-900);
  font-weight: 900;
}


.product-description {
  display: none;
}

.corner-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-900);
  color: white;
  border-radius: var(--radius-md);
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
}

.corner-box.clicked {
  width: 80px;
  background: var(--green);
}

.corner-box:hover {
  background: var(--green);
}

.comp-sale-tag {
  display: inline-block;
  background: var(--red-light);
  color: var(--red);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* ===== FILTER SIDEBAR ===== */
.content-with-sidebar {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.main-content-area {
  flex: 1;
}

.filter-sidebar {
  width: 280px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow-sm);
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-section select,
.filter-number-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.filter-section select:focus,
.filter-number-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.price-range-input {
  padding: 10px 0;
}

#priceRange {
  width: 100%;
  accent-color: var(--green);
}

.price-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 8px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-700);
  user-select: none;
}

.filter-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

.reset-all-filters {
  width: 100%;
  padding: 12px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.reset-all-filters:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

@media (max-width: 1024px) {
  .content-with-sidebar {
    flex-direction: column-reverse;
  }

  .filter-sidebar {
    width: 100%;
    position: static;
    margin-bottom: 24px;
  }
}
/* ===== PRICE HISTORY OVERLAY ===== */
.overlay-history-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-700);
}

.price-insight-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-500);
}

.price-insight-badge.great-deal {
  background: var(--green-light);
  color: var(--green-dark);
}

.price-insight-badge.fake-deal {
  background: var(--yellow-light);
  color: var(--yellow);
}

.chart-container {
  height: 180px;
  width: 100%;
  position: relative;
}

.history-footer {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--gray-500);
  text-align: center;
}

.comp-card.active-history {
  border: 2px solid var(--green) !important;
  background: #f0fdf4 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.1);
  cursor: pointer;
}

.comp-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ── Comp-card dark mode ───────────────────────────────────────────────────── */
/* .comp-card already uses background: var(--white) → #1f2937 in dark mode ✓  */

[data-theme="dark"] .comp-card.active-history {
  background: #14532d !important;
}

[data-theme="dark"] .comp-multideal {
  background: #78350f;
  color: #fef3c7;
}

/* ===== PREMIUM PRICE ALERTS ===== */
.price-alert-box {
  margin-top: 20px;
  padding: 16px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
}

.price-alert-box:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  border-color: var(--green-light);
}

.alert-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f0fdf4;
  border: 1.5px solid #dcfce7;
  color: #16a34a;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 10px;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-toggle-btn:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

.alert-toggle-btn svg {
  transition: transform 0.3s ease;
}

.alert-toggle-btn:hover svg {
  transform: rotate(15deg) scale(1.1);
}

.alert-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  animation: slideDown 0.3s ease-out;
}

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

.alert-form p {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 12px;
  text-align: center;
}

.alert-input-group {
  display: flex;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 6px;
  border-radius: 10px;
  gap: 6px;
  transition: border-color 0.2s;
}

.alert-input-group:focus-within {
  border-color: var(--green);
  background: white;
}

.alert-input-group input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  outline: none;
  width: 100%;
}

.alert-input-group input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.alert-input-group button {
  padding: 8px 20px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.alert-input-group button:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
}


/* ===== SETTINGS PANEL ===== */
#settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  backdrop-filter: blur(2px);
}
#settings-overlay.active {
  display: block;
}

#settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(448px, 100vw);
  height: 100vh;
  background: var(--bg, var(--white));
  z-index: 301;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  color: var(--text-main, var(--gray-900));
}

#settings-panel.active {
  transform: translateX(0);
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.settings-section {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color, var(--gray-200));
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-main, var(--gray-900));
}

.settings-desc {
  font-size: 0.85rem;
  color: var(--text-muted, var(--gray-500));
  margin-bottom: 16px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.setting-item strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main, var(--gray-900));
}
.setting-item p {
  font-size: 0.8rem;
  color: var(--text-muted, var(--gray-500));
  margin: 2px 0 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider {
  background-color: var(--green);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.slider.round {
  border-radius: 24px;
}
.slider.round:before {
  border-radius: 50%;
}

/* Store Toggles */
.store-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.store-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-main, var(--gray-900));
}
.store-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

/* ===== DARK MODE VARIABLES ===== */
[data-theme="dark"] {
  --white: #1f2937;
  --gray-50: #111827;
  --gray-100: #374151;
  --gray-200: #4b5563;
  --gray-300: #6b7280;
  --gray-400: #9ca3af;
  --gray-500: #d1d5db;
  --gray-600: #e5e7eb;
  --gray-700: #f3f4f6;
  --gray-800: #f9fafb;
  --gray-900: #ffffff;

  --bg: #111827;
  --text-main: #ffffff;
  --text-muted: #9ca3af;
  --border-color: #374151;
}

body[data-theme="dark"] {
  background-color: var(--bg);
  color: var(--text-main);
}

/* ── Cart Tabs ─────────────────────────────────────────────────────────────── */
.cart-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  padding: 0 16px;
  gap: 4px;
  flex-shrink: 0;
}

.cart-tab {
  position: relative;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-tab:hover {
  color: var(--gray-900);
}

.cart-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.cart-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--green);
  color: white;
  border-radius: 999px;
}

#cart-tab-cart {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ── Save List Button ──────────────────────────────────────────────────────── */
.save-list-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.save-list-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

/* ── Saved Lists Tab ───────────────────────────────────────────────────────── */
#cart-tab-lists {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.saved-lists-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-lists-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
  color: var(--gray-400);
}

.saved-lists-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

.saved-lists-empty p {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-500);
  margin: 0;
}

.saved-lists-empty span {
  font-size: 0.8rem;
  line-height: 1.4;
}

.saved-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.saved-list-item:hover {
  border-color: var(--green);
}

.saved-list-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.saved-list-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-list-meta {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.saved-list-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.saved-list-load-btn {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
  background: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.saved-list-load-btn:hover {
  background: var(--green-dark);
}

.saved-list-delete-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--gray-400);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

.saved-list-delete-btn:hover {
  color: var(--red);
  background: var(--red-light);
}

/* ===== AUTH MODAL ===== */
.profile-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-700);
  padding: 8px;
  display: flex;
  align-items: center;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s;
}
.profile-btn:hover { background: var(--gray-100); }

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal {
  background: var(--bg);
  border-radius: 16px;
  padding: 32px;
  width: min(420px, 92vw);
  position: relative;
  box-shadow: 0 24px 64px -12px rgba(0,0,0,0.25);
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--gray-500);
  padding: 4px 8px;
  border-radius: 6px;
}
.auth-modal-close:hover { background: var(--gray-100); }

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-500);
  transition: all 0.15s;
}
.auth-tab.active {
  background: var(--bg);
  color: var(--gray-900);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.auth-field {
  margin-bottom: 16px;
}
.auth-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-700);
}
.auth-field input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--gray-900);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--green);
}

.auth-error {
  color: var(--red, #dc2626);
  font-size: 0.85rem;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: 8px;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-submit-btn:hover:not(:disabled) { opacity: 0.88; }

/* ===== PROFILE PAGE ===== */
.profile-section {
  background: var(--bg);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.profile-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.profile-action-btn {
  padding: 9px 18px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: opacity 0.15s;
}
.profile-action-btn:hover { opacity: 0.85; }
.profile-action-btn.secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}
.profile-action-btn.small { padding: 6px 12px; font-size: 0.82rem; }

.auth-logout-btn {
  padding: 8px 18px;
  background: var(--gray-100);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-700);
}
.auth-logout-btn:hover { background: var(--gray-200); }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.profile-fav-card {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}
.profile-fav-card img { width: 80px; height: 80px; object-fit: contain; }
.profile-fav-info { text-align: center; }
.profile-fav-name { font-size: 0.82rem; font-weight: 600; }
.profile-fav-price { font-size: 0.85rem; color: var(--green); font-weight: 700; }
.profile-fav-remove {
  position: absolute;
  top: 6px; right: 6px;
  background: none; border: none;
  cursor: pointer; color: var(--gray-400);
  font-size: 0.85rem;
}
.profile-fav-remove:hover { color: var(--red, #dc2626); }

.profile-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.profile-list-row:last-child { border-bottom: none; }

.profile-empty {
  color: var(--gray-400);
  font-size: 0.9rem;
  margin: 0;
}

/* ── Butiksrute ──────────────────────────────────────────────────────────── */
.butiksrute-btn {
  background: #eef6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  margin-top: 0;
}
.butiksrute-btn:hover { background: #dbeafe; color: #1e40af; }
[data-theme="dark"] .butiksrute-btn { background: #1e3a5f; border-color: #2563eb; color: #93c5fd; }

.br-loading { padding: 24px; text-align: center; color: var(--gray-500); font-size: 0.9rem; }

.br-summary {
  margin: 14px 22px 4px;
  background: #f0fdf4;
  border-radius: 14px;
  padding: 14px 18px;
  border: 1px solid #bbf7d0;
}
[data-theme="dark"] .br-summary { background: #052e16; border-color: #166534; }

.br-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.br-summary-main { display: flex; align-items: baseline; gap: 8px; }
.br-summary-total { font-size: 1.35rem; font-weight: 800; color: #15803d; }
[data-theme="dark"] .br-summary-total { color: #4ade80; }
.br-summary-label { font-size: 0.82rem; color: var(--gray-500); }
.br-summary-save { font-size: 0.82rem; font-weight: 700; color: #15803d; background: #dcfce7; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
[data-theme="dark"] .br-summary-save { background: #14532d; color: #4ade80; }
.br-summary-save-vs { font-weight: 400; color: var(--gray-500); }

.br-stores { padding: 10px 22px 22px; display: flex; flex-direction: column; gap: 12px; }

.br-store-group {
  border: 1.5px solid var(--gray-200);
  border-radius: 14px;
  overflow: hidden;
}
[data-theme="dark"] .br-store-group { border-color: #2c2c2e; }

.br-store-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
[data-theme="dark"] .br-store-header { background: #2c2c2e; border-color: #3a3a3c; }

.br-store-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.br-store-name { font-weight: 700; font-size: 0.9rem; color: var(--gray-800); flex: 1; }
[data-theme="dark"] .br-store-name { color: #f5f5f5; }
.br-store-subtotal { font-weight: 700; font-size: 0.9rem; color: var(--gray-700); white-space: nowrap; }
[data-theme="dark"] .br-store-subtotal { color: #d1d5db; }

.br-store-items { padding: 8px 0; }

.br-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
}
.br-item:not(:last-child) { border-bottom: 1px solid var(--gray-100); }
[data-theme="dark"] .br-item:not(:last-child) { border-color: #3a3a3c; }

.br-item-img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; flex-shrink: 0; background: var(--gray-50); }
.br-item-name { flex: 1; font-size: 0.83rem; color: var(--gray-700); }
[data-theme="dark"] .br-item-name { color: #d1d5db; }
.br-item-qty { color: var(--gray-400); font-size: 0.78rem; }
.br-item-price { font-size: 0.83rem; font-weight: 600; color: var(--gray-800); white-space: nowrap; }
[data-theme="dark"] .br-item-price { color: #e5e7eb; }

.sco-butiksrute-wrap {
  padding: 14px 22px 22px;
}

.sco-butiksrute-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, border-color 0.15s;
}
.sco-butiksrute-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
[data-theme="dark"] .sco-butiksrute-btn {
  background: #1e3a5f;
  border-color: #2563eb;
  color: #93c5fd;
}
[data-theme="dark"] .sco-butiksrute-btn:hover {
  background: #1e40af;
}

.sco-butiksrute-head-btn {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}
.sco-butiksrute-head-btn:hover {
  background: #dbeafe;
}
[data-theme="dark"] .sco-butiksrute-head-btn {
  color: #93c5fd;
  border-color: #2563eb;
  background: #1e3a5f;
}

/* ===== MOBILE OPTIMIZATIONS (≤767px — desktop uændret) ===== */
@media (max-width: 767px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body.filters-open,
  body.panel-open {
    overflow: hidden;
    touch-action: none;
  }

  /* Søgefelt synligt i header på telefon (anden række) */
  .header-top {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .header-search {
    display: block !important;
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
  }

  .logo-link {
    flex: 1;
    min-width: 0;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  /* Undgår iOS-zoom ved fokus (16px minimum) */
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="email"],
  select,
  textarea,
  #searchInput,
  .filter-input,
  .filter-select {
    font-size: 16px !important;
  }

  /* Touch targets (Apple HIG: 44px) */
  .cart-btn,
  .hamburger-btn,
  .settings-btn,
  .close-button,
  .add-to-cart-btn,
  .quantity-btn,
  .page-btn,
  .subcategory-pill,
  .nav-category-btn,
  .store-filter-btn,
  .advanced-filters-toggle,
  .overlay-close-btn,
  .delete-item-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .add-to-cart-btn {
    width: 44px;
    height: 44px;
  }

  .close-button {
    width: 44px;
    height: 44px;
  }

  .delete-item-btn {
    width: 44px;
    height: 44px;
  }

  .quantity-btn {
    width: 44px;
    height: 44px;
  }

  .cart-btn,
  .hamburger-btn,
  .settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  button,
  a.nav-category-btn,
  .product {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* iOS viewport-højde */
  #nav-menu,
  #cart-panel,
  #settings-panel {
    height: 100dvh;
  }

  #nav-menu {
    width: min(360px, 100vw);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  #cart-panel,
  #settings-panel {
    width: 100vw;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .cart-footer {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  /* Kategori-navigation: nemmere swipe */
  .category-nav ul {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    scroll-snap-type: x proximity;
  }

  .category-nav li {
    scroll-snap-align: start;
  }

  .category-nav li a {
    padding: 10px 14px;
  }

  /* Butiksfiltre og underkategorier: edge-to-edge scroll */
  .store-filters,
  .subcategory-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    scroll-padding-inline: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .subcategory-bar {
    flex-wrap: nowrap;
  }

  /* Filtrering som bund-sheet */
  .mobile-filters-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 440;
    backdrop-filter: blur(2px);
  }

  .mobile-filters-backdrop.active {
    display: block;
  }

  .advanced-filters {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: min(88dvh, 680px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 20px 20px 0 0;
    z-index: 450;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    animation: mobileFilterSlideUp 0.25s ease-out;
  }

  @keyframes mobileFilterSlideUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Produktdetalje som bund-sheet */
  #overlay {
    padding: 0;
    align-items: flex-end !important;
    justify-content: center !important;
  }

  #overlay .overlay-content {
    margin: 0;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    width: 100%;
  }

  #overlay .overlay-body {
    padding: 20px 16px;
    gap: 16px;
  }

  #overlay .overlay-title {
    font-size: 1.2rem;
  }

  .overlay-actions {
    position: sticky;
    bottom: 0;
    background: var(--gray-50);
    margin: 0 -16px -20px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--gray-200);
    z-index: 2;
  }

  .overlay-add-btn {
    min-height: 48px;
    font-size: 1rem;
  }

  /* Søgeresultater under sticky header */
  #searchResults {
    padding-top: calc(var(--mobile-header-height, 130px) + env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }

  /* Autocomplete begrænset højde på lille skærm */
  .autocomplete-dropdown {
    max-height: min(45dvh, 280px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Mindre luft mellem sektioner på forsiden */
  #dynamic-content {
    gap: 48px;
  }

  .page-wrap {
    padding: 16px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  /* Kurv og indstillinger: bedre scroll */
  .cart-items,
  .settings-content {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Butikssammenligning: fuld bredde på små skærme */
  .sco-modal {
    max-height: 94dvh;
  }

  .sco-head {
    padding-top: max(18px, env(safe-area-inset-top));
  }

  #butiksrute-overlay .sco-modal {
    max-height: 94dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  footer .footer-inner {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  /* Pagination: større trykflader */
  .page-btn {
    padding: 10px 16px;
  }
}

/* Touch-enheder: undgå "hængende" hover-effekter efter tap */
@media (hover: none) and (pointer: coarse) {
  .product:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .product:hover .product-image {
    transform: none;
  }

  .product:hover .product-content h3 {
    color: var(--gray-900);
  }

  .store-filter-btn:hover,
  .advanced-filters-toggle:hover,
  .cart-btn:hover,
  .page-btn:hover {
    transform: none;
  }
}
