/*
 * listing.mobile.css - Catalog/listing page, mobile viewport (<1024px)
 * Scope: listing (catalog)
 * Class prefix: l-
 * Loaded via: <link media="(max-width:1023.98px)">
 */

/* Page wrapper */
.l-page {
  background: #F4F5F7;
  min-height: 60vh;
  padding-bottom: var(--space-12);
}

/* Container */
.l-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 14px;
}

/* Heading row */
.l-heading-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0 8px;
  flex-wrap: wrap;
}

.l-heading-row__cat {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0;
  margin: 0;
  line-height: 1.3;
}

.l-heading-row__sep {
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1;
  margin-top: 1px;
}

.l-heading-row__count {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* Banner promo */
.l-banner-promo {
  border-radius: var(--radius-12);
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.l-banner-promo--placeholder {
  background: linear-gradient(100deg, #A80E28 0%, var(--color-primary) 45%, #E8243F 72%, var(--color-primary) 100%);
  box-shadow: 0 2px 10px rgba(200,16,46,.22);
}

.l-banner-promo__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

/* >=480px: row layout (source: max-width:479px stacked, row above that) */
@media (min-width: 480px) {
  .l-banner-promo__inner {
    flex-direction: row;
    align-items: center;
    padding: 14px 20px;
    flex-wrap: wrap;
  }
}

/* Tablet: unwrap banner inner - source breakpoint 768 kept for parity */
@media (min-width: 768px) {
  .l-banner-promo__inner {
    padding: 16px 28px;
    flex-wrap: nowrap;
  }
}

.l-banner-promo__text {
  flex: 1;
  min-width: 0;
}

.l-banner-promo__headline {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.l-banner-promo__headline strong {
  color: #fff;
  font-weight: 800;
}

/* Tablet headline - source breakpoint 768 kept for parity */
@media (min-width: 768px) {
  .l-banner-promo__headline { font-size: 14px; }
}

/* CTA buttons in banner */
.l-banner-promo__btns {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.l-banner-promo__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  height: 36px;
  border-radius: var(--radius-8);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s, background .15s;
}
.l-banner-promo__btn:hover { opacity: .88; text-decoration: none; }

.l-banner-promo__btn--call {
  background: #fff;
  color: var(--color-primary);
  border: none;
}

.l-banner-promo__btn--zalo {
  background: var(--color-zalo);
  color: #fff;
  border: none;
}
.l-banner-promo__btn--zalo:hover { background: #0052CC; opacity: 1; }

/* <480px base: btns full-width stacked */
.l-banner-promo__btns { width: 100%; }
.l-banner-promo__btn { flex: 1; }

/* >=480px: restore natural btn sizing */
@media (min-width: 480px) {
  .l-banner-promo__btns { width: auto; }
  .l-banner-promo__btn { flex: none; }
}

/* Sortbar panel */
.l-sortbar-panel {
  background: var(--color-bg);
  border-radius: var(--radius-12);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 4px rgba(15,23,42,0.05);
  margin-bottom: 14px;
  overflow: hidden;
}

/* Products head */
.l-products-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-soft);
}

.l-products-head__bar {
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--color-primary);
  flex-shrink: 0;
}

.l-products-head__title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--color-text);
  line-height: 1.2;
}

/* Products body */
.l-products-body {
  border-top: 1px solid var(--color-border-soft);
  padding: 16px;
  background: #FAFBFC;
}

