/* ---------- Base / Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scrollbar-gutter: stable;      /* or: stable both-edges */
}
body {
  font-family: Arial, sans-serif;
  font-size: 16px;
  background-color: #f4f4f4;
  color: #333;
}

/* ---------- Layout ---------- */
.container {
  width: 90%;      /* Centered column width */
  max-width: 1100px; 
  margin: 0 auto;         /* Centers the container */
  padding: 20px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,.08);
  border-radius: 6px;
}
.container form {
  margin-bottom: 20px;  /* pushes anything below the form down */
}
ul {
  list-style-position: outside; /* default, but we'll control spacing */
  padding-left: 1.2em;          /* adjust until text aligns how you like */
  margin-left: 0;
}
ul .muted {
  list-style-position: outside; /* default, but we'll control spacing */
  padding-left: 1.2em;          /* adjust until text aligns how you like */
  margin-left: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { margin-bottom: 15px; color: #222; }

/* ---------- Links & Buttons ---------- */
a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-size: inherit;       /* same font size */
  line-height: 1.2;      /* optional: match vertical rhythm */
  font-family: inherit;  /* make sure both inherit the same font */
  padding: 6px 12px;
  background-color: #0066cc;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { background-color: #004999; }

.back-link::before {
  content: "\2B60";   /* ? LEFTWARDS ARROW */
  font-weight: bold;
  margin-right: .4em;
  display: inline-block;
  transform: scale(1.3); /* enlarge it */
}
.button-link {
  font-size: inherit;       /* same font size */
  line-height: 1.2;      /* optional: match vertical rhythm */
  font-family: inherit;  /* make sure both inherit the same font */
  padding: 6px 12px;            /* match the <button>¡¯s padding */
  display: inline-block;        /* make <a> behave like a button */
  background: #eee;             /* styling to match */
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
}
.button-link:hover {
  background: #ddd; /* same hover look */
}

.quick-form label,
.quick-form input[type="number"],
.quick-form input[type="text"],
.quick-form button {
  display: inline-block;
  vertical-align: middle; /* <- key */
  margin: 0;
  font: inherit;
}

.quick-form input[type="number"],
.quick-form input[type="text"],
.quick-form button {
  padding: 6px 12px;
  box-sizing: border-box;
}  

/* ---------- Forms ---------- */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
/* ---------- Cards / Tables ---------- */
.product-card {
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  background-color: #fff;
}
.product-card img { max-width: 100%; height: auto; }

table.cart {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}
table.cart th, table.cart td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}
table.cart th { background-color: #f0f0f0; }

/* Make the table behave like a responsive grid */
.product-grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;           /* we’ll use gap below instead */
  table-layout: fixed;
  display: block;              /* stop behaving like a table */
}

/* Use flexbox to lay out the cells as cards with gaps */
.product-grid-table tbody {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;                   /* replaces border-spacing as grid gap */
  margin: 0; padding: 0;
}

/* Let cells participate directly in the flex container */
.product-grid-table tr {
  display: contents;           /* tr won’t force hard rows */
}

/* Base: 4 columns */
.product-grid-table td {
  display: block;              /* makes the cell a proper flex item block */
  flex: 1 1 calc(25% - 20px);  /* 4 per row minus the gap */
  box-sizing: border-box;
}

.product-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.product-card .thumb {
  width: 100%;
  height: auto;
  display: block;
  /* Optional for uniform tiles:
  aspect-ratio: 4 / 3;
  object-fit: cover;
  */
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  .product-grid-table td {
    flex: 1 1 calc(50% - 20px);
  }
}

/* Phone: 1 column */
@media (max-width: 640px) {
  .product-grid-table td {
    flex: 1 1 100%;
  }
}

/* =======================================================
   NAVBAR (scoped to .navbar — use this instead of <nav>)
   ======================================================= */
.navbar {
  position: sticky;
  top: 0; left: 0; right: 0;
  background:#2563eb; 
  color:#fff; 
  padding:.6rem 0; 
  z-index: 2000;
 }
.navbar .inner {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.navbar a { color:#fff; text-decoration:none; padding:.25rem .4rem; }
.navbar a:hover { color:#cbd5e1; text-decoration: none; } /* consistent hover */

/* Hi, username */
.navbar span {
  margin-left: auto;
  margin-right: .6rem;
  color:#ddd;
}

/* Dropdown */
.navbar .dropdown { position: relative; display: inline-block; z-index: 3000;}
.navbar .dropdown-toggle {
  cursor: pointer;
  text-decoration: none;
  color: inherit;             /* start white like others */
}
/* Caret */
.navbar .dropdown-toggle::after {
  content: "\25BC";           /* ? */
  font-size: .75em;
  margin-left: .25em;
  text-decoration: none;
  color: inherit;
}
/* Make Admin hover same as other links */
.navbar .dropdown-toggle:hover,
.navbar .dropdown-toggle:focus {
  color: #cbd5e1;             /* same as .navbar a:hover */
  text-decoration: none;
}

/* Menu panel */
.navbar .dropdown-menu {
  display: none;
  position: absolute; top: 100%; left: 0;
  background: #fff; color:#222; min-width: 220px;
  padding: .4rem 0; margin: .2rem 0 0 0; border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0,0,0,.15);
  z-index: 1000;
  list-style: none;
}
.navbar .dropdown.open .dropdown-menu { display: block; }
/* (Optional) Hover-to-open on desktop — remove if click-only */
.navbar .dropdown:hover .dropdown-menu { display: block; }

.navbar .dropdown-menu li { list-style: none; }
.navbar .dropdown-menu a {
  color:#222; display:block; padding:.5rem .8rem;
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
}
.navbar .dropdown-menu a:hover,
.navbar .dropdown-menu a:focus {
  background:#cbd5e1;         /* subtle blue-gray highlight */
  color:#111;
  outline: none;
}
.navbar .dropdown-menu .divider {
  height:1px; background:#eee; margin:.4rem 0;
}

/* ---------- Footer ---------- */
footer {
  margin: 40px auto 0;
  text-align: center;
  font-size: 14px;
  color: #777;
  max-width: 1100px;
}
.alert { padding: 10px; background: #fff3cd; border: 1px solid #ffeeba; border-radius: 4px; }
.btn { display: inline-block; padding: 8px 12px; border: 1px solid #333; border-radius: 4px; text-decoration: none; }
.btn:hover { background: #f2f2f2; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 1024px) {
  .container { width: 100%; padding: 10px; }
  .navbar .inner { width: 100%; padding: 0 10px; flex-wrap: wrap; gap: .6rem; }
  .navbar span { order: 99; width: 100%; text-align: right; margin: .4rem 0 0 0; }
}

/* ---------- (Legacy) generic <nav> styles ----------
   NOTE: Commented out to avoid conflicting with .navbar.
   If you need a separate generic nav elsewhere, rename its
   selector (e.g., .legacy-nav) and re-enable these styles.

nav {
  background-color: #0066cc;
  padding: 12px 0;
  margin-bottom: 20px;
}
nav .inner {
  width: 70%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: flex-start;
}
nav a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}
nav a:hover { text-decoration: underline; }
------------------------------------------------------ */