/* INDEX PAGE CSS */

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 35ch; /* limits to 6 characters */
}
/* CSS */
.multi-line-truncate {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5em;
  max-height: 3em; /* 2 lines * 1.5em line-height */
  width: 25ch;
  word-wrap: break-word;
}
.sort-arrow {
  margin-left: 5px;
  display: inline-block;
  font-size: 13px;
  color: #DCDCDC;
}

.ascending .sort-arrow::after {
  content: "▲";
}

.descending .sort-arrow::after {
  content: "▼";
}

.ascending .sort-arrow,
.descending .sort-arrow {
  content: "";
}

/* COMMENTED OUT BECAUSE MESSED UP THE INDEXES*/
/* * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
} */

/* body {
  font-family: "Arial", sans-serif;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f4f4f4;
} */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2x2 Grid */
  grid-gap: 20px;
  padding: 20px;
}

.product-item {
  background-color: white;
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: #333;
  border: 2px solid #fabc01;
}

.product-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.product-item:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* HEADING*/
header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between; /* Spread logo and selectors */
  align-items: center;
}

.logo img {
  max-height: 50px;
}

.logo {
  display: inline-block;
  cursor: pointer;
}

.selectors {
  display: flex;
  gap: 20px; /* Add spacing between selectors */
}

#language-selector,
#country-selector {
  padding: 5px 10px;
  font-size: 16px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  cursor: pointer;
}

/* Main content spacing to prevent overlap with fixed header */
main {
  margin-top: 80px;
}

/* Styles for flag icons */
#country-selector option[data-flag] {
  background-image: url("path_to_flag_image");
  background-repeat: no-repeat;
  background-position: left center;
  padding-left: 30px;
}

/* Add/modify CSS for beautified table */
.product-table {
  margin-bottom: 20px;
}

.table-header {
  background: linear-gradient(90deg, #2d2d2d, #4d4d4d); /* similar to selected icon gradient */
  color: white;
  font-size: clamp(0.8rem, 2vw, 1rem); /* dynamic font size */
  padding: 0.75rem; /* add padding for consistency */
}

@media (max-width: 640px) {
  .table-header th {
    font-size: clamp(0.65rem, 3vw, 0.85rem); /* reduced font size on mobile */
    padding: 0.5rem;
  }
  .product-table td {
    font-size: 0.75rem;
    padding: 0.5rem;
  }
}

/* Clear and modern sort UI */
th.sortable {
  cursor: pointer;
  padding-right: 1rem; /* Reserve space for arrow */
  position: relative;
}

.sort-arrow {
  margin-left: 0.25rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem; /* ~14px */
  transition: color 0.2s, opacity 0.2s;
  color: #9CA3AF; /* Tailwind gray-400 */
  opacity: 0.6;
}

th.sortable:hover .sort-arrow {
  color: #6B7280; /* Tailwind gray-500 */
}

th.sortable.ascending .sort-arrow,
th.sortable.descending .sort-arrow {
  opacity: 1;
}

th.sortable.ascending .sort-arrow::after {
  content: "▲";
  margin-left: 0.125rem;
  font-size: inherit;
}

th.sortable.descending .sort-arrow::after {
  content: "▼";
  margin-left: 0.125rem;
  font-size: inherit;
}