/* ===== Global ===== */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* ===== Navbar ===== */
.navbar {
  background-color: #00b894;
  padding: 1em 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-img {
  height: 40px;
  margin-left: 1em;
}

.nav-links {
  margin-right: 1em;
}

.nav-links a {
  color: white;
  text-decoration: none;
  margin-left: 1.5em;
  font-weight: 600;
  font-size: 1em;
}

.nav-links a:hover {
  text-decoration: underline;
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(to right, #00b894, #55efc4);
  color: white;
  text-align: center;
  padding: 4em 1em;
}

.hero h1 {
  font-size: 2.5em;
  margin-bottom: 0.5em;
}

.hero p {
  font-size: 1.2em;
  margin-bottom: 1.5em;
}

.hero .btn {
  background: white;
  color: #00b894;
  padding: 0.75em 1.5em;
  font-weight: bold;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.hero .btn:hover {
  background: #e0f7f1;
}

/* ===== Categories Section ===== */
.categories {
  background: #fff;
  padding: 2em 0;
  text-align: center;
}

.categories h2 {
  margin-bottom: 1em;
  font-size: 1.8rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1em;
}

.category {
  background: #f1f1f1;
  padding: 1em;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.category:hover {
  background: #dfe6e9;
}

/* ===== Product Grid Section ===== */
.products {
  padding: 2em 0;
  background: #fafafa;
}

.products h2 {
  text-align: center;
  margin-bottom: 1em;
  font-size: 1.8rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5em;
}

.product-grid a {
  text-decoration: none;
  color: inherit;
}

/* ===== Product Card (index.html) ===== */
.product-grid img {
  border-radius: 6px;
}

/* ===== Product Form (create_product.html) ===== */
.form-page {
  padding: 3em 1em;
  background-color: #fdfdfd;
}

.product-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background-color: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.product-form h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-form input,
.product-form textarea {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: 'Segoe UI', sans-serif;
}

.product-form input:focus,
.product-form textarea:focus {
  border-color: #00c897;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 200, 151, 0.15);
}

.product-form textarea {
  resize: vertical;
  min-height: 100px;
}

.status-msg {
  text-align: center;
  margin-top: 1rem;
  font-size: 1rem;
}

/* ===== Image Preview ===== */
#preview-img {
  display: block;
  margin: 0 auto;
  margin-top: 0.5rem;
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #ddd;
}

/* ===== Buttons ===== */
.btn {
  background-color: #00c58e;
  color: white;
  padding: 0.8rem 1.5rem;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn:hover {
  background-color: #009e6f;
}

/* ===== Footer ===== */
.footer {
  background: #2d3436;
  color: #ccc;
  text-align: center;
  padding: 1em 0;
  font-size: 0.9em;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #e8fef1;
  color: #222;
}

header {
  background-color: #00a878;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.5rem;
  font-weight: bold;
}

nav a {
  color: white;
  margin-left: 1rem;
  text-decoration: none;
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: #00a878;
  color: white;
  margin-top: 3rem;
}

.form-page {
  max-width: 500px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

h2 {
  margin-top: 0;
}

.form-group {
  margin-bottom: 1rem;
}

input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.btn {
  background-color: #00a878;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background-color: #008c63;
}

.benefits {
  margin-top: 2rem;
}

.benefits ul {
  padding-left: 1.2rem;
  line-height: 1.6;
}

.status-msg {
  margin-top: 1rem;
  font-weight: bold;
}

.suggestion-box {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 300px;
  z-index: 1000;
}

.suggestion-item {
  padding: 0.5rem;
  cursor: pointer;
}

.suggestion-item:hover {
  background-color: #f0f0f0;
}

.nav-links .active {
  font-weight: bold;
  text-decoration: underline;
}

.username {
  margin: 0 1rem;
  font-weight: bold;
}

.cart-count {
  font-weight: bold;
  color: green;
}

.btn-cart {
  background-color: #28a745;
  color: white;
  padding: 0.5rem 1rem;
  margin-top: 0.75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
