/* --- CSS Variables --- */
:root {
  --green:        #154734;
  --gold:         #FDB913;
  --white:        #FFFFFF;
  --surface:      #F5F5F5;
  --border:       #E0E0E0;
  --text-primary: #1A1A1A;
  --text-muted:   #4A4A4A;
  --on-green:     #FFFFFF;
  --error:        #D32F2F;
  --success:      #2E7D32;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --nav-h:        72px;
}

html {
  font-size: 100%;
}

/* Dark mode */
body.dark {
  --white:        #121212;
  --surface:      #1E1E1E;
  --border:       rgba(255,255,255,0.12);
  --text-primary: #FFFFFF;
  --text-muted:   #C7C7C7;
  --green:        #1a5c3a;
}

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

/* Base */
body {
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.35s ease, color 0.35s ease;
  animation: fadeIn 0.4s ease;        /* Animation 1 — page fade in */
}


/* global focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; height: auto;}
button { cursor: pointer; font-family: inherit; border: none; }

/* Typography */
.h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
.h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
.body-regular { font-size: 0.875rem; font-weight: 400; }
.body-small   { font-size: 0.8rem; font-weight: 400; }
.label-btn    { font-size: 0.875rem; font-weight: 600; }
.label-nav    { font-size: 0.875rem; font-weight: 500; }
/*
   NAVBAR
 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: var(--nav-h);
  background: #154734;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--on-green);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo span { color: var(--gold); }

/* Search */
.nav-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.nav-search input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-lg);
  border: none;
  padding: 0 16px;
  font-size: 0.875rem;
  background: var(--white);
  color: var(--text-primary);
  outline: none;
  transition: box-shadow 0.2s;        /* Animation 2 — input focus glow */
}


body.dark .nav-search input {
  background: #1E1E1E;
  color: #F5F5F5;
}


.nav-search input:focus {
  box-shadow: 0 0 0 4px rgba(253,185,19,0.8);
}
.nav-search input::placeholder { color: var(--text-muted); }

/* Search suggestions dropdown */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.search-suggestions.visible { display: block; }

.suggestion-item {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--surface); }

.suggestion-empty {
  padding: 12px 16px;
  font-size:  0.875rem;
  color: var(--text-muted);
  text-align: center;
}

