/* ===========================================
   RESET & BASE STYLES

   This section removes the default spacing and
   styling that browsers add to elements. It gives
   us a clean starting point so everything looks
   the same in every browser.
   =========================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #f5f5f5;
  color: #111;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}


/* ===========================================
   HEADER

   The black bar at the top of every page.
   Uses flexbox to space out the logo, search
   bar, and admin link in a row.
   =========================================== */

.site-header {
  background-color: #111;
  color: #fff;
  position: sticky;       /* Stays at the top when you scroll */
  top: 0;
  z-index: 100;           /* Keeps it above other content */
  padding: 0 24px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;         /* Centers the content */
  height: 64px;
  display: flex;           /* Lays children out in a row */
  align-items: center;     /* Vertically centers them */
  gap: 20px;               /* Space between each child */
}

.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  white-space: nowrap;     /* Prevents the logo from wrapping */
  color: #fff;
}

.logo:hover {
  color: #ff4e00;          /* Orange on hover — the accent color */
}

.search-wrapper {
  flex: 1;                 /* Takes up all the remaining space */
  max-width: 500px;
}

.search-bar {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  background-color: #222;
  color: #fff;
  outline: none;
}

.search-bar::placeholder {
  color: #888;
}

.search-bar:focus {
  background-color: #333;
  box-shadow: 0 0 0 2px #ff4e00;   /* Orange glow when focused */
}

.admin-link {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  white-space: nowrap;
}

.admin-link:hover {
  color: #ff4e00;
}


/* ===========================================
   HERO SECTION

   The big bold banner below the header. It's
   the first thing people see when they visit.
   =========================================== */

.hero {
  background-color: #111;
  color: #fff;
  text-align: center;
  padding: 64px 24px 56px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 52px);  /* Scales with screen size */
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.hero p {
  font-size: clamp(14px, 2vw, 18px);
  color: #aaa;
  max-width: 500px;
  margin: 0 auto;
}


/* ===========================================
   CATEGORY FILTERS

   The row of buttons (All, Clothes, Shoes, etc.)
   that let you filter which items are shown.
   =========================================== */

.filters {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 24px;
  position: sticky;
  top: 64px;              /* Sits right below the header */
  z-index: 90;
}

.filters-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;       /* Scrolls sideways on small screens */
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 2px solid #ddd;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555;
  white-space: nowrap;
  transition: all 0.2s;   /* Smooth color/border change */
}

.filter-btn:hover {
  border-color: #111;
  color: #111;
}

/* The currently selected filter button */
.filter-btn.active {
  background-color: #111;
  border-color: #111;
  color: #fff;
}


/* ===========================================
   PRODUCT GRID

   CSS Grid creates the card layout. It
   automatically adjusts how many columns fit
   based on the screen width.
   =========================================== */

.catalog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.product-grid {
  display: grid;
  /* This line is the magic — it creates as many
     columns as will fit, each at least 280px wide */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}


/* ===========================================
   PRODUCT CARD

   Each item in the grid is one of these cards.
   It has an image on top and details below.
   =========================================== */

.product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;        /* Clips the image corners */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);      /* Lifts up slightly */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;    /* Makes it a perfect square */
  object-fit: cover;       /* Crops to fill the square */
  background-color: #eee;
}

.product-card-info {
  padding: 16px;
}

.product-card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 4px;
}

.product-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-card-description {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
  /* Limits description to 2 lines, then adds "..." */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card-price {
  font-size: 18px;
  font-weight: 800;
}

.product-card-status {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
}

/* Different colors for each item status */
.status-available {
  color: #111;
}

.status-reserved {
  background-color: #fff3e0;
  color: #e65100;
}

.status-sold {
  background-color: #eee;
  color: #999;
}


/* ===========================================
   ACTION BUTTON

   The "Reserve" or "Make an Offer" button on
   each card.
   =========================================== */

.reserve-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: #111;
  color: #fff;
  transition: background-color 0.2s;
}

.reserve-btn:hover {
  background-color: #ff4e00;    /* Orange on hover */
}

/* Disabled state for reserved/sold items */
.reserve-btn:disabled {
  background-color: #ddd;
  color: #999;
  cursor: not-allowed;
}

.reserve-btn:disabled:hover {
  background-color: #ddd;
}


/* ===========================================
   MODAL (POPUP)

   The popup that appears when someone clicks
   Reserve or Make an Offer. The "overlay" is
   the dark background behind it.
   =========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;              /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

/* When JavaScript removes "hidden" and adds "active", show it */
.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 32px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  line-height: 1;
}

.modal-close:hover {
  color: #111;
}

.modal h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.modal p {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.modal label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: #555;
}

.modal input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
  font-family: inherit;
}

.modal input:focus {
  border-color: #111;
}

.modal-submit-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: #ff4e00;
  color: #fff;
  transition: background-color 0.2s;
}

.modal-submit-btn:hover {
  background-color: #e04400;
}


/* ===========================================
   CONFIRMATION (SUCCESS MESSAGE)
   =========================================== */

.confirmation {
  text-align: center;
  padding: 16px 0;
}

.confirmation .checkmark {
  font-size: 48px;
  margin-bottom: 12px;
}

.confirmation h2 {
  margin-bottom: 8px;
}


/* ===========================================
   NO RESULTS MESSAGE
   =========================================== */

.no-results {
  text-align: center;
  padding: 80px 24px;
  color: #999;
  font-size: 16px;
}


/* ===========================================
   FOOTER
   =========================================== */

.site-footer {
  text-align: center;
  padding: 32px 24px;
  color: #aaa;
  font-size: 13px;
  border-top: 1px solid #e0e0e0;
}


/* ===========================================
   MOBILE ADJUSTMENTS

   @media lets you write CSS that only applies
   at certain screen sizes. This section tweaks
   things for phones (screens under 600px wide).
   =========================================== */

@media (max-width: 600px) {
  .header-inner {
    height: 56px;
    gap: 12px;
  }

  .logo {
    font-size: 18px;
  }

  .search-bar {
    padding: 8px 12px;
    font-size: 14px;
  }

  .hero {
    padding: 40px 20px 36px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .product-card-info {
    padding: 12px;
  }

  .product-card-title {
    font-size: 14px;
  }

  .product-card-price {
    font-size: 16px;
  }

  .reserve-btn {
    padding: 10px;
    font-size: 12px;
  }
}
