/* ============================================================
   BODEGA INVENTORY — STYLESHEET
   Colors:
     bodegaRed:   #C43A2F
     cream:       #F4E9D8
     softBlack:   #2B2B2B
     mustard:     #D9A441
     bodegaGreen: #3F6B4B
   ============================================================ */

/* ── Fonts ── */

@font-face {
  font-family: "bebas";
  src: url("/fonts/BebasNeue-Regular.ttf");
}

@font-face {
  font-family: "inter";
  src: url("/fonts/Inter.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
}

@font-face {
  font-family: "inter";
  src: url("/fonts/inter-italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 100 900;
}

/* ── Reset ── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "inter";
}

*:focus {
  outline: none;
}

/* ── Base ── */

body {
  background-color: #f4e9d8;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

footer {
  display: flex;
  justify-content: center;
}

/* ── Skip Link ── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 8px 16px;
  background-color: #2b2b2b;
  color: #f4e9d8;
  font-family: "bebas";
  font-size: 20px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #d9a441;
  outline-offset: 3px;
}

/* ── Header ── */

.main-header {
  display: flex;
  border: 1px solid black;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f4e9d8;
}

.small-logo {
  width: 10rem;
  border: 1px solid black;
}

.logo-nav-form {
  display: flex;
  padding: 10px;
}

.nav-form {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  margin-left: 10px;
  width: 100%;
}

/* ── Navigation ── */

.main-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
}

.main-links {
  text-decoration: none;
  color: inherit;
  font-family: "bebas";
  font-size: 28px;
}

.open-link {
  text-decoration: none;
  color: inherit;
}

a.main-links[aria-current="page"] {
  color: #d9a441;
  border-bottom: 2px solid #d9a441;
}

/* ── Login / Logout Widget ── */

.login-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid black;
  border-radius: 8px;
  padding: 6px 14px;
}

.login-link--active {
  background-color: #f0ede6;
  border-color: #3f6b4b;
}

.login-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.login-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #3f6b4b;
  flex-shrink: 0;
}

.login-username {
  font-family: "bebas";
  font-size: 20px;
  color: #2b2b2b;
  letter-spacing: 0.5px;
}

.login-nav-link {
  font-family: "bebas";
  font-size: 28px;
  text-decoration: none;
  color: inherit;
}

