thead th {
    position: sticky;
    top: 0; /* distance from the top of the viewport */
    background-color: #fff; /* needed so content doesn’t show through */
    z-index: 10; /* ensures headings are above other elements */
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1); /* optional shadow for visibility */
}

body {
  background-color: #1e1e1e;  /* dark page background */
  color: #f8f9fa;             /* light text for readability */
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.table-rounded {
    border-radius: 12px;
    background-color: #212529; /* Bootstrap dark table base */
    border: 1px solid #444;
}
      
.container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

      
/* Links */
a {
    color: #66aaff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ================= Table Styles ================= */
.table-container {
    max-width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

.table-sm td, .table-sm th {
padding: .3rem .4rem;
}

.listings-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px; /* ensures horizontal scroll if needed */
}

.listings-table th,
.listings-table td {
    border: 1px solid #333;
    padding: 8px 12px;
    text-align: left;
}

.listings-table thead th {
    position: sticky;
    top: 0;
    background-color: #1f1f1f;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.5);
}

.listings-table tbody tr:nth-child(even) {
    background-color: #1a1a1a;
}

.listings-table tbody tr:hover {
    background-color: #2a2a2a;
}

/* ================= Card Styles ================= */
.listings-grid {
    display: none; /* hidden on desktop by default */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

.listing-card {
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px 16px;
    background-color: #1e1e1e;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
}

.card-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.card-row .label {
    font-weight: 600;
    color: #aaa;
}

.card-row .value {
    color: #fff;
}


/* ================= Responsive Rules ================= */
@media screen and (max-width: 768px) {
    .listings-table {
        display: none; /* hide table on mobile */
    }
    .listings-grid {
        display: grid; /* show cards on mobile */
    }
}

@media screen and (max-width: 400px) {
    .card-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-row .value {
        margin-top: 2px;
    }
}

/* ================= Filters & Sorts ================= */
.filter-container, .sort-container {
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-container label, .sort-container label {
    font-weight: 600;
    margin-right: 6px;
}

/* Inputs & selects dark mode */
input, select {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #333;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Buttons dark mode */
button {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background-color: #444;
}

.min-w-cpu {
  min-width: 220px;
}

.min-w-storage {
  min-width: 140px;
}

.min-w-ram {
  min-width: 110px;
}

.min-w-default {
  min-width: 140px;
}

/*=============== navbar ====================*/

.navbar-compact {
  min-height: 42px;
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-compact .container {
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-compact .navbar-brand {
  margin-right: 0.75rem;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.1;
}

.navbar-compact .navbar-nav {
  align-items: left;
}

.navbar-compact .nav-link {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.1;
}

.navbar-compact .navbar-toggler {
  padding: 0.15rem 0.4rem;
  font-size: 0.9rem;
}

.navbar .dropdown .btn {
    margin-top: auto;
    margin-bottom: auto;
}

/* Ensure dropdowns appear above sticky table headers */
.dropdown-menu {
    z-index: 1050 !important; /* higher than sticky-top (1020) */
}

/*========== sorting =============*/
.sort-arrow {
    display: inline-block;
    width: 1.2em;      /* fixed space so headers don't jump */
    text-align: center;
    font-size: 0.8em;
    line-height: 1;
    opacity: 0.8;
}

/*============= price ==============*/
.price-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    white-space: nowrap;
}

.price-main {
    font-weight: 600;
}

.price-code {
    font-size: 0.72em;
    opacity: 0.8;
    line-height: 1;
}

/* price in the heading */
.price-heading-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    white-space: nowrap;
}

.price-heading-code {
    font-size: 0.75em;
    margin-left: 0.35rem;
    text-transform: uppercase;
    opacity: 0.8;
    white-space: nowrap;
}

.button-text {
    color: #66aaff;
}

.button-statistics {
    color: #daec36;
}

.discount {
    color:rgb(50, 220, 50);
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;   /* keeps them on same vertical line */
    gap: 16px;
    flex-wrap: wrap;       /* allows stacking on small screens */
    margin-bottom: 1rem;
}

.page-title {
    margin: 0;             /* remove default h1 bottom margin */
}

.aff-disclaimer-wrap {
    margin-left: auto;     /* pushes it to the right */
    text-align: right;
}