:root {  
  --border-color: #e5e5e5;
  --hover-color: #FBF7E4;
  --text-primary: #333333;
  --text-secondary: #666666;
  --accent-color: #0066cc;
  --popup-overlay: rgba(0, 0, 0, 0.5);
  --animation-speed: 0.5s;
  --header-height: 50px;
  --row-height: 48px;
  --cell-padding: 12px;
  --font-size-base: 16px;
  --brand-red: #FF0E03;
}

/* Market Selection Styles */
.market-selection-container {
  text-align: left;
  margin-bottom: 2rem;
  padding: 1rem;
  background: none;
}

.market-selection-title {
  margin-bottom: 1.5rem;
  color: #3c3c3b;
  letter-spacing: 0.5px;
}

.market-selection-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .market-selection-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
  }
}

/* Hover-hantering för marknadsval */
.market-option {
  transition: all 0.2s ease;
  height: auto !important;
  background-color: white !important;
  text-decoration: none;
}

.market-option .content-container {
  background-color: transparent !important;
  height: auto !important;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-option:hover {
  background-color: #fffceb !important;
}

.market-option.selected {
  background-color: #fffceb !important;
}

.category-card {
  display: flex;
  flex-direction: column;
  height: auto;
  background: inherit;
  text-decoration: none;
  color: inherit;
}

.content-container {
  height: 100px;
  padding: 25px;
  background: white;
  display: flex;
  align-items: center;
}

.content-container h4 {
  margin: 0;
  padding: 0;
}

.content-container {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

/* Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}

/* Market Dropdown */
.market-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.market-selector {
  position: relative;
  min-width: 250px;
  z-index: 1;
}

.selected-market {
  background: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
}

.market-label {
  color: var(--brand-red);
  font-size: 18px;
  font-weight: 400;
}

.dropdown-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
  margin-left: auto;
}

.market-selector.open .dropdown-arrow {
  transform: rotate(180deg);
}

.market-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: none;
  border: 1px solid var(--border-color);
}

.market-selector.open .market-options {
  display: block;
}

.market-option {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  color: var(--text-primary);
}

.market-option:hover {
  background: var(--hover-color);
}

.market-option.active {
  font-weight: 600;
}

.checkmark {
  color: var(--text-primary);
}

/* Filter Toggle Button */
.filter-toggle-btn {
  background: #3c3c3b;
  color: white;
  border: 1px solid #3c3c3b;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

@media (hover: hover) {
  .filter-toggle-btn:hover {
    background: white;
    color: #3c3c3b;
    border-color: #3c3c3b;
  }
}

.filter-toggle-btn:focus {
  outline: none;
}

.filter-toggle-btn:active {
  transform: scale(0.98);
}

.filter-toggle-icon {
  width: 16px;
  height: 16px;
  color: inherit;
}

.filter-count {
  background: var(--brand-red);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

/* Filter Bar */
.filter-bar {
  margin-bottom: 16px;
  padding: 16px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #3c3c3b;
  box-sizing: border-box;
}

.filter-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-column-btn {
  background: white;
  border: 1px solid #999;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.filter-column-btn:hover {
  background: #f0f0f0;
  border-color: #999;
}

.filter-column-btn.active {
  background: #3c3c3b;
  color: white;
  border-color: #3c3c3b;
}

.filter-indicator {
  font-size: 10px;
  line-height: 1;
}

.filter-indicator.active {
  color: var(--brand-red);
}

.clear-all-btn-bar {
  background: #666;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.clear-all-btn-bar:hover {
  background: #555;
}

/* Filter Chips */
.filter-chips-container {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 0;
}

.filter-chips-container.visible {
  margin-top: 12px;
}

.filter-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  background: #D2FEFF;
  border: 1px solid #3c3c3b;
  border-radius: 16px;
  padding: 6px 10px;
  font-size: 12px;
  color: #3c3c3b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-chip.text-filter {
  background: #D2FEFF;
  border: 1px solid #3c3c3b;
  color: #3c3c3b;
}

.filter-chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  font-weight: bold;
}

.filter-chip button:hover {
  opacity: 0.7;
}

/* Sortering */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.sortable:hover {
    color: rgba(255, 255, 255, 0.8);
}

.sort-indicator {
    display: inline-flex;
    flex-direction: column;
    font-size: 8px;
    line-height: 1;
    margin-left: 4px;
    opacity: 0.5;
}

