/* --- style.css --- */

/* 1. Global Reset & Variables */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --clr-dark: #2C3E50;
  --clr-light: #FFFFFF;
  --clr-primary: #007BFF; /* You can change this accent color */
  --clr-primary-hover: #0056b3;
  --clr-bg: #f8f9fa;
  --clr-text: #333;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --radius: 8px;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  background: var(--clr-bg);
  color: var(--clr-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 2. Header & Navigation */
header {
  background: var(--clr-light);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; /* Allows nav to wrap on small screens */
  border-bottom: 1px solid #eee;
  box-shadow: var(--shadow);
}

header .logo {
  max-height: 60px; /* Standardized logo size */
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--clr-dark);
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--clr-primary);
}

/* 3. Main Content & Utilities */
main {
  flex: 1; /* Pushes footer to the bottom */
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

h1, h2, h3 {
  color: var(--clr-dark);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--clr-primary);
  color: var(--clr-light);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: bold;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.btn:hover {
  background: var(--clr-primary-hover);
}

/* 4. Homepage Hero Section */
.hero {
  background: var(--clr-dark);
  color: var(--clr-light);
  padding: 4rem 2rem;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.hero h1 {
  color: var(--clr-light);
  font-size: 2.5rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* 5. Product Grid (Used on all pages) */
.product-grid {
  display: grid;
  /* This is the responsive part: */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.product-card {
  background: var(--clr-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; /* Contains the image */
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.product-card img {
  width: 100%;
  height: 250px; /* Fixed height for all images */
  object-fit: cover; /* Ensures images fill the space without distortion */
}

.product-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-content h3 {
  margin-bottom: 0.5rem;
}

.product-card-content p {
  flex: 1; /* Pushes the button to the bottom */
  margin-bottom: 1rem;
}

/* 6. Form Styling */
form {
  background: var(--clr-light);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 700px;
  margin: 2rem auto;
}

form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

form input,
form select,
form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-main);
}

form textarea {
  min-height: 150px;
  resize: vertical;
}

form button[type="submit"] {
  margin-top: 1.5rem;
  width: 100%;
}

/* 7. Footer */
footer {
  background: var(--clr-dark);
  color: var(--clr-light);
  text-align: center;
  padding: 1.5rem;
  margin-top: auto; /* Pushes to bottom */
}

/* Styling for new file input */
form input[type="file"] {
  border: 1px solid #ccc;
  background: var(--clr-light);
  padding: 0.5rem;
  border-radius: var(--radius);
  width: 100%;
}

form input[type="file"]::file-selector-button {
  padding: 0.5rem 1rem;
  background: var(--clr-dark);
  color: var(--clr-light);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
  margin-right: 1rem;
}

form input[type="file"]::file-selector-button:hover {
  background: #555;
}

/* --- Additions for Basket Builder --- */
.basket-builder-container {
  display: grid;
  grid-template-columns: 2fr 1fr; /* 2/3 for form, 1/3 for summary */
  gap: 2rem;
  align-items: flex-start;
}

/* Responsive layout for smaller screens */
@media (max-width: 900px) {
  .basket-builder-container {
    grid-template-columns: 1fr; /* Stack columns on top of each other */
  }
}

.basket-summary {
  background: var(--clr-light);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky; /* Keeps summary in view on scroll */
  top: 2rem; 
}

.basket-summary h3 {
  margin-top: 0;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.basket-summary ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.basket-summary ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.summary-total {
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--clr-primary);
}

.summary-note {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 0;
}
