/*GLOBAL*/

* {
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
}

body {
  min-height: 100vh;
}


/*NAV BAR*/

.nav_bar {
  width: 100%;
  position: sticky;
  top: 0;
  height: 70px;
  background: black;
  display: flex;
  align-items: center;
  gap: 24px;           /* space between logo, links, cart, user indicator */
  padding: 0 24px;
  z-index: 500;
}

.nav_bar h1 {
  color: white;
  font-size: 21px;
}

.nav_links {
  list-style: none;
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 0;
  padding: 0;
  flex-shrink: 0;     /* prevent links from shrinking when space is tight */
}

.nav_links li a {
  color: white;
  font-size: 14px;
}

.nav_links li a:hover {
  text-decoration: underline;
}


/*CART */

.cart_container {
  position: relative;  /* keep relative so dropdown positions correctly */
  margin-left: auto;   /* pushes cart + user_indicator to the right end */
  z-index: 600;
  flex-shrink: 0;
}

.cart_toggle {
  display: none;
}

.cart_icon {
  background: white;
  color: black;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid white;
}

.cart_items {
  display: none;
  position: absolute;
  top: 48px;
  right: 0;
  width: 320px;
  max-width: calc(100vw - 40px);
  max-height: 500px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 0;
}

.cart_container:hover .cart_items,
.cart_toggle:checked ~ .cart_items {
  display: block;
}

.cart_header {
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  background: #f9f9f9;
}

.cart_list {
  list-style: none;
  margin: 0;
  padding: 6px 8px;
}

.cart_list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.cart_list li:last-child {
  border-bottom: none;
}

.cart_item_name {
  flex: 1 1 auto;
  color: #222;
}

.cart_item_actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.cart_qty {
  width: 50px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13.6px;
}

.remove_item {
  background: transparent;
  border: none;
  color: #c00;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
}

.remove_item:hover {
  text-decoration: underline;
}

.cart_footer {
  padding: 10px 14px;
  border-top: 1px solid #eee;
  text-align: right;
  font-weight: 700;
  font-size: 14px;
  background: #f9f9f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view_cart_btn {
  background: black;
  color: white;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.view_cart_btn:hover {
  background: #333;
}

@media (max-width: 480px) {
  .cart_items {
    right: 0;
    left: 0;
    width: auto;
  }
}


/*TIER BAR */

.Tier_bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 24px;
  font-size: 13px;
  color: #666;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.Tier_bar a:hover {
  text-decoration: underline;
}


/* CATEGORY BAR*/

.Category_section {
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}

.Category_bar {
  display: flex;
  flex-direction: column;
  padding: 14px 24px;
}

