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

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --border: #e2e8f0;
  --primary: #0f172a;
  --primary-light: #334155;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --card-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --hover-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.12);
  --whatsapp: #25d366;
  --badge-bg: #f1f5f9;
  --modal-overlay: rgba(0, 0, 0, 0.6);
  --footer-bg: #0f172a;
  --footer-text: #cbd5e1;
  --hero-bg: #f1f5f9;
  --sidebar-bg: #ffffff;
  --sidebar-width: 260px;
}

html {
  scroll-behavior: smooth;
}

/* body::-webkit-scrollbar {
  display: none;
} */

body.dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border: #334155;
  --primary: #f1f5f9;
  --primary-light: #cbd5e1;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --badge-bg: #334155;
  --hero-bg: #1e293b;
  --footer-bg: #020617;
  --footer-text: #94a3b8;
  --sidebar-bg: #1e293b;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition:
    background 0.3s,
    color 0.3s;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.app-layout {
  display: flex;
  flex: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition:
    transform 0.3s,
    background 0.3s;
  z-index: 40;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 32px;
  background: linear-gradient(to right, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-menu {
  list-style: none;
  flex: 1;
}

.sidebar-menu li {
  margin-bottom: 8px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: var(--badge-bg);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Navbar (top inside main) */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
}

.dark-toggle {
  background: var(--badge-bg);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* Hero */
.hero {
  background: var(--hero-bg);
  padding: 50px 0;
  text-align: center;
  border-radius: 40px;
  margin-bottom: 40px;
  margin-top: 40px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero p {
  color: var(--text-secondary);
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  align-items: center;
  justify-content: space-between;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 10px 20px;
  flex: 2;
  min-width: 250px;
}

.search-box i {
  color: var(--text-secondary);
  margin-right: 10px;
}

.search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

body.dark .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.card {
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition:
    transform 0.25s,
    box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--hover-shadow);
}

.card-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-badge {
  background: var(--badge-bg);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  align-self: flex-start;
  margin-bottom: 12px;
}

.price {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  margin: 10px 0;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 14px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  font-size: 0.85rem;
  transition: 0.2s;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-wa {
  background: var(--whatsapp);
  color: white;
}

.btn:hover {
  opacity: 0.85;
}

.load-more-container {
  display: flex;
  justify-content: center;
  margin: 20px 0 50px;
}

.about-section {
  background: var(--surface);
  border-radius: 32px;
  padding: 40px;
  margin: 40px 0;
  text-align: center;
  border: 1px solid var(--border);
}

.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 40px 0 20px;
  margin-top: 20px;
  border-radius: 30px 30px 0 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  overflow-y: scroll;
  scrollbar-width: 5px;
}

.modal.active {
  display: flex;
}

.modal-dialog {
  background: var(--surface);
  max-width: 500px;
  width: 90%;
  border-radius: 28px;
  padding: 28px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 100px;
  margin-bottom: 100px;
}

.modal-close {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

/* Sidebar overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 35;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.active {
    display: block;
  }
  .menu-toggle {
    display: block;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .modal-dialog {
    margin-top: 0px;
    margin-bottom: 50px;
  }
}