.sort-indicator::before {
    content: '▲';
    display: block;
}

.sort-indicator::after {
    content: '▼';
    display: block;
}

.sortable.sort-asc .sort-indicator {
    opacity: 1;
}

.sortable.sort-asc .sort-indicator::after {
    opacity: 0.3;
}

.sortable.sort-desc .sort-indicator {
    opacity: 1;
}

.sortable.sort-desc .sort-indicator::before {
    opacity: 0.3;
}

/* Filter-ikoner */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.header-text {
    flex: 1;
}

.filter-icon {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-icon:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.filter-icon.active {
    color: var(--brand-red);
    background: rgba(255, 255, 255, 0.2);
}

.filter-icon svg {
    width: 16px;
    height: 16px;
}

/* Filter-popup */
.filter-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

@supports (-webkit-touch-callout: none) {
  .filter-popup {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
  }
}

.filter-content {
    background: white;
    border-radius: 8px;
    padding: 32px;
    min-width: 320px;
    max-width: 500px;
    width: 90vw;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .filter-content {
        min-width: 450px;
        width: auto;
    }
}


.filter-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-inputs label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.filter-inputs input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

.filter-help {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
}

.text-filter input {
    background: #f9f9f9;
}

.text-filter input:focus {
    background: white;
    border-color: var(--brand-red);
    outline: none;
}

/* Range Slider */
.range-slider-container {
    width: 100%;
    margin: 16px 0;
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.range-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.range-value label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.range-value span {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 4px 12px;
    background: #f8f9fa;
    border-radius: 16px;
    border: 1px solid #e5e5e5;
    min-width: 60px;
    text-align: center;
}

.range-slider-wrapper {
    position: relative;
    margin: 24px 0;
}

.range-slider {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e5e5;
    margin: 20px 0;
}

.range-track {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: #e5e5e5;
}

.range-fill {
    position: absolute;
    height: 100%;
    border-radius: 3px;
    background: var(--brand-red);
    top: 0;
}

.range-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--brand-red);
    cursor: pointer;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.range-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.range-handle:active {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 6px 16px rgba(255, 14, 3, 0.3);
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.range-inputs input {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    background: white;
    cursor: text;
    transition: border-color 0.2s ease;
}

.range-inputs input:focus {
    border-color: var(--brand-red);
    outline: none;
}

.range-inputs input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.range-slider.disabled {
    opacity: 0.6;
}

.range-slider.disabled .range-handle {
    cursor: default !important;
    border-color: #ccc !important;
    background: #f0f0f0 !important;
}

.range-slider.disabled .range-fill {
    background: #ccc;
}

.filter-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.filter-action-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 100px;
}

.apply-filter-btn {
    background: var(--brand-red);
    color: white;
}

.apply-filter-btn:hover {
    background: #cc0b02;
    transform: translateY(-1px);
}

.cancel-filter-btn {
    background: white;
    color: var(--text-primary);
    border: 1px solid #e5e5e5;
}

.cancel-filter-btn:hover {
    background: #f8f9fa;
    border-color: #999;
}


/* Table */
.product-table-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.product-module-container {
  padding: 0 !important;
  margin: 0 !important;
}

.product-table-wrapper {
  width: 100%;
  border-radius: 8px;  
  border: 1px solid var(--border-color);
  border-left: none;
  border-right: none;
  position: relative;
}

.table-header {
  position: sticky;
  top: 80px;
  background: #3C3C3B;
  border-bottom: 2px solid var(--border-color);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  z-index: 5;
}

.table-header-row {
  display: flex;
  align-items: center;
  height: 74px;
}

.header-cell {
  font-weight: 600;
  color: #ffffff;
  font-size: 14px;
  text-transform: uppercase;
  line-height: 1.2;
}

.table-row {
  display: flex;
  align-items: center;
  min-height: var(--row-height);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--animation-speed);
  background: #fff;
}

.table-row:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.table-cell[col="product_code"] {
    flex: 0.8;
}