/* Sortbar */
.l-sortbar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.l-sortbar__group {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 16px;
  flex-wrap: wrap;
  overflow: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.l-sortbar__group::-webkit-scrollbar { display: none; }

.l-sortbar__label {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Sort links */
.l-sort-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.l-sort-link {
  font-size: 12.5px;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s;
}
.l-sort-link:hover { color: var(--color-primary); text-decoration: none; }
.l-sort-link.is-active {
  color: var(--color-primary);
  font-weight: 700;
  position: relative;
}
.l-sort-link.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

.l-sort-sep {
  color: var(--color-footer-text);
  font-size: 12px;
  user-select: none;
}

/* Price dropdown */
.l-sort-price-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.l-sort-price-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 500;
  color: #374151;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color .15s;
  line-height: 1;
}
.l-sort-price-btn:hover { color: var(--color-primary); }
.l-sort-price-btn.is-active {
  color: var(--color-primary);
  font-weight: 700;
}

.l-sort-price-arrow {
  font-size: 10px;
  line-height: 1;
  display: inline-block;
  transition: transform .15s;
}
.l-sort-price-btn[aria-expanded="true"] .l-sort-price-arrow {
  transform: rotate(180deg);
}

/* Price popup - aligned to right edge on mobile to avoid overflow */
.l-sort-price-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: auto;
  right: 0;
  transform: none;
  min-width: 160px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-8);
  box-shadow: 0 4px 16px rgba(15,23,42,0.12);
  z-index: 200;
  padding: 4px 0;
  white-space: nowrap;
}
.l-sort-price-popup.is-open { display: block; }

.l-sort-price-popup::before {
  content: '';
  position: absolute;
  top: -6px;
  left: auto;
  right: 16px;
  transform: none;
  width: 10px;
  height: 6px;
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.l-sort-price-opt {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.l-sort-price-opt:hover {
  background: #FDE8EC;
  color: var(--color-primary);
  text-decoration: none;
}
.l-sort-price-opt.is-active {
  color: var(--color-primary);
  font-weight: 700;
  background: #FFF5F7;
}

/* Active chips bar */
.l-chips-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border-soft);
}

.l-chips-bar__label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.l-chips-bar__reset {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}
.l-chips-bar__reset:hover { text-decoration: underline; }

.l-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: #FDE8EC;
  color: #9E0C24;
  border: 1px solid #FBC8D0;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.l-chip:hover { background: #fdd0d8; text-decoration: none; }

/* Product grid - 2 col base, 3 col at tablet (source breakpoint 640 kept for parity) */
.l-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 0 4px;
}

@media (min-width: 640px) {
  .l-product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  /* 16th item hidden when 3-col to keep rows even */
  .l-product-grid > .l-grid-item:nth-child(16) { display: none; }
}

.l-grid-item {
  display: flex;
  flex-direction: column;
}

/* Product card fills grid cell */
.l-product-grid .product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.l-product-grid .product-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.l-product-grid .product-card__actions { margin-top: auto; }

/* Load more */
/* <480px base: button full-width */
.l-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 0 4px;
}

.l-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 32px;
  height: 44px;
  width: 100%;
  min-width: 0;
  background: var(--color-bg);
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-10);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* >=480px: restore pill sizing (grid >=3 cols) */
@media (min-width: 480px) {
  .l-load-more { width: auto; min-width: 240px; font-size: 14px; }
  .l-load-more-wrap { padding: 20px 0 8px; }
}
.l-load-more:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(200,16,46,.22);
}
.l-load-more:active:not(:disabled) {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}
.l-load-more:disabled,
.l-load-more.is-loading {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

/* SEO block */
.l-seo-block {
  margin: 20px 0 0;
  padding: 20px;
  border-radius: var(--radius-12);
}

.l-seo-block__title {
  display: block;
  width: fit-content;
  margin: 0 auto 18px;
  padding: 9px 28px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-bg);
  border: 1px solid #EBC7CD;
  border-radius: var(--radius-8);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.l-seo-block__body {
  max-width: 880px;
  margin: 0 auto;
  font-size: 13.5px;
  color: #4B5563;
  line-height: 1.75;
  max-height: 96px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  transition: max-height .35s ease;
}

.l-seo-block__body p { margin: 0 0 10px; }
.l-seo-block__body p:last-child { margin-bottom: 0; }
.l-seo-block__body strong { color: var(--color-text); }

.l-seo-block__body h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin: 14px 0 6px;
}

