/* --- Global base --- */
:root {
  --bg: #f7f2f4;
  --card: #e0d5d5;
  --text: #20232a;
  --muted: #6b7280;
  --primary: #18099c;
  --primary-dark: #1e40af;
  --success: #16a34a;
  --danger: #dc2626;
  --border-radius: 10px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}
button
.button {
  display: inline-flex;
  align-items: right;
  justify-content: right;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  margin-top: 10px;
  /* cursor: pointer; */
  transition:
    transform 0.15s ease,
    background-color 0.2s ease;
}

.main-content {
  padding-top: 150px; /* Adjust based on header height */
}
button:hover,
.button:hover {
  transform: translateY(-1px);
}

.button {
  background-color: var(--primary);
  color: rgb(248, 240, 240);
}

.button:hover {
  background-color: var(--primary-dark);
}

.container {
  max-width: 1200px;
  padding: 1.5rem;
  margin-inline: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.page-title {
  margin: 0;
  font-size: 1.75rem;
}

.section-card {
  background: var(--card);
  border-radius: var(--border-radius);
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.input-group input,
.input-group select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  background: #fff;
}

.error-message {
  color: var(--danger);
  font-size: 0.875rem;
}

/* --- Admin & dashboard page --- */
.admin-container,
.dashboard-container {
  min-height: 100vh;
  background: var(--bg);
  padding: 1.5rem;
}

.admin-panel {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 920px) {
  .admin-panel {
    grid-template-columns: 2fr 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.admin-header,
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-header h1,
.dashboard-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.product-list {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, 1fr);
  padding: 0.5rem;
}

.product-card {
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  /* box-shadow: var(--shadow); */
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  overflow: hidden;
}
.product-image {
  width: 100%;
  height: 150px;
  background-size: contain;     /* full product visible, no crop */
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fff;       /* white bg behind product */
  border-radius: 4px;
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #fcf9f9;
  display: block;
  padding: 6px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.product-card h3 {
  margin: 0;
  padding: 10px;
  font-size: 1rem;
  line-height: 1.3;
  display: -webkit-box;
}

.product-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

;

.product-card .actions .add-to-cart {
  background: var(--success);
  color: white;
  flex: 10;
  gap: 10.3rem;
  font-size: 0.75rem;
}

  .product-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 0 16px 16px;
      } */

      .product-card {
        background: var(--bg-card);
        border-radius: 10px;
        overflow: hidden;
        box-shadow: var(--shadow-card);
        border: 1px solid var(--border);
        transition: background 0.3s ease, border-color 0.3s ease;
      }

      .product-card img {
        width: 100%;
        height: 100px;
        object-fit: cover;
        display: block;
      }

    .product-info {
  width: 100%;
  display: flex;
  flex-direction: row;      /* text left, buttons right */
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.product-text {
  display: flex;
  flex-direction: column;   /* name on top, price below */
  gap: 0.15rem;
  flex: 1;
}

.product-card h3 {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.2;
}

.product-card p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #000;
}

.product-card .actions {
  display: flex;
  flex-direction: column;   /* Add to Cart on top, counter below */
  gap: 0.2rem;
  align-items: center;
}

.product-card .add-to-cart {
  width: 100%;
  padding: 0.25rem 0.4rem;
  font-size: 0.7rem;
  background: var(--success);
  color: white;
}

.product-card .counter {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
}

.product-card .decrement,
.product-card .increment {
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  padding: 0;
}

.product-card .quantity {
  font-size: 0.78rem;
  min-width: 12px;
  text-align: center;
}

.product-card .actions .increment,
.product-card .actions .decrement {
  background: #334155;
  color: white;
  font-size: 1rem;
  width: 32px;
  height: 32px;
}

.product-card .actions .decrement {
  background: var(--danger);
}

.cart {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 70vh;
  background: var(--card);
  border-left: 1px solid #e5e7eb;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 1000;
}

.cart h2 {
  margin-top: 0;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: grid;
  /* grid-template-columns: auto 1fr auto;
  align-items: flex; */
  gap: 0.75rem;
  padding: 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.cart-item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 6px;
}

.cart-item p {
  margin: 0;
}

.cart-total {
  margin-top: 1rem;
  font-weight: 700;
  font-size: 1.1rem;
}

@media (max-width: 760px) {
  .card,
  .admin-container,
  .dashboard-container {
    padding: 1rem;
  }

  header,
  .admin-header,
  .dashboard-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .product-card img {
    width: 85px;
    height: 85px;
  }

  header {
    flex-direction: column;
    text-align: center;
  }

  header > div:first-child {
    order: 1;
  }

  header > div:last-child {
    order: 2;
  }
}

/* Cart Styles */
.cart {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background-color: #d1d5da;
  padding: 20px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
}

.cart h2 {
  margin-top: 0;
}

.cart-items {
  margin-bottom: 20px;
}

.cart-total {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
}

.cart button {
  background-color: #08661e;
  color: rgb(231, 227, 227);
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  width: 100%;
}

.cart button:hover {
  background-color: #218838;
}
/* Make sure the parent allows positioning (body is fine) */
.top-right {
  margin: 0;
  padding: 0;
  position: relative;
}

.top-right-buttons {
  position: fixed;    /* keeps container in the viewport */
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column; /* stack buttons vertically */
  gap: 10px;             /* space between buttons */
  z-index: 1000;
}
#butt {
  position: fixed;    /* keeps container in the viewport */
  bottom: 80px;
  right: 40px;
  display: flex;
  flex-direction: column; /* stack buttons vertically */
  gap: 10px;           /* space between buttons */
  z-index: 1000;
}

#butt {
  /* padding: 10px 10px; */
  padding-bottom: 15px;
  background-color: #301d1d;
  color: #fffdfd;
  border: none;
  height: 50px;
  border-radius: 5px;
  cursor: pointer;
  align-items: center;
  font-size: 30px;
   /* font-size: 1.2rem; */
}

  .top-btn {
  padding: 2px 8px;
  /* background-color: #007bff; */
  color:  #4b0996;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
}


/* Dark overlay background */
.popup {
  position: fixed;          /* stays on screen */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5); /* semi-transparent */
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: visible;      /* visible by default, you can toggle */
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 2000;
}

/* The popup box */
.popup-content {
  background-color: #f3f0f0;
  padding: 20px 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(15, 13, 13, 0.3);
  min-width: 250px;
  color: #e70fc3;
}

/* Close button */
#close-btn {
  margin-top: 15px;
  padding: 8px 16px;
  cursor: pointer;
  background-color: #007bff;
  border: none;
  color: white;
  border-radius: 5px;
}
/* Full-screen loader overlay */
.loader {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80%;
  background-color: #a19b9b;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99;
}

/* Spinner circle */
.loader::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3; /* Light grey */
  border-top: 5px solid #007bff; /* Blue */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Spin animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Optional: adjust size for mobile */
@media (max-width: 768px) {
  .top-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

.cart-badge {
        position: relative;
        display: inline-block;
      }

      .badge {
        position: absolute;
        top: -6px;
        right: -8px;
        background:green;
        color: white;
        font-size: 0.9rem;
        font-weight: 800;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
      }