/* 0. Import pixel font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* 1. Title‐link reset */
h1 a { color: inherit; text-decoration: none; }
h1 a:hover { text-decoration: underline; }

/* 2. Palette */
:root {
  --pk-yellow: #FFDE00;
  --pk-blue:   #3D7DCA;
  --pk-red:    #EE1515;
  --pk-white:  #FFFFFF;
  --pk-gray:   #F3F3F3;
  --pk-green:  #00AA00; /* for approve text */
}

/* 3. Global resets */
* { box-sizing: border-box; }
body {
  font-family: 'Press Start 2P', sans-serif;
  background: var(--pk-gray);
  color: #333;
  margin: 2rem auto;
  max-width: 1200px;
}

/* 4. Headings */
h1 {
  text-align: center;
  color: var(--pk-blue);
  margin-bottom: .25rem;
}
.subtitle {
  text-align: center;
  font-size: .9rem;
  color: #555;
  margin-bottom: 1rem;
}

/* 5. Form controls */
.form-controls {
  text-align: center;
  margin-bottom: 1.5rem;
}
.form-controls select,
.form-controls input,
.form-controls button {
  font-family: 'Press Start 2P', sans-serif;
  font-size: .7rem;
  margin: 0 .5rem;
  padding: .3rem .5rem;
}

/* 6. Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 1.5rem;
}

/* 7. Cards */
.card {
  background: var(--pk-white);
  border: 3px solid var(--pk-blue);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}
.card a { color: inherit; text-decoration: none; }

.card img {
  display: block;
  width: auto;
  height: 200px;
  object-fit: contain;
  margin: 1rem auto 0;
}

.lang-indicator {
  font-size: .7rem;
  color: #666;
  margin: .3rem 0 0;
}

.card h2 {
  color: var(--pk-red);
  font-size: .9rem;
  margin: .3rem 0 .5rem;
  line-height: 1.2;
}

.card .price {
  color: var(--pk-blue);
  font-size: .9rem;
  font-weight: bold;
}

.card .stock {
  color: green;
  font-size: .8rem;
  margin-bottom: .5rem;
}

.card .out {
  color: red;
  font-size: .8rem;
  margin-bottom: .5rem;
}

/* 8. Detail container */
.detail-container {
  background: var(--pk-white);
  border: 3px solid var(--pk-red);
  border-radius: 8px;
  padding: 1rem;
  margin: 0 auto;
  max-width: 800px;
}
.detail-image {
  text-align: center;
  margin-bottom: 1rem;
}
.detail-image img {
  max-width: 300px;
  width: 100%;
  height: auto;
  border: 2px solid var(--pk-blue);
  border-radius: 4px;
}
.detail-container h1 {
  color: var(--pk-blue);
  font-size: 1.2rem;
  margin-bottom: .5rem;
}
.detail-container table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.detail-container th,
.detail-container td {
  padding: .5rem;
  border: 1px solid #ccc;
  text-align: center;
}
.detail-container th {
  background: var(--pk-gray);
  color: #333;
}

/* 9. Misc */
.text-muted { color: #666; }

/* 10. Banner with perfectly centered back‐arrow */
.page-banner {
  max-width: 800px;
  margin: 0 auto 1rem;
  background: var(--pk-blue);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  position: relative;
  text-align: center;
}
.page-banner .banner-title {
  font-family: 'Press Start 2P', sans-serif;
  font-size: 1.2rem;
  color: var(--pk-white);
  display: inline-block;
}
.page-banner .back-button {
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  margin: auto 0;
  font-family: 'Press Start 2P', sans-serif;
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--pk-white);
  text-decoration: none;
  line-height: 1;
}
.page-banner .back-button:hover {
  text-decoration: underline;
}

/* ————————————————
   Admin login page styling 
   ———————————————— */