.l-seo-block__body ul {
  margin: 0 0 12px;
  padding-left: 4px;
  list-style: none;
}
.l-seo-block__body ul > li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 7px;
}
.l-seo-block__body ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='none'%20stroke='%2316A34A'%20stroke-width='2.6'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='4%2011%208%2015%2016%206'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.l-seo-block__body ol {
  margin: 0 0 12px;
  padding-left: 20px;
}
.l-seo-block__body ol > li { margin-bottom: 6px; }

.l-seo-block__body h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-border-soft);
}

.l-seo-block__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-10);
  margin: 12px 0;
  display: block;
}

.l-seo-block__body .prose-table {
  overflow-x: auto;
  margin: 14px 0;
  -webkit-overflow-scrolling: touch;
}
.l-seo-block__body table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-10);
  overflow: hidden;
}
.l-seo-block__body thead th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  font-size: 12.5px;
}
.l-seo-block__body tbody td {
  padding: 9px 12px;
  border-top: 1px solid var(--color-border-soft);
  color: #374151;
  vertical-align: top;
}
.l-seo-block__body tbody tr:nth-child(even) { background: #FAFAFB; }

.l-seo-block__body p.prose-step {
  padding-left: 14px;
  margin: 7px 0;
  font-style: italic;
}
.l-seo-block__body p.prose-step strong:first-child { color: var(--color-text); font-style: normal; }

.l-seo-block__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  margin: 14px auto 0;
  padding: 6px 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-info);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s;
}
.l-seo-block__toggle:hover { color: var(--color-primary); }

.l-seo-toggle-arrow {
  font-size: 11px;
  display: inline-block;
  transition: transform .2s;
}

/* Empty state */
.l-empty {
  text-align: center;
  padding: 56px 24px;
  background: var(--color-bg);
  border-radius: var(--radius-12);
  border: 2px dashed var(--color-border);
}

.l-empty__icon { margin-bottom: 16px; opacity: .5; }

.l-empty__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
}

.l-empty__text {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.l-empty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  height: 44px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-10);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.l-empty__btn:hover { background: var(--color-primary-dark); text-decoration: none; }

/* Mobile contact CTA - visible only on mobile */
.l-mobile-contact {
  display: block;
  margin: 0 14px 20px;
  padding: 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-10);
  text-align: center;
}

.l-mobile-contact__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.l-mobile-contact__sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.l-mobile-contact__actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
}

.l-mobile-contact__call-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 20px;
  height: 44px;
  background: var(--color-primary);
  color: #fff;
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-10);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.l-mobile-contact__call-btn:hover { background: var(--color-primary-dark); text-decoration: none; }

.l-mobile-contact__zalo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 20px;
  height: 44px;
  background: var(--color-zalo);
  color: #fff;
  border: 1.5px solid var(--color-zalo);
  border-radius: var(--radius-10);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.l-mobile-contact__zalo-btn:hover { background: #0052CC; text-decoration: none; }

/* Product card - mobile overrides */
.product-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-card__img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #F7F8FA 0%, #EFF0F3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.product-card:hover .product-card__img { transform: scale(1.04); }

.product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card__discount {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-6);
}

.product-card__body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-card__sku {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.product-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
  margin: 0;
}
.product-card__name a { color: inherit; text-decoration: none; }
.product-card__name a:hover { color: var(--color-primary); }

.product-card__rating {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.product-card__sold {
  font-size: 11px;
  color: var(--color-text-muted);
}

.product-card__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: auto;
}

.product-card__price-main {
  font-size: 17px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.3px;
}
.product-card__price-main--sm { font-size: 17px; }

.product-card__price-original {
  font-size: 12px;
  color: var(--color-text-soft);
  text-decoration: line-through;
}

.product-card__actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.product-card__add-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 6px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-8);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
}
.product-card__add-btn:hover { background: var(--color-primary-dark); }

.product-card__call-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-8);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.product-card__call-btn:hover { background: #FDE8EC; }

.product-card__zalo-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-zalo);
  color: #fff;
  border: none;
  border-radius: var(--radius-8);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background .15s;
}
.product-card__zalo-btn:hover { background: #0052CC; }
