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

/* ========== VARIABLES ========== */
:root {
  --primary: #BD8448;
  --primary-hover: #A86C3A;
  --bg: #FFFFFF;
  --text-primary: #606060;
  --text-secondary: #201F1F;
  --border: #E1E1E1;
  --card: #FFFFFF;
  --hover: #F5F5F5;
  --table-header: #F5F5F5;
}

/* ========== BASE LAYOUT ========== */
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  padding: 24px;
  margin: 0;
  line-height: 1.7;
}

h1 {
  text-align: center;
  font-weight: 600;
  font-size: 28px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.header-wrapper h1 {
  margin: 32px 0;
}

/* ========== LINKS ========== */
a {
  color: var(--primary);
  text-decoration: none;
  transition: 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* ========== VENDOR INDEX ========== */
#vendor-index {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#vendor-index a {
  background: var(--card);
  padding: 16px 20px;
  border-radius: 6px;
  border-left: 5px solid var(--primary);
  font-weight: 500;
  font-size: 16px;
  color: var(--text-secondary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

#vendor-index a:hover {
  background: var(--primary);
  color: var(--bg);
}

/* ========== TABLE VIEW (Desktop) ========== */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
  margin-top: 40px;
}

table {
  border-collapse: collapse;
  min-width: 2500px;
  background: var(--card);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

thead {
  background: var(--table-header);
}

thead th {
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding: 16px 18px;
}

th,
td {
  padding: 18px;
  font-size: 14px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
}

tbody tr:nth-child(even) {
  background-color: #f4f3f3;
}

tbody tr:hover {
  background: var(--text-primary);
  color: white;
}

.image-wrapper {
  width: 100px;
  height: 100px;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

img.thumbnail {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Custom Width Adjustments */
table td:nth-child(8),
table th:nth-child(8) {
  text-align: left;
  width: 300px;
  max-width: 300px;
}

table td:nth-child(2),
table th:nth-child(2) {
  padding: 5px;
}

table td:nth-child(3),
table th:nth-child(3) {
  width: 53px;
}

table td:nth-child(10),
table th:nth-child(10),
table td:nth-child(11),
table th:nth-child(11) {
  width: 250px;
}

/* ========== MOBILE PRODUCT LIST ========== */
.mobile-product-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.product-card {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 5%;
}

.product-card img {
  width: 100%;
  /* max-height: 400px; */
  object-fit: cover;
  border-radius: 6px;
}

.product-card h3 {
  margin: 12px 0 6px;
  font-size: 18px;
  color: var(--text-secondary);
}

.product-card p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--text-primary);
}

/* ========== MODAL / POPUP STYLING ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 80%;
  max-height: 90%;
  overflow-y: auto;
}

.close-button {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

.hidden {
  display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 24px;
  }

  th,
  td {
    padding: 12px;
    font-size: 13px;
  }

  .image-wrapper {
    width: 100px;
    height: 100px;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }


}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

/* ========== PRINT ========== */
@media print {
  .table-wrapper {
    overflow: visible !important;
    width: auto !important;
  }

  #product-table {
    width: auto !important;
    table-layout: auto !important;
  }

  #download-pdf,
  .mobile-only,
  .modal,
  .modal-content {
    display: none !important;
  }

  .desktop-only {
    display: block !important;
  }

  @page {
    size: A3 landscape;
  }

  table th:nth-child(18),
  table td:nth-child(18) {
    width: 150px;
  }

  tbody tr:nth-child(even) {
    background-color: #f4f3f3 !important;
  }

  tbody tr:hover {
    background: var(--bg);
    color: var(--text-primary);
  }

  table {
    min-width: 2000px;
  }
}

/* ========== DOWNLOAD BUTTON ========== */
#download-pdf {
  background: linear-gradient(110deg, var(--primary), var(--primary-hover));
  color: #fff;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#download-pdf:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  background: var(--primary-hover);
}

#download-pdf:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* ========== METADATA FOOTER ========== */
.vendor-meta {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: left;
  margin-top: 10px;
}