/* Desktop nav links */
.nav-right {
  display: none;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-cart   { font-size:  0.875rem; color: var(--on-green); cursor: pointer; }
.nav-signin { color: var(--on-green); font-size:  0.875rem; font-weight: 500; }
.nav-signin:hover { opacity: 0.8; }

/* Dark mode toggle */
.toggle-pill {
  width: 52px;
  height: 30px;
  border-radius: 15px;
  background: var(--gold);
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}
.toggle-pill .knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
}
body.dark .toggle-pill .knob { transform: translateX(22px); }
body.dark .toggle-pill { background: #555; }

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: 280px;
  height: calc(100vh - var(--nav-h));
  background: #154734;
  z-index: 99;
  flex-direction: column;
  padding: 16px 0;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
.mobile-menu.open { display: flex; transform: translateX(0); }
.mobile-menu a {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  padding: 16px 24px;
  min-height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.mobile-menu a:hover  { background: rgba(255,255,255,0.08); }
.mobile-menu a.active { background: rgba(255,255,255,0.15); border-left: 4px solid var(--gold); }

@media (min-width: 768px) {
  .hamburger { display: none; }
  .nav-right  { display: flex; }
}

/*
   BUTTONS
*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
  min-height: 44px;
}
.btn:hover  { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: scale(0.97); }

.btn-primary  { background: #154734; color: #fff; border: 2px solid transparent; }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { background: transparent; color: #154734; border: 2px solid #154734; }
body.dark .btn-secondary { color: var(--gold); border-color: var(--gold); }
.btn-secondary:hover { background: rgba(21,71,52,0.06); }
.btn-full { width: 100%; }

/*
   CARDS
*/
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: block;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
body.dark .card { border: 1px solid #2A2A2A; }

.card-img {
  width: 100%;
  aspect-ratio: 3/2;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body  { padding: 12px 16px 14px; }
.card-name  { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.card-price { font-size: 11px; color: #154734; font-weight: 500; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 14px;
}
.card-actions { display: flex; gap: 10px; }
.card-actions button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.15s;
  min-height: 44px;
  min-width: 44px;
}
.card-actions .like-btn:hover   { color: #e53935; transform: scale(1.2); }
.card-actions .delete-btn:hover { color: var(--error); }

/*
   LISTINGS GRID
*/
.listings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px;
  max-width: 100%;
  overflow-x: hidden;
}
@media (min-width: 540px)  { .listings-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .listings-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .listings-grid { grid-template-columns: repeat(4, 1fr); } }

/*
   SKELETON LOADING
*/
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.skeleton-img   { width: 100%; aspect-ratio: 4/3; }
.skeleton-body  { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.skeleton-title { height: 16px; width: 70%; }
.skeleton-price { height: 14px; width: 40%; }

/* 
   LOADING SPINNER
 */
.spinner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.spinner-overlay.visible { display: flex; }
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/*
   FORM INPUTS
*/
.input-group { display: flex; flex-direction: column; gap: 4px; }
.input-group label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.input-field {
  width: 80%;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus {
  border-color: #154734;
  box-shadow: 0 0 0 3px rgba(21,71,52,0.1);
}
.input-field.error   { border-color: var(--error); }
.input-field.success { border-color: var(--success); }
.input-error-msg     { font-size: 12px; color: var(--error);   display: none; }
.input-success-msg   { font-size: 12px; color: var(--success); display: none; }
.input-field.error   ~ .input-error-msg   { display: block; }
.input-field.success ~ .input-success-msg { display: block; }
textarea.input-field { height: 100px; padding: 12px 14px; resize: vertical; }
.input-row   { display: grid; grid-template-columns: 1fr 1fr;     gap: 16px; }
.input-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
@media (max-width: 480px) {
  .input-row, .input-row-3 { grid-template-columns: 1fr; }
}




body.dark input,
body.dark textarea,
body.dark select {
  background: #1E1E1E;
  color: #F5F5F5;
  border-color: #3A3A3A;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
  color: #C7C7C7;
}

/*
   BREADCRUMB
*/
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 16px;
}
.breadcrumb span.active { color: var(--text-primary); font-weight: 600; }
.breadcrumb .arrow { color: var(--border); }

/*
   CHECKOUT
*/
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr 360px; padding: 32px 48px; }
}
.order-summary-card { background: var(--surface); border-radius: var(--radius-md); padding: 24px; height: fit-content; }
.summary-row { display: flex; justify-content: space-between; font-size:  0.875rem; padding: 6px 0; color: var(--text-muted); }
.summary-row.total { font-weight: 700; font-size:  1rem; color: var(--text-primary); padding-top: 12px; border-top: 1px solid var(--border); }
.summary-item { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.summary-thumb { width: 64px; height: 64px; background: var(--border); border-radius: 6px; flex-shrink: 0; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/*
   DELIVERY TOGGLE
 */
.delivery-toggle { display: flex; gap: 12px; }
.delivery-btn {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 2px solid #154734;
  background: transparent;
  color: #154734;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.delivery-btn.active { background: #154734; color: #fff; }

/* 
   FOOTER
 */
.footer {
  background: var(--surface);
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 8px; }
.footer-links a:hover { color: var(--text-primary); }

/* 
   UTILITY
 */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section-title { font-size: 1.25rem; font-weight: 600; padding: 16px; }
@media (min-width: 768px) { .section-title { padding: 32px 48px 8px; font-size: 1.5rem; } }
.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* 
   HERO — index.html
*/
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  gap: 16px;
}
.hero-sub {
  color: var(--text-muted);
  max-width: 400px;
}
.hero-btns {
  display: flex;
  flex-direction: column;  
  align-items: center;
  justify-content: center;
  gap: 12px;
  gap: 12px;
  width: 100%;
  max-width: 342px;
  margin-top: 16px;
}
@media (min-width: 768px) {
  .hero-btns { flex-direction: row; max-width: none; justify-content: center;}
  .hero-btns .btn { min-width: 200px; }
}





/* No results */
.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 16px;
  display: none;
}
.no-results.visible { display: block; }





.listing-layout {
      display: grid;
      grid-template-columns: 1fr;
      gap: 24px;
      padding: 16px;
      max-width: 1100px;
      margin: 0 auto;
    }
    @media (min-width: 768px) {
      .listing-layout {
        grid-template-columns: 1fr 1fr;
        padding: 40px 48px;
        gap: 48px;
        align-items: start;
      }
    }
    .listing-img {
      width: 100%;
      max-height: 260px;
      aspect-ratio: 3/2;
      background: var(--surface);
      border-radius: var(--radius-md);
      overflow: hidden;
    }
    .listing-img img { width: 100%; height: 100%; object-fit: cover; }
    .listing-info { display: flex; flex-direction: column; gap: 16px; }
    .listing-title { font-size: 12px; font-weight: 600; color: var(--text-muted); }
    .listing-price { font-size: 12px; font-weight: 700; color: var(--green); }
    .listing-seller { font-size: 12px; color: var(--text-muted); }
    .listing-desc { font-size: 12px; color: var(--text-primary); line-height: 1.6; }
    .listing-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }


/* Order Confirmed */
.confirm-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 48px 32px;
  text-align: center;
  max-width: 560px;
  width: 80%;
  animation: fadeIn 0.5s ease;
}
.checkmark-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 40px;
  color: white;
}
.confirm-title { font-size:  0.75rem; font-weight: 700; margin-bottom: 12px; }
.confirm-sub   { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 32px; }
.confirm-actions { display: flex; flex-direction: column; gap: 12px; }


/* Contact page */
.contact-main {
  flex: 1;
  padding: 32px 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}



/* Post Listing page */
.post-main {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.post-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.post-form .input-field { width: 100%; }
.post-success {
  background: rgba(46,125,50,0.1);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}
body.dark .post-success { color: #6FCF97; }





/* Posted listing summary on confirmation page */
.posted-summary {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: left;
  font-size: 0.875rem;
}
.posted-summary:empty { display: none; }
.posted-summary .row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border);
}
.posted-summary .row:last-child { border-bottom: none; }
.posted-summary .label { color: var(--text-muted); }
.posted-summary .value { color: var(--text-primary); font-weight: 500; }



/* Cart badge on nav icon */
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.cart-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--gold);
  color: #000;
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Add-to-cart button on listing cards */
.card-actions .add-cart-btn {
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.15s;
}
.card-actions .add-cart-btn:hover {
  color: var(--green);
  transform: scale(1.15);
}
body.dark .card-actions .add-cart-btn:hover { color: var(--gold); }
.card-actions .add-cart-btn.added {
  color: var(--success);
  animation: bump 0.3s ease;
}
@keyframes bump {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}