.table-cell[col="product_name"] {
    flex: 1.8;
}
.table-cell[col="description"] {
    flex: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.table-cell {
  flex: 1;
  padding: var(--cell-padding);
  overflow: hidden;
  white-space: nowrap;
}

.table-cell .cta-secondary {
  white-space: nowrap;
  cursor: pointer;
}

.table-row:hover {
  background-color: var(--hover-color);
}

.action-cell {  
  width:130px;  
  max-width: 130px;
  min-width: 100px;
  text-align: left;
  position: sticky;
  right: 0;
  z-index: 1;
}

.show-mobile-only {
  display: none;
}

.plus-button {
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  color: var(--text-primary);
  background: none;
  border: none;
  padding: 0;
}

/* Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--popup-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.popup-overlay.active {
  display: flex;
}

.popup-content {
  background: #FBF7E4;
  border-radius: 12px;
  padding: 50px;
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  font-size: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.popup-title {
  font-size: 42px;
  font-weight: 400;
  color: #333;
  margin-bottom: 60px;
  text-transform: none;
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.popup-close img {
  width: 24px;
  height: 24px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 32px;
  font-size: 1em;
  color: #333;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 13px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.spec-value {
  font-size: 32px;
  color: #333;
  font-weight: 400;
}

/* Original download link styling (för single contact us) */
.download-link {
  margin-top: 60px;
  font-size: 18px;
  color: #000;
  font-weight: 500;
  padding-bottom: 2px;
  text-decoration: none;
  border-bottom: 2px solid var(--brand-red);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.download-link:hover {
  color: var(--brand-red);
}

/* Nya länkar för dubbel layout */
.popup-download-link img,
.popup-contact-link img {
  border-radius: 0 !important;
  overflow: visible !important;
}

.popup-links-dual {
  margin-top: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.popup-download-link,
.popup-contact-link {
  font-size: 18px;
  color: #000;
  font-weight: 500;
  padding-bottom: 2px;
  text-decoration: none;
  border-bottom: 2px solid var(--brand-red);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.popup-download-link:hover,
.popup-contact-link:hover {
  color: var(--brand-red);
}

.hidden {
  display: none !important;
}

.loading-message {
  color: #ff0e03;
  font-weight: bold;
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hide-tablet {
    display: none !important;
  }
  
  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .selected-market {
    font-size: 18px;
    padding: 6px 12px;
  }

  .market-label {
    font-size: 18px;
  }
  
  .market-option {
    font-size: 16px;
    padding: 8px 12px;
  }

  .filter-icon {
    padding: 2px;
  }

  .filter-icon svg {
    width: 14px;
    height: 14px;
  }


  .sort-indicator {
    font-size: 6px;
  }

  .controls-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .market-dropdown {
    width: 100%;
  }

  .market-selector {
    width: 100%;
    min-width: unset;
  }

  .filter-toggle-btn {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .hide-mobile {
    display: none !important;
  }

  .show-desktop-tablet {
    display: none;
  }
    
  .show-mobile-only {
    display: block;
  }

  .market-dropdown {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .market-selector {
    width: 100%;
  }

  .filter-column-btn {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 10px;
  }

  .table-cell {
    flex: 3;
  }

  .action-cell {
    flex: 1;
    min-width: 40px;
    text-align: right;
    padding-right: 16px;
  }

  .plus-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }

  .popup-content {
    padding: 16px;
    font-size: 14px;
  }
  
  .spec-label {
    font-size: 12px;
  }
  
  .spec-value {
    font-size: 22px;
  }
  
  .download-link {
    font-size: 16px;  
    margin-top: 30px;
  }

  .popup-download-link,
  .popup-contact-link {
    font-size: 16px;
  }

  .popup-links-dual {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-top: 30px;
  }
  
  .popup-title {
    font-size: 24px;
    letter-spacing: -0.5px;
    margin-bottom: 30px;
  }
  
  .header-cell {
    font-size: 11px; 
  }

  .table-cell {
    font-size: 13px;
    padding: 8px;
  }

  .table-row {
    min-height: 20px;
  }

  .table-cell {
    flex: 1; 
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; 
  }
  .table-header-row {
    height: 50px;
  }
  .table-header {
    top: 60px;
  }
  .action-cell {
    flex: 0.3 !important; 
    max-width: 50px;
  }

  .filter-content {
    padding: 16px;
    min-width: 280px;
  }

  .filter-inputs input {
    font-size: 14px;
  }

  .header-content {
    gap: 4px;
  }

  .filter-icon {
    padding: 1px;
  }

  .filter-icon svg {
    width: 12px;
    height: 12px;
  }

  .sort-indicator {
    display: none;
  }
    
  .sortable {
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}