/* ==============================================================
   BASE TEMPLATE – PURE CSS – NO TAILWIND – DARK MODE READY
   ============================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
}

body {
  background: #ffffff;
  color: #1f2937;
  line-height: 1.6;
}

/* Containers */
.container, .header-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

/* Logo */
.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #16a34a;
  text-decoration: none;
}

/* Search */
.search-bar {
  flex: 1;
  max-width: 32rem;
  margin: 0 1rem;
}
.search-input {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: border-color .3s ease;
}
.search-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-link {
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}
.nav-link:hover {
  color: #16a34a;
}
.cart-link {
  position: relative;
}
.cart-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all .2s ease;
}
.btn-signup {
  background: #16a34a;
  color: #fff;
}
.btn-signup:hover {
  background: #15803d;
  transform: translateY(-2px);
}
.btn-block {
  width: 100%;
  margin-top: 1rem;
}

/* Icons */
.icon {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #4b5563;
}

/* Mobile Menu */
.mobile-menu {
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.mobile-menu-content {
  padding: 1rem;
}
.mobile-search-form {
  margin-bottom: 1rem;
}
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
}
.mobile-nav-link .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
}
.mobile-nav-link:hover {
  color: #16a34a;
}

/* Messages */
.messages-container {
  padding: 1rem 0;
}
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
  text-align: center;
}
.alert-success {
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.alert-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Footer */
.site-footer {
  background: #1f2937;
  color: #e5e7eb;
  padding: 3rem 0 1rem;
  margin-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
.footer-col h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}
.footer-col p, .footer-col a {
  color: #9ca3af;
  font-size: 0.875rem;
}
.footer-col a:hover {
  color: #86efac;
}
.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-bottom {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Responsive */
.desktop-only {
  display: none;
}
@media (min-width: 768px) {
  .desktop-only { display: flex; }
  .mobile-menu-btn { display: none; }
}

/* Dark Mode */
.dark {
  background: #0f172a;
  color: #e2e8f0;
}
.dark .site-header,
.dark .mobile-menu {
  background: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.dark .logo a { color: #86efac; }
.dark .search-input,
.dark .mobile-menu-content { background: #1e293b; border-color: #475569; color: #f1f5f9; }
.dark .search-input:focus { border-color: #34d399; }
.dark .nav-link,
.dark .mobile-nav-link { color: #cbd5e1; }
.dark .nav-link:hover,
.dark .mobile-nav-link:hover { color: #86efac; }
.dark .btn-signup { background: #16a34a; }
.dark .btn-signup:hover { background: #15803d; }
.dark .cart-badge { background: #ef4444; }
.dark .site-footer { background: #111827; color: #94a3b8; }
.dark .footer-col h3 { color: #f1f5f9; }
.dark .footer-col a:hover { color: #86efac; }
.dark .footer-bottom { color: #64748b; }

/* ==============================================================
   BASE TEMPLATE – PURE CSS – NO TAILWIND – DARK MODE READY
   ============================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
}

/* --------------------------------------------------------------
   NEW: make the page a flex column so footer stays at the bottom
   -------------------------------------------------------------- */
html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #1f2937;
  line-height: 1.6;
}
main { flex: 1 0 auto; }               /* <-- pushes footer down */
.site-footer { flex-shrink: 0; }       /* <-- never collapses */

/* Containers */
.container, .header-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

/* Logo */
.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #16a34a;
  text-decoration: none;
}

/* Search */
.search-bar {
  flex: 1;
  max-width: 32rem;
  margin: 0 1rem;
}
.search-input {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: border-color .3s ease;
}
.search-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-link {
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}
.nav-link:hover {
  color: #16a34a;
}
.cart-link {
  position: relative;
}
.cart-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all .2s ease;
}
.btn-signup {
  background: #16a34a;
  color: #fff;
}
.btn-signup:hover {
  background: #15803d;
  transform: translateY(-2px);
}
.btn-block {
  width: 100%;
  margin-top: 1rem;
}

/* Icons */
.icon {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #4b5563;
}

/* Mobile Menu */
.mobile-menu {
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.mobile-menu-content {
  padding: 1rem;
}
.mobile-search-form {
  margin-bottom: 1rem;
}
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
}
.mobile-nav-link .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
}
.mobile-nav-link:hover {
  color: #16a34a;
}

/* Messages */
.messages-container {
  padding: 1rem 0;
}
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
  text-align: center;
}
.alert-success {
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.alert-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Footer */
.site-footer {
  background: #1f2937;
  color: #e5e7eb;
  padding: 3rem 0 1rem;
  margin-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
.footer-col h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}
.footer-col p, .footer-col a {
  color: #9ca3af;
  font-size: 0.875rem;
}
.footer-col a:hover {
  color: #86efac;
}
.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-bottom {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Responsive */
.desktop-only {
  display: none;
}
@media (min-width: 768px) {
  .desktop-only { display: flex; }
  .mobile-menu-btn { display: none; }
}

/* Dark Mode */
.dark {
  background: #0f172a;
  color: #e2e8f0;
}
.dark .site-header,
.dark .mobile-menu {
  background: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.dark .logo a { color: #86efac; }
.dark .search-input,
.dark .mobile-menu-content { background: #1e293b; border-color: #475569; color: #f1f5f9; }
.dark .search-input:focus { border-color: #34d399; }
.dark .nav-link,
.dark .mobile-nav-link { color: #cbd5e1; }
.dark .nav-link:hover,
.dark .mobile-nav-link:hover { color: #86efac; }
.dark .btn-signup { background: #16a34a; }
.dark .btn-signup:hover { background: #15803d; }
.dark .cart-badge { background: #ef4444; }
.dark .site-footer { background: #111827; color: #94a3b8; }
.dark .footer-col h3 { color: #f1f5f9; }
.dark .footer-col a:hover { color: #86efac; }
.dark .footer-bottom { color: #64748b; }

/* --------------------------------------------------------------
   NEW: slide-in mobile menu (inside header)
   -------------------------------------------------------------- */
.site-header {
  position: relative;               /* <-- needed for absolute child */
  overflow: hidden;                 /* <-- contain the sliding panel */
}
.mobile-menu {
  position: absolute;
  top: 100%;               /* start just under the header */
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  max-height: 0;           /* collapsed */
  overflow: hidden;
  transition: max-height .25s ease;
}
.mobile-menu.open {        /* JS adds this class */
  max-height: 500px;       /* enough for all links – adjust if needed */
}
