/* ═══════════════════════════════════════════════
   PRODUCTS PAGE — products.css
   Layout: sidebar (left) + grid (right)
   Image: 1:1 square (industry standard VN VLXD)
═══════════════════════════════════════════════ */


/* ── Page wrapper ────────────────────────────── */
.products-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  background: var(--cream, #FAF6EE);
  min-height: 100vh;
}

.products-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .products-layout {
    grid-template-columns: 1fr;
  }
}


/* ── LEFT SIDEBAR ────────────────────────────── */
.products-sidebar {
  position: sticky;
  top: 80px;
  background: #fff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .products-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border-radius: 8px;
  }
  .sidebar-sort-wrap {
    display: none;
  }
  .sidebar-search {
    grid-column: 1 / -1;
  }
}

/* Search */
.sidebar-search-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Mulish', sans-serif;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.sidebar-search-input:focus {
  outline: none;
  border-color: var(--brick, #B5341A);
}

/* Section titles */
.sidebar-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mid, #6B6B6B);
  margin: 0 0 0.6rem;
  font-family: 'Barlow Condensed', sans-serif;
}

/* Category list */
.sidebar-categories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: 'Mulish', sans-serif;
  color: var(--concrete, #2C2C2C);
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.cat-btn:hover {
  background: var(--sand-light, #F5EDD8);
  color: var(--brick, #B5341A);
}

.cat-btn.active {
  background: var(--brick, #B5341A);
  color: #fff;
  font-weight: 700;
}

.cat-btn.active .cat-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.cat-name {
  flex: 1;
}

.cat-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--sand-light, #F5EDD8);
  color: var(--mid, #6B6B6B);
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}

/* Stock filter */
.sidebar-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-family: 'Mulish', sans-serif;
  cursor: pointer;
}

.sidebar-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--brick, #B5341A);
  cursor: pointer;
}

/* Sort select */
.sidebar-sort {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: 'Mulish', sans-serif;
  background: #fff;
  cursor: pointer;
}


/* ── MAIN CONTENT ────────────────────────────── */
.products-main {
  min-width: 0;
}

/* Topbar */
.products-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.result-count {
  font-size: 0.875rem;
  color: var(--mid, #6B6B6B);
  margin: 0;
  font-family: 'Mulish', sans-serif;
}

/* Mobile sort — hidden on desktop */
.sort-select-mobile {
  display: none;
  padding: 0.45rem 0.6rem;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: 'Mulish', sans-serif;
  background: #fff;
}

@media (max-width: 900px) {
  .sort-select-mobile {
    display: block;
  }
}


/* ── PRODUCT GRID ────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 400px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}


/* ── PRODUCT CARD ────────────────────────────── */
.product-card {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}

.product-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* Card image — 1:1 SQUARE (industry standard) */
.card-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.product-card:hover .card-image img {
  transform: scale(1.04);
}

/* Emoji fallback (when no image) */
.card-emoji {
  font-size: 3rem;
  line-height: 1;
  user-select: none;
}

/* Hover overlay: "Báo giá" button appears on card hover */
.card-hover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(181, 52, 26, 0.92);
  color: #fff;
  text-align: center;
  padding: 0.6rem;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: 'Barlow Condensed', sans-serif;
  transform: translateY(100%);
  transition: transform 0.2s ease;
  cursor: pointer;
  border: none;
  width: 100%;
}

.product-card:hover .card-hover-overlay {
  transform: translateY(0);
}

/* Card body */
.card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.card-category {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brick, #B5341A);
  font-family: 'Barlow Condensed', sans-serif;
}

.card-name {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: var(--concrete, #2C2C2C);
  font-family: 'Mulish', sans-serif;
  /* Clamp to 2 lines max */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.4rem;
}

.price-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--brick, #B5341A);
  font-family: 'Barlow Condensed', sans-serif;
}

.price-unit {
  font-size: 0.75rem;
  color: var(--mid, #6B6B6B);
  margin-left: 2px;
}

/* Stock badges */
.badge-stock {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-stock.in {
  background: #dcfce7;
  color: #166534;
}

.badge-stock.out {
  background: #fee2e2;
  color: #991b1b;
}

/* Card link wrapper */
.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}


/* ── SKELETON LOADING ────────────────────────── */
.product-card.skeleton {
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e4e4e4 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--mid, #6B6B6B);
  margin-bottom: 1.25rem;
  font-size: 1rem;
  font-family: 'Mulish', sans-serif;
}

.empty-state button {
  padding: 0.6rem 1.5rem;
  border: 2px solid var(--brick, #B5341A);
  border-radius: 8px;
  color: var(--brick, #B5341A);
  background: transparent;
  font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}

.empty-state button:hover {
  background: var(--brick, #B5341A);
  color: #fff;
}


/* ── PAGINATION ──────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  padding: 2rem 0 0;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Barlow Condensed', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--concrete, #2C2C2C);
}

.page-btn:hover {
  border-color: var(--brick, #B5341A);
  color: var(--brick, #B5341A);
}

.page-btn.active {
  background: var(--brick, #B5341A);
  border-color: var(--brick, #B5341A);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn.prev-next {
  font-size: 1rem;
  padding: 0 0.75rem;
}


/* ── DELIVERY & CTA SECTIONS ─────────────────── */
.delivery-compact {
  background: var(--sand-light, #F5EDD8);
  padding: 2.5rem 1.5rem;
  border-radius: 12px;
  margin-top: 3rem;
  text-align: center;
}

.delivery-compact-inner h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--concrete, #2C2C2C);
}

.delivery-compact-inner p {
  color: var(--mid, #6B6B6B);
  margin: 0 0 1rem;
  font-family: 'Mulish', sans-serif;
}

.delivery-compact .btn-outline {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 2px solid var(--brick, #B5341A);
  border-radius: 8px;
  color: var(--brick, #B5341A);
  text-decoration: none;
  font-weight: 600;
  font-family: 'Barlow Condensed', sans-serif;
  transition: all 0.15s;
}

.delivery-compact .btn-outline:hover {
  background: var(--brick, #B5341A);
  color: #fff;
}

.cta-banner {
  background: var(--brick, #B5341A);
  padding: 3rem 1.5rem;
  border-radius: 12px;
  margin-top: 2rem;
  text-align: center;
}

.cta-content h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem;
}

.cta-content p {
  color: rgba(255,255,255,0.85);
  margin: 0 0 1.5rem;
  font-family: 'Mulish', sans-serif;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-buttons .btn-primary {
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: var(--brick, #B5341A);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif;
  text-decoration: none;
  transition: all 0.15s;
}

.cta-buttons .btn-primary:hover {
  background: var(--sand-light, #F5EDD8);
}

.cta-buttons .btn-outline {
  padding: 0.75rem 1.5rem;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif;
  text-decoration: none;
  transition: all 0.15s;
}

.cta-buttons .btn-outline:hover {
  background: #fff;
  color: var(--brick, #B5341A);
}