body.admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--pk-gray);
}
.login-box {
  background: var(--pk-white);
  border: 3px solid var(--pk-blue);
  border-radius: 8px;
  padding: 2rem;
  width: 320px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
}
.login-box h1 {
  margin-top: 0;
  color: var(--pk-blue);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.login-box input {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  font-family: 'Press Start 2P', sans-serif;
  font-size: .7rem;
}
.login-box button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  font-family: 'Press Start 2P', sans-serif;
  font-size: .7rem;
}
.login-error {
  color: var(--pk-red);
  font-size: .8rem;
  margin-bottom: 1rem;
}

/* ————————————————
   Admin container & table
   ———————————————— */
.admin-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.admin-container h1 {
  color: var(--pk-blue);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Press Start 2P', sans-serif;
  font-size: .7rem;
}
.admin-table th,
.admin-table td {
  padding: .75rem;
  text-align: left;
  border: 1px solid #ccc;
}
.admin-table th {
  background: var(--pk-blue);
  color: var(--pk-white);
  position: sticky;
  top: 0;
  z-index: 1;
}
.admin-table tr:nth-child(even) {
  background: var(--pk-gray);
}
.admin-table tr:hover {
  background: rgba(61,125,202,0.1);
}

/* — Make only non-button links red — */
.admin-table a:not(.button) {
  color: var(--pk-red);
  text-decoration: none;
}
.admin-table a:not(.button):hover {
  text-decoration: underline;
}

/* — Base “button” styling — */
.button {
  background: var(--pk-blue);
  color: var(--pk-white);
  padding: .5rem 1rem;
  text-decoration: none;
  border-radius: 4px;
  font-family: 'Press Start 2P', sans-serif;
  font-size: .7rem;
  border: none;
  cursor: pointer;
}

/* — Reject variant — */
.button--reject {
  background: var(--pk-red);
  color: var(--pk-white) !important;
}

/* — Approve variant — */
.button--approve {
  background: var(--pk-green);
  color: var(--pk-white) !important;
}

/* Explicit overrides inside table */
.admin-table .button--approve {
  color: var(--pk-white) !important;
}
.admin-table .button--reject {
  color: var(--pk-white) !important;
}

/* Header / nav */
.admin-header {
  width: 100%;
  margin-bottom: 1rem;
}
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 1rem auto;
}
.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}
.nav-left a,
.nav-right a {
  font-family: 'Press Start 2P', sans-serif;
  font-size: .8rem;
  color: var(--pk-blue);
  text-decoration: none;
  margin: 0 .5rem;
}
.nav-left span {
  color: #666;
  margin: 0 .5rem;
}
.nav-left a:hover,
.nav-right a:hover {
  text-decoration: underline;
}
/* wrap wide tables */
.table-responsive {
  overflow-x: auto;
  margin-top: 1rem;
}

/* make slug cells readable / wrapped */
.slug-cell code {
  display: block;
  font-family: monospace;
  font-size: .65rem;
  word-break: break-all;
  white-space: normal;
  max-width: 160px;
  color: #333;
}

/* tone down cell padding for compactness */
.admin-table th,
.admin-table td {
  padding: .5rem;
}
/* ———————————————— */
/* Fix overlapping action buttons */
/* ———————————————— */

/* 1) Make sure the last <td> (Actions) never wraps internally */
.admin-table td:last-child {
  white-space: nowrap;
}

/* 2) Give each .button a small margin */
.admin-table td .button {
  display: inline-block;
  margin: 0 0.25rem;
  white-space: nowrap;
}

/* 3) Let the table size itself normally (not “fixed”) so columns can flex */
.admin-table {
  table-layout: auto;
}
/* ————————————————————————————
   Make the admin table full-width
   ———————————————————————————— */
   .admin-container {
    max-width: 1200px;    /* or whatever page width you like */
    padding: 0 1rem;
    margin: 2rem auto;
  }
  
  .admin-actions {
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .admin-table {
    width: 100%;
    table-layout: auto;   /* let columns size themselves */
    border-collapse: collapse;
    font-size: .7rem;
  }
  
  /* ensure our sticky header doesn’t break */
  .admin-table th {
    position: sticky;
    top: 0;
    background: var(--pk-blue);
  }
  
  /* shrink wrap buttons so they don’t force new lines */
  .admin-table td:last-child {
    white-space: nowrap;
  }
  