.logout-button {
  height: 25px;
  padding: 0 10px;
  border: 1px solid black;
  border-radius: 5px;
  background-color: #c43a2f;
  color: white;
  cursor: pointer;
  font-family: "inter";
  font-size: 13px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

/* ── Buttons ── */

.form-button {
  height: 25px;
  padding: 0 10px;
  border: 1px solid black;
  border-radius: 5px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

/* Shared base for edit and delete action buttons */
.item-action-button {
  text-decoration: none;
  color: inherit;
  font-size: 13.33px;
  border: 1px solid black;
  border-radius: 8px;
  padding: 4px 6px;
  background-color: #efefef;
  width: fit-content;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.details-button {
  background-color: #e8e8e8;
}

.confirm-button {
  margin-top: 15px;
}

/* ── Add / Edit Item Form ── */

.create-new-title {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.form-title {
  font-family: "bebas";
  font-size: 28px;
  margin-top: 6px;
  line-height: 0.6;
}
.form-fields {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-field > input,
.form-field > select {
  height: 25px;
  padding: 0 5px;
  border: 1px solid black;
  border-radius: 5px;
}

.error-list {
  font-size: 12px;
  gap: 10px;
  display: flex;
}

.error {
  padding: 5px;
}

/* ── Login Page ── */

.form-input-group {
  display: flex;
  flex-direction: column;
}

.auth-page {
  padding: 2rem;
}

.auth-form {
  margin-top: 1rem;
  width: 15rem;
}

.auth-label {
  margin-top: 10px;
}

.auth-input {
  margin-bottom: 10px;
}

.auth-button {
  margin-top: 10px;
}

/* ── Homepage — Category Grid ── */

.index-title {
  font-family: "bebas";
  font-size: 3rem;
}

.page-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-grid {
  display: grid;
  padding: 1.5rem;
  grid: 1fr 1fr / 1fr 1fr 1fr;
  column-gap: 5rem;
  row-gap: 2rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px black solid;
  padding: 10px 20px;
  min-height: 15rem;
}

.category-card .open-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
}

.category-image {
  height: 13rem;
}

/* ── Category / All Items Page ── */

.items-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.items-title {
  margin-bottom: 10px;
}

.back-to-link {
  margin-left: 40px;
}

/* ── Table ── */

.sort-icon {
  height: 25px;
  vertical-align: middle;
  border: 0.5px solid black;
  padding: 2px;
  border-radius: 8px;
  background-color: rgb(211, 216, 222);
}

.items-table {
  border-collapse: collapse;
  width: 90%;
}

/* Image column */
.items-table th:nth-child(1),
.items-table td:nth-child(1) {
  width: 50px;
}

/* Size column */
.items-table th:nth-child(3),
.items-table td:nth-child(3) {
  width: 100px;
}

/* Price column */
.items-table th:nth-child(4),
.items-table td:nth-child(4) {
  width: 80px;
}

/* Stock column */
.items-table th:nth-child(5),
.items-table td:nth-child(5) {
  width: 80px;
}

.items-table th,
.items-table td {
  border: 1px solid black;
  padding: 8px 12px;
  text-align: left;
  vertical-align: middle;
}

.items-table th {
  font-weight: bold;
}

.column-header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-image {
  height: 3rem;
  display: block;
}

.name-cell {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 6px;
}

.item-name {
  text-decoration: none;
  color: inherit;
}

/* ── Individual Item Page ── */

.item-main {
  display: flex;
  flex-direction: column;
}

.item-overview {
  display: flex;
  padding: 50px 40px;
}

.item-image-large {
  height: 20rem;
  margin: 0 30px;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.item-info dt {
  margin-top: 10px;
}

.item-price-details dt,
.item-meta-details dt,
.item-description-details dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2b2b2b;
  opacity: 0.6;
}

.item-price-details dd {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.item-meta-details {
  display: flex;
  flex-direction: column;
}

.item-meta-details dd {
  font-size: 1rem;
  margin: 0;
}

.item-description-details {
  max-width: 45%;
}

/* ── Hover States ── */

.thumbnail-cell {
  transition: background-color 0.15s ease;
}

.thumbnail-cell:hover {
  background-color: #d9a441;
}

.main-links:hover,
.login-nav-link:hover {
  color: #d9a441;
}

.category-card:hover {
  border-color: #d9a441;
  background-color: #fdf5e8;
}

.item-name:hover {
  color: #d9a441;
}

.item-action-button:hover {
  background-color: #d9a441;
  border-color: #d9a441;
  color: white;
}

.delete-button:hover {
  background-color: #c43a2f;
  border-color: #c43a2f;
  color: white;
}

.form-button:hover {
  background-color: #d9a441;
  border-color: #d9a441;
  color: white;
}

.logout-button:hover {
  background-color: #a82e24;
  border-color: #a82e24;
}

.sort-icon:hover {
  background-color: #d9a441;
  border-color: #d9a441;
}

/* ── Focus States ── */

.main-links:focus-visible,
.login-nav-link:focus-visible {
  color: #d9a441;
  outline: 2px solid #d9a441;
  outline-offset: 3px;
  border-radius: 3px;
}

.form-button:focus-visible,
.logout-button:focus-visible,
.item-action-button:focus-visible {
  outline: 2px solid #d9a441;
  outline-offset: 3px;
}

.item-name:focus-visible {
  color: #d9a441;
  outline: 2px solid #d9a441;
  outline-offset: 3px;
  border-radius: 3px;
}

.sort-icon:focus-visible {
  outline: 2px solid #d9a441;
  outline-offset: 2px;
}

.category-card:focus-within {
  border-color: #d9a441;
}

/* ── Media Queries ── */

@media (max-width: 600px) {
  .main-nav {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .login-link {
    position: static;
    transform: none;
    align-self: center;
    flex-wrap: wrap;
    justify-content: center;
  }
}
