/* ==========================================================================
   FlagsExpo redesign V1 (Figma) — Product listing / category page
   Shares :root custom properties + .v2-section/.v2-category-* from
   Design/css/fx-redesign.css and Design/css/fx-home.css.
   ========================================================================== */

.v2-pl, .v2-pl * { box-sizing: border-box; font-family: var(--v2-font); }

/* ---------- Toolbar (tabs / count / sort) ---------- */
.v2-pl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.v2-pl-tabs { display: flex; gap: 12px; flex-wrap: wrap; }
.v2-pl-tab {
  border: 1px solid var(--v2-navy); background: #fff; color: var(--v2-navy);
  font-size: 16px; padding: 12px 24px; cursor: pointer; text-decoration: none; display: inline-block;
}
.v2-pl-tab.is-active { background: var(--v2-navy); color: #fff; font-weight: 700; text-transform: uppercase; }
.v2-pl-meta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.v2-pl-count { font-size: 16px; color: rgba(2,20,51,0.64); white-space: nowrap; }
.v2-pl-divider { width: 1px; height: 32px; background: #dcdcdc; }
.v2-pl-sort { display: flex; align-items: center; gap: 8px; }
.v2-pl-sort-label { font-size: 16px; font-weight: 500; color: #021433; white-space: nowrap; }
.v2-pl-sort select {
  border: 1px solid #c4c4c4; background: #fff; padding: 12px 24px; font-size: 16px; color: #021433;
  font-family: var(--v2-font); cursor: pointer;
}

/* ---------- Layout ---------- */
.v2-pl-layout { display: flex; align-items: flex-start; gap: 32px; }
.v2-pl-sidebar { flex: 0 0 288px; min-width: 0; }
.v2-pl-main { flex: 1 1 0; min-width: 0; }

/* ---------- Filters sidebar ---------- */
.v2-pl-filters-title { font-family: var(--v2-font-display); font-weight: 600; font-size: 24px; text-transform: uppercase; color: #021433; margin: 0 0 24px; }

.v2-pl-filter-group { margin-bottom: 8px; }
.v2-pl-filter-header {
  background: #f4f4f5; padding: 16px 12px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; border-radius: 3px; font-size: 18px; color: #021433; width: 100%; border: none; text-align: left;
  font-family: var(--v2-font);
}
.v2-pl-filter-chevron { width: 24px; height: 24px; transition: transform 0.2s ease; flex-shrink: 0; }
.v2-pl-filter-group.is-open .v2-pl-filter-chevron { transform: rotate(180deg); }
.v2-pl-filter-body { display: none; padding: 16px 4px 8px; }
.v2-pl-filter-group.is-open .v2-pl-filter-body { display: block; }

.v2-pl-catlist { display: flex; flex-direction: column; gap: 12px; }
.v2-pl-catlist a { font-size: 15px; color: #021433; text-decoration: none; }
.v2-pl-catlist a:hover { color: var(--v2-red); text-decoration: underline; }
.v2-pl-catlist a.is-active { color: var(--v2-red); font-weight: 600; }

/* ---------- Product grid ---------- */
.v2-pl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.v2-pl-card { background: #fff; border: 1px solid #efefef; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.v2-pl-card-media { background: #f9f9f9; height: 250px; position: relative; overflow: hidden; }
.v2-pl-card-media img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 180px; height: 180px; object-fit: cover; }
.v2-pl-badge {
  position: absolute; top: 0; left: 0; background: #b90600; color: #fff; font-size: 13px; font-weight: 500;
  letter-spacing: 1.12px; text-transform: uppercase; padding: 8px 16px; display: flex; gap: 8px; align-items: center; white-space: nowrap;
}
.v2-pl-badge--bestseller { background: #b90600; }
.v2-pl-badge--new { background: #1a7a3c; }
.v2-pl-badge--sale { background: #0057b8; }
.v2-pl-badge--stock { background: var(--v2-navy); }
.v2-pl-card-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; flex: 1 1 auto; }
.v2-pl-card-name { font-family: var(--v2-font-display); font-weight: 500; font-size: 18px; color: #021433; margin: 0; line-height: 1.2; }
.v2-pl-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 12px; }
.v2-pl-card-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.v2-pl-card-price-now { font-size: 20px; font-weight: 500; color: #71091a; }
.v2-pl-add-btn { background: var(--v2-navy); border: none; width: 48px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.v2-pl-add-btn img { width: 24px; height: 24px; }
.v2-pl-add-btn:hover { background: var(--v2-navy-dark); }

.v2-pl-loadmore-wrap { display: flex; justify-content: center; margin-top: 48px; }
.v2-pl-loadmore { background: var(--v2-navy); color: #fff; border: none; padding: 16px 48px; font-size: 16px; font-weight: 600; cursor: pointer; }
.v2-pl-loadmore:hover { background: var(--v2-navy-dark); }

.v2-pl-empty { padding: 64px 0; text-align: center; color: rgba(2,20,51,0.7); font-size: 16px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

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

@media (max-width: 1023px) {
  .v2-pl-layout { flex-direction: column; }
  .v2-pl-sidebar { flex: none; width: 100%; }
  .v2-pl-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .v2-pl-grid { grid-template-columns: 1fr; }
  .v2-pl-tabs { width: 100%; }
  .v2-pl-tab { flex: 1 1 auto; text-align: center; padding: 12px 10px; }
  .v2-pl-meta { width: 100%; justify-content: space-between; }
}
