/* ================================================================
   D2 Product Table v1.1.0
   ================================================================ */

/* ----------------------------------------------------------------
   Wrap
   ---------------------------------------------------------------- */
.d2pt-wrap {
  max-width: 1320px;
  margin: 0 auto;
}

.d2pt-headline-wrap {
  margin: 0 0 32px;
}

.d2pt-title {
  margin: 0;
  font-size: 52px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* ----------------------------------------------------------------
   Horisontal filterbar
   ---------------------------------------------------------------- */
.d2pt-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 0 0 20px;
  padding: 18px 20px;
  background: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
}

/* Sticky filterbar */
.d2pt-filters--sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 248, 248, 0.97);
  backdrop-filter: blur(6px);
}

/* Hvert filter-element: label over select */
.d2pt-filter-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 240px;
}

.d2pt-filter-item--search {
  flex: 1 1 200px;
  max-width: 280px;
}

.d2pt-filter-item--sort {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 300px;
}

.d2pt-filter-label {
  font-size: 12px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}

/* ----------------------------------------------------------------
   Select + søgefelt
   ---------------------------------------------------------------- */
.d2pt-select,
.d2pt-search {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-size: 15px;
  line-height: 1.2;
  transition: border-color 0.15s;
}

.d2pt-select {
  padding-right: 38px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.d2pt-select:focus,
.d2pt-search:focus {
  outline: none;
  border-color: #111;
}

.d2pt-search {
  padding-right: 14px;
}

/* Sortering + Nulstil-knap side om side */
.d2pt-sort-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.d2pt-sort-row .d2pt-select {
  flex: 1;
  min-width: 130px;
}

.d2pt-reset {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: #fff;
  color: #555;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.d2pt-reset:hover {
  border-color: #111;
  color: #111;
}

/* ----------------------------------------------------------------
   Antal-linje
   ---------------------------------------------------------------- */
.d2pt-summary {
  margin: 0 0 14px;
  font-size: 15px;
  color: #666;
}

/* ----------------------------------------------------------------
   Tabel
   ---------------------------------------------------------------- */
.d2pt-table-wrap {
  border: 1px solid #e3e3e3;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.d2pt-table {
  width: 100%;
  border-collapse: collapse;
}

.d2pt-table th,
.d2pt-table td {
  padding: 20px 22px;
  border-bottom: 1px solid #ececec;
  vertical-align: middle;
  text-align: left;
}

.d2pt-table tbody tr:last-child td {
  border-bottom: 0;
}

.d2pt-table th {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fafafa;
}

.d2pt-col-price {
  width: 260px;
}

.d2pt-col-action,
.d2pt-cell-action {
  width: 160px;
  text-align: right;
}

/* Produktnavn */
.d2pt-product-link {
  color: #111;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
}

.d2pt-product-link:hover {
  color: #f28c00;
}

/* Prislinjer */
.d2pt-price-line {
  display: block;
  font-size: 15px;
  line-height: 1.55;
  color: #333;
}

.d2pt-price-line--excl {
  font-weight: 700;
}

.d2pt-price-line--incl {
  color: #777;
  font-size: 13px;
}

/* Tilføj til kurv-knap — stærk reset mod Divi/Woo-overrides */
.d2pt-wrap .d2pt-cart-btn,
.d2pt-wrap a.d2pt-cart-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  padding: 0 16px !important;
  background: #000 !important;
  background-color: #000 !important;
  color: #fff !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: background 0.15s;
}

.d2pt-wrap .d2pt-cart-btn:hover,
.d2pt-wrap a.d2pt-cart-btn:hover {
  background: #f28c00 !important;
  background-color: #f28c00 !important;
  color: #fff !important;
}

/* Tom-besked */
.d2pt-empty {
  padding: 28px 22px;
  font-size: 16px;
  color: #666;
}

/* ----------------------------------------------------------------
   Admin
   ---------------------------------------------------------------- */
.d2pt-admin-wrap .d2pt-admin-card {
  max-width: 900px;
  margin: 0 0 20px;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
}

/* ----------------------------------------------------------------
   Responsiv
   ---------------------------------------------------------------- */
@media (max-width: 1100px) {
  .d2pt-filter-item {
    flex: 1 1 140px;
    max-width: 220px;
  }
}

@media (max-width: 780px) {
  .d2pt-title {
    font-size: 38px;
  }

  /* Filterbar: to kolonner på tablet */
  .d2pt-filter-item {
    flex: 1 1 calc(50% - 8px);
    max-width: none;
  }

  .d2pt-filter-item--sort {
    flex: 1 1 100%;
    max-width: none;
  }

  /* Kolonne-headers skjules på mobil */
  .d2pt-table thead {
    display: none;
  }

  .d2pt-table,
  .d2pt-table tbody,
  .d2pt-table tr,
  .d2pt-table td {
    display: block;
    width: 100%;
  }

  .d2pt-table tr {
    padding: 16px 18px 8px;
    border-bottom: 1px solid #ececec;
  }

  .d2pt-table td {
    padding: 0 0 12px;
    border: 0;
  }

  .d2pt-cell-action {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .d2pt-filter-item {
    flex: 1 1 100%;
    max-width: none;
  }
}