.Category_list_wrapper {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.Category_list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.Category_item {
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.Category_item a {
  color: #222;
  font-weight: 600;
  font-size: 14px;
}

.Category_item:hover {
  background-color: #000;
}

.Category_item:hover a {
  color: #fff;
}


/*PRODUCTS */

.Product_section {
  padding: 20px 24px;
  flex: 1;
}

.Products_container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 900px;
}

.product {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #f5f5f5;
  padding: 14px;
  border: 1px solid #e0e0e0;
}

.product img,
.product .img_placeholder {
  width: 120px;
  height: 120px;
  object-fit: cover;
  flex-shrink: 0;
  background: #ddd;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #999;
}

.product_info_row {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product_info_row h2 {
  font-size: 16px;
  margin: 0;
}

.product_info_row .price {
  font-size: 15px;
  font-weight: bold;
  color: #000;
}

.product_info_row p {
  font-size: 13px;
  color: #555;
  margin: 0;
}

.add_to_cart {
  margin-top: 8px;
  align-self: flex-start;
  padding: 7px 18px;
  background: black;
  color: white;
  border: none;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
}

.add_to_cart:hover {
  background: #333;
}

@media (max-width: 600px) {
  .product {
    flex-direction: column;
  }

  .product img,
  .product .img_placeholder {
    width: 100%;
    height: 180px;
  }
}


/* ─────────────────────────────────────────
   CART PAGE (cart.html)
───────────────────────────────────────── */

.cart_page {
  padding: 24px;
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.cart_page h2 {
  font-size: 19px;
  margin-bottom: 16px;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
}

.cart_page_list {
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart_page_item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 12px;
}

.cart_page_item img,
.cart_page_item .img_placeholder {
  width: 80px;
  height: 80px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #ccc;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #999;
}

.cart_page_details {
  flex: 1;
}

.cart_page_details h3 {
  font-size: 15px;
  margin: 0 0 4px 0;
}

.cart_page_details .price {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
}

.cart_page_actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cart_page_actions input[type="number"] {
  width: 54px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  border-radius: 4px;
}

.cart_page_actions button {
  background: transparent;
  border: none;
  color: #c00;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
}

.cart_page_actions button:hover {
  text-decoration: underline;
}

.cart_page_item_total {
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
}

.cart_summary {
  border-top: 2px solid #000;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart_summary .total {
  font-size: 18px;
  font-weight: bold;
}

.checkout_btn {
  background: black;
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
}

.checkout_btn:hover {
  background: #333;
}

.cart_empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 15px;
}

.continue_shopping {
  display: inline-block;
  margin-top: 12px;
  background: black;
  color: white;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 13.6px;
}

.continue_shopping:hover {
  background: #333;
}

@media (max-width: 600px) {
  .cart_page_item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart_page_item img,
  .cart_page_item .img_placeholder {
    width: 100%;
    height: 160px;
  }

  .cart_summary {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}


/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */

footer {
  background-color: black;
  color: white;
  width: 100%;
  min-height: 60px;
  margin-top: auto;
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-size: 13px;
}


/* ─────────────────────────────────────────
   ADMIN PANEL (admin.html)
───────────────────────────────────────── */

/* Tabs */
.tabs { 
  display: flex; 
  border: 1px solid #000; 
  width: fit-content; 
  margin-bottom: 20px; 
}

.tab-btn { 
  padding: 8px 20px; 
  background: #fff; 
  border: none; 
  border-right: 1px solid #000; 
  cursor: pointer; 
  font-size: 14px; 
}

.tab-btn:last-child { 
  border-right: none; 
}

.tab-btn.active { 
  background: #000; 
  color: #fff; 
}

.tab-panel { 
  display: none; 
}

.tab-panel.active { 
  display: block; 
}

/* Section */
.section { 
  border: 1px solid #000; 
  padding: 16px; 
  margin-bottom: 20px; 
}

.section-header {
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-bottom: 1px solid #ccc; 
  padding-bottom: 8px; 
  margin-bottom: 14px; 
}

/* Form */
.form-row { 
  margin-bottom: 10px; 
}

.two-col { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 12px; 
}

label { 
  display: block; 
  font-size: 13px; 
  font-weight: bold; 
  margin-bottom: 3px; 
}

input[type="text"], input[type="number"], select, textarea {
  width: 100%; 
  padding: 6px 8px; 
  font-size: 14px;
  border: 1px solid #000; 
  background: #fff; 
  color: #000;
}

input.error, select.error, textarea.error { 
  border-color: red; 
}

textarea {
  resize: vertical; 
  min-height: 80px;
}

input[type="file"] {
  font-size: 14px; 
  padding: 3px 0; 
}

/* Buttons */
button { 
  font-size: 13px; 
  padding: 6px 14px; 
  cursor: pointer; 
  border: 1px solid #000; 
  background: #fff; 
  color: #000; 
}

button.primary { 
  background: #000; 
  color: #fff; 
}

button.danger  { 
  color: #900; 
  border-color: #900; 
}

button.danger:hover { 
  background: #900; 
  color: #fff; 
}
.btn-row { 
  margin-top: 12px; 
  display: flex; 
  gap: 8px; 
}

/* Table */
table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 13px; 
  margin-top: 8px; 
}

th, td { 
  border: 1px solid #ccc; 
  padding: 6px 8px; 
  text-align: left; 
  vertical-align: middle; 
}

th { 
  background: #f0f0f0; 
}

td img { 
  width: 50px; 
  height: 50px; 
  object-fit: cover; 
  border: 1px solid #ccc; 
  display: block; 
}

/* Inline edit row */
.edit-row {
  display: none; 
}

.edit-row td { 
  background: #f9f9f9; 
  padding: 12px; 
}

/* Errors */
.error-list { 
  background: #fff3f3; 
  border: 1px solid red; 
  padding: 8px 12px; 
  margin-bottom: 10px; 
  color: #900; 
}

.error-list ul { 
  margin: 4px 0 0 16px; 
}

/* Image preview */
.img-preview { 
  display: none; 
  width: 60px; 
  height: 60px; 
  object-fit: cover; 
  border: 1px solid #000; 
  margin-top: 6px; 
}

/* Toast */
#toast { 
  position: fixed; 
  bottom: 20px; 
  right: 20px; 
  background: #000; 
  color: #fff; 
  padding: 10px 16px; 
  font-size: 13.12px; 
  opacity: 0; 
  pointer-events: none; 
  transition: opacity 0.3s; 
  z-index: 999; 
}

#toast.show { 
  opacity: 1; 
}

/* Model */
#model-overlay { 
  display: none; 
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,0.5); 
  z-index: 900; 
  align-items: center; 
  justify-content: center; 
}

#model-overlay.show { 
  display: flex; 
}

#model-box { 
  background: #fff; 
  border: 2px solid #000; 
  padding: 20px; 
  max-width: 380px; 
  width: 90%; 
}

#model-box p { 
  font-size: 14px; 
  margin-bottom: 16px; 
}


.user_indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;    /* prevent it from collapsing */
    color: white;
    font-size: 0.9rem;
}

.user_indicator a {
    color: white;
    text-decoration: underline;
}