/* ============================================================
   CATALOG PAGE STYLES
   ============================================================ */

.active-link { color: var(--green-700) !important; font-weight: 700 !important; }

/* CART NAV ICON */
.cart-nav {
  position: relative;
  cursor: pointer;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100);
  border-radius: var(--r-md);
  font-size: 1.2rem;
  transition: all 0.2s;
}
.cart-nav:hover { background: var(--green-100); }
.cart-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 20px; height: 20px;
  background: var(--gold-400);
  color: var(--dark-900);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
}

/* PAGE HEADER */
.page-header {
  background: linear-gradient(135deg, var(--dark-900), var(--dark-700));
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.page-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: white;
  margin-bottom: 0.3rem;
}
.page-subtitle {
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
}
.search-bar {
  position: relative;
}
.search-bar input {
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-full);
  color: white;
  font-size: 0.9rem;
  width: 280px;
  transition: all 0.2s;
}
.search-bar input::placeholder { color: rgba(255,255,255,0.4); }
.search-bar input:focus {
  background: rgba(255,255,255,0.12);
  border-color: var(--green-500);
  outline: none;
}
.search-icon {
  position: absolute;
  left: 0.9rem; top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

/* CATALOG BODY */
.catalog-body {
  padding: 2.5rem 0 4rem;
  background: var(--gray-100);
  min-height: 70vh;
}
.catalog-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}

/* SIDEBAR */
.catalog-sidebar {
  background: white;
  border-radius: var(--r-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}
.sidebar-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.sidebar-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sidebar-section h3 {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-700);
  margin-bottom: 0.8rem;
}
.cat-filter-list { display: flex; flex-direction: column; gap: 0.3rem; }
.cat-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  font-family: var(--font-primary);
  font-size: 0.88rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}
.cat-filter-btn:hover { background: var(--green-50); color: var(--green-800); }
.cat-filter-btn.active { background: var(--green-100); color: var(--green-800); font-weight: 700; }
.cf-count {
  margin-left: auto;
  font-size: 0.75rem;
  background: var(--gray-200);
  color: var(--gray-600);
  padding: 1px 6px;
  border-radius: var(--r-full);
}
.cat-filter-btn.active .cf-count { background: var(--green-200,#C8E6C9); color: var(--green-800); }
.check-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-700);
  cursor: pointer;
  padding: 0.3rem 0;
}
.check-filter input { accent-color: var(--green-600); width: 15px; height: 15px; cursor: pointer; }
.sidebar-note {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--r-md);
  padding: 0.75rem;
  margin-top: 0.5rem;
}
.sidebar-note p { font-size: 0.8rem; color: var(--green-800); line-height: 1.5; }

/* CATALOG MAIN */
.catalog-main { width: 100%; }
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
#resultsCount { font-size: 0.88rem; color: var(--gray-600); font-weight: 500; }
.sort-wrap {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--gray-600);
}
.sort-wrap select {
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--r-sm);
  font-family: var(--font-primary);
  font-size: 0.85rem;
}

/* PRODUCTS GRID */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.product-card {
  background: white;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--green-400);
  box-shadow: var(--shadow-green);
  transform: translateY(-4px);
}
.product-img-wrap {
  background: linear-gradient(135deg, var(--green-50), var(--gold-100));
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  position: relative;
}
.product-grade-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--green-700);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.product-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-cat-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-900);
  margin-bottom: 4px;
}
.product-origin {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.product-desc {
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.5;
  flex: 1;
}
.product-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-unit-info {
  font-size: 0.78rem;
  color: var(--gray-600);
}
.product-unit-info strong { color: var(--dark-900); }
.product-price-info {
  font-size: 0.75rem;
  color: var(--gold-600);
  font-weight: 700;
  text-align: right;
}
.product-actions {
  padding: 0 1rem 1rem;
  display: flex;
  gap: 0.5rem;
}
.btn-add-cart {
  flex: 1;
  padding: 0.6rem 0;
  background: linear-gradient(135deg, var(--green-600), var(--green-800));
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all 0.2s;
}
.btn-add-cart:hover { opacity: 0.9; transform: scale(1.02); }
.btn-view-details {
  padding: 0.6rem 0.8rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border: none;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all 0.2s;
}
.btn-view-details:hover { background: var(--gray-200); }

.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-500);
  grid-column: 1/-1;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 9998;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: white;
  border-radius: var(--r-xl);
  padding: 2.5rem;
  max-width: 560px;
  width: 94%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--gray-100);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
}
.modal-close:hover { background: var(--gray-200); }

.modal-emoji { font-size: 4rem; text-align: center; margin-bottom: 1rem; }
.modal-title { font-size: 1.5rem; font-weight: 700; color: var(--dark-900); margin-bottom: 4px; }
.modal-origin { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 1rem; }
.modal-desc { color: var(--gray-700); line-height: 1.7; margin-bottom: 1.5rem; }
.modal-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.spec-item {
  background: var(--gray-100);
  padding: 0.75rem;
  border-radius: var(--r-md);
}
.spec-item label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-500); font-weight: 700; display: block; margin-bottom: 2px; }
.spec-item span { font-size: 0.95rem; font-weight: 700; color: var(--dark-900); }
.modal-qty-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.modal-qty-row label { font-size: 0.88rem; color: var(--gray-700); font-weight: 600; }
.modal-qty-row input {
  width: 120px;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-family: var(--font-primary);
}
.modal-qty-row input:focus { border-color: var(--green-500); outline: none; }
.modal-qty-row span { font-size: 0.85rem; color: var(--gray-500); }
.modal-price-note {
  background: var(--gold-100);
  border: 1px solid rgba(251,192,45,0.3);
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
}

/* FOOTER MINI */
.footer-mini {
  background: var(--dark-900);
  padding: 1.2rem 0;
}
.footer-mini-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-mini-inner a { color: rgba(255,255,255,0.4); transition: color 0.2s; }
.footer-mini-inner a:hover { color: white; }

@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .catalog-inner { grid-template-columns: 1fr; }
  .catalog-sidebar { position: static; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .search-bar input { width: 200px; }
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
}