/* Quantity stepper (detail page + cart) */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}
.qty-stepper button {
  width: 2.25rem;
  height: 2.25rem;
  background: transparent;
  border: none;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}
.qty-stepper button:hover { background: var(--surface); }
.qty-stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-stepper input {
  width: 2.5rem;
  height: 2.25rem;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Cart page */
.cart-main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
.cart-item {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.cart-item-img {
  width: 5rem;
  height: 5rem;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.cart-item-name { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.cart-item-price { font-size: 0.875rem; color: var(--green); font-weight: 600; }
body.dark .cart-item-price { color: var(--gold); }
.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.cart-remove-btn {
  background: none;
  border: none;
  color: var(--error);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.cart-remove-btn:hover { text-decoration: underline; }

.cart-summary {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.cart-summary .summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
}
.cart-summary .summary-row.total {
  font-weight: 700;
  font-size: 1.125rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 1rem;
}
.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.cart-empty p { margin-bottom: 1rem; }

@media (max-width: 480px) {
  .cart-item { grid-template-columns: 4rem 1fr; }
  .cart-item-controls { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}



/* Simple auth page */
.auth-main {
  flex: 1;
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  padding: 3rem 1rem;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.auth-card p { color: var(--text-muted); margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form .input-field { width: 100%; }


[hidden] { display: none !important; }