/* =========================================
   BESIMEX FILTER BAR – DESKTOP + MOBILE
   ========================================= */

/* Wrapper không còn viền lớn */
.besi-filters-wrapper {
  margin: 0 0 24px 0;
  padding: 0;
  border: none;
  background: transparent;
}

/* Form filters */
.besi-filters-bar {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
}

.besi-filters-inner {
  display: flex;
  flex-direction: column;
  gap: 12px; /* khoảng cách giữa row 1 & row 2 */
}

/* ------------------- HÀNG 1 -------------------
   Search – Category – Cert – Origin – Packaging – Availability
-------------------------------------------------*/

.besi-filters-row-top {
  display: grid;
  grid-template-columns:
    minmax(260px, 3fr)
    minmax(130px, 1fr)
    minmax(150px, 1fr)
    minmax(110px, 1fr)
    minmax(170px, 1fr)  /* Packaging Type */
    minmax(140px, 1fr);
  column-gap: 12px;
}


/* ===== HÀNG 2: HS Code – Export Form – Meta ===== */

.besi-filters-row-bottom {
    display: grid;
    grid-template-columns: 140px 160px minmax(0, 1fr); /* HS / Export / meta */
    column-gap: 12px;
    align-items: center;
}

/* Cố định kích thước 2 ô đầu theo Figma */
.besi-filter-hs {
    width: 140px;
    min-width: 140px;
}

.besi-filter-export {
    width: 160px;
    min-width: 160px;
}

/* Meta chiếm cột thứ 3 và bám sát mép phải */
.besi-filters-meta {
    grid-column: 3;              /* nằm cột 3 */
    justify-self: end;           /* đẩy về cuối bên phải */
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #667085;
    white-space: nowrap;         /* không xuống dòng giữa chữ */
}

.besi-filters-meta-icon {
    font-size: 16px;
}

@media (max-width: 768px) {
    .besi-filters-row-bottom {
        grid-template-columns: 1fr; /* mỗi item một hàng */
        row-gap: 8px;
    }

    .besi-filter-hs,
    .besi-filter-export {
        width: 100%;
        min-width: 0;
    }

    .besi-filters-meta {
        grid-column: 1;
        justify-self: center;
        text-align: center;
        white-space: normal;
    }
}

/* ------------------- PILL CHUNG ------------------- */

.besi-filter-item {
  position: relative;
  box-sizing: border-box;
}

/* Icon trái trong pill */
.besi-filter-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #344054;
  pointer-events: none;
}

/* SEARCH pill */
.besi-filter-search {
  height: 48px;
  border-radius: 12px;
  border: 1px solid #E4E7EC;
  background: #FFFFFF;
  padding: 0 16px 0 44px;
  display: flex;
  align-items: center;
}

.besi-filter-search input[type="search"] {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  height: 100%;
  font-size: 14px;
  color: #101828;
  padding: 0;
}

/* Dropdown pills: Category / Cert / Origin / Packaging / Availability / HS / Export */
.besi-filter-pill {
  height: 48px;
  border-radius: 12px;
  border: 1px solid #E4E7EC;
  background: #FFFFFF;
  padding: 0 16px 0 44px;
  display: flex;
  align-items: center;
}

.besi-filter-pill select,
.besi-filter-pill input,
.besi-filter-pill textarea {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: #101828;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Hover / focus */
.besi-filter-search:hover,
.besi-filter-search:focus-within,
.besi-filter-pill:hover,
.besi-filter-pill:focus-within {
  border-color: rgba(4, 52, 72, 0.12);
  box-shadow: 0 0 0 1px rgba(4, 52, 72, 0.15);
}

/* ------------------- SEARCH SUGGESTIONS ------------------- */

.besi-filter-search {
  position: relative;
  overflow: visible;
}

.besi-search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E4E7EC;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 9999;
}

.besi-search-suggestions.is-open {
  display: block !important;
}

.besi-search-suggestions ul {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.besi-search-suggestions li {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.besi-search-suggestions li:hover {
  background: #F2F7E8;
}

.besi-suggest-title {
  color: #101828;
  font-weight: 500;
}

.besi-suggest-hs {
  color: #667085;
  font-size: 12px;
}

/* ------------------- GRID PRODUCTS ------------------- */

.besi-products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.besi-products-grid.besi-grid-hidden {
  display: none;
}

/* ------------------- RESPONSIVE ------------------- */

/* Tablet & mobile: xếp dọc từng ô */
@media (max-width: 1023px) {
  .besi-filters-bar {
    padding: 0 16px;
  }

  .besi-filters-row-top,
  .besi-filters-row-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .besi-filter-search,
  .besi-filter-pill {
    width: 100%;
  }

  .besi-filters-meta {
    justify-content: center;
    margin-top: 4px;
  }

  .besi-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile nhỏ */
@media (max-width: 640px) {
  .besi-products-grid {
    grid-template-columns: 1fr;
  }
}





/* ==== CARD SẢN PHẨM ==== */

.besi-product-card {
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid #E4E7EC;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.besi-product-card:hover {
    border-color: #C5E0A5;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.10);
    transform: translateY(-2px);
}

.besi-product-thumb {
    display: block;
    overflow: hidden;
}

.besi-product-image {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.besi-product-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F7FA;
    color: #98A2B3;
    font-size: 13px;
}

/* BODY */

.besi-product-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Category chip */

.besi-product-chip {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 999px;
    background: #F2F7E8;
    color: #4B7F1E;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Title */

.besi-product-title {
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
}

.besi-product-title a {
    color: #043448;
    text-decoration: none;
    font-weight: 600;
}

.besi-product-title a:hover {
    text-decoration: underline;
}

/* META */

.besi-product-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 6px;
    column-gap: 16px;
    font-size: 12px;
}

.besi-product-meta-item {
    display: flex;
    flex-direction: column;
}

.besi-product-meta-label {
    color: #98A2B3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 1px;
}

.besi-product-meta-value {
    color: #344054;
    font-weight: 500;
}

/* FOOTER: link + CTA */

.besi-product-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.besi-product-link {
    font-size: 13px;
    color: #043448;
    text-decoration: none;
    font-weight: 500;
}

.besi-product-link:hover {
    text-decoration: underline;
}

.besi-product-cta {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #789900;
    background: #789900;
    color: #FFFFFF;
    text-decoration: none;
    white-space: nowrap;
}

.besi-product-cta:hover {
    background: #5F7A00;
    border-color: #5F7A00;
}

/* No results */

.besi-no-results {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: #667085;
}

/* ==== GRID LAYOUT – giữ 3 cột, căng đều chiều cao ==== */

.besi-products-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
    align-items: stretch; /* các card cao bằng nhau */
}

@media (max-width: 1024px) {
    .besi-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .besi-products-grid {
        grid-template-columns: 1fr;
    }
}

.besi-products-grid.besi-grid-hidden {
    display: none;
}

/* ==== CARD SẢN PHẨM – vuông vắn, gọn ==== */

.besi-product-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E4E7EC;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
    height: 100%; /* luôn căng full ô grid */
}

.besi-product-card:hover {
    border-color: #C5E0A5;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}

/* Ảnh / placeholder */

.besi-product-thumb {
    display: block;
    height: 180px;
    background: #F5F7FA;
    overflow: hidden;
}

.besi-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.besi-product-image--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F7FA;
    color: #98A2B3;
    font-size: 13px;
}

/* Phần nội dung */

.besi-product-body {
    flex: 1 1 auto;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Category chip */

.besi-product-chip {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    background: #E5F3C4;
    color: #4B7F1E;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Tiêu đề */

.besi-product-title {
    margin: 2px 0 0;
    font-size: 15px;
    line-height: 1.4;
}

.besi-product-title a {
    color: #043448;
    text-decoration: none;
    font-weight: 600;
}

.besi-product-title a:hover {
    text-decoration: underline;
}

/* Meta: HS, Origin, Packaging, Availability */

.besi-product-meta {
    margin-top: 4px;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 4px;
    font-size: 12px;
}

.besi-product-meta-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.besi-product-meta-label {
    color: #98A2B3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 10px;
    font-weight: 600;
}

.besi-product-meta-value {
    color: #344054;
    font-weight: 500;
    text-align: right;
}

/* Footer: link + CTA, luôn nằm đáy card */

.besi-product-footer {
    margin-top: auto; /* đẩy footer xuống đáy */
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.besi-product-link {
    font-size: 13px;
    color: #043448;
    text-decoration: none;
    font-weight: 500;
}

.besi-product-link:hover {
    text-decoration: underline;
}

.besi-product-cta {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #789900;
    background: #789900;
    color: #FFFFFF;
    text-decoration: none;
    white-space: nowrap;
}

.besi-product-cta:hover {
    background: #5F7A00;
    border-color: #5F7A00;
}

/* Không có kết quả */

.besi-no-results {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: #667085;
}

/* ===== GRID: card 350px giống Figma ===== */
.besi-products-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 32px;
    align-items: stretch;
}

.besi-products-grid.besi-grid-hidden {
    display: none;
}

/* ============================================================
   CARD FIGMA — SIZE 350 x 500
   ============================================================ */

.besi-product-card.besi-card-figma {
    width: 100%;
    max-width: 347px;
    min-height: 500px;
    background: #FFFFFF;
    border-radius: 24px;
    border: 1px solid #E4E7EC;
    box-shadow: 0 18px 45px rgba(15,23,42,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.besi-product-card.besi-card-figma:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 58px rgba(15,23,42,0.16);
    border-color: #C5E0A5;
}

/* ============================================================
   MEDIA SECTION (ảnh + badge)
   ============================================================ */

.besi-card-media {
    position: relative;
    height: 220px;
    background: #000;
    overflow: hidden;
}

.besi-card-thumb {
    display: block;
    width: 100%;
    height: 100%;
}

.besi-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.besi-card-image--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F7FA;
    color: #98A2B3;
    font-size: 13px;
}

.besi-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #FFE7D0;
    color: #B54708;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   BODY
   ============================================================ */

.besi-card-body {
    flex: 1 1 auto;
    padding: 20px 22px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.besi-card-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
}

.besi-card-title a {
    color: #043448;
    text-decoration: none;
}

.besi-card-title a:hover {
    text-decoration: underline;
}

.besi-card-excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4B5563;
}

/* ============================================================
   CHIPS
   ============================================================ */

.besi-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.besi-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #F3F4F6;
    color: #111827;
    font-size: 12px;
    font-weight: 500;
}

/* ============================================================
   HS CODE LINE
   ============================================================ */

.besi-card-hscode {
    margin-top: 6px;
    font-size: 13px;
    color: #4B5563;
}

.besi-hs-label {
    font-weight: 600;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    color: #9CA3AF;
}

.besi-hs-value {
    font-weight: 500;
}

/* ============================================================
   BUTTONS — 2 NÚT CHIA 50/50, CĂN LỀ ĐẸP
   ============================================================ */

/* Container cho 2 nút dưới card */
.besi-card-actions,
.besi-card-buttons {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 12px;               /* khoảng hở giữa hai nút */
    margin-top: 16px;
    padding: 0 22px 20px;    /* 22px ngang = body, 20px dưới = không dính mép card */
    box-sizing: border-box;
}

/* Hai nút chia đều một hàng, mỗi nút là một pill riêng */
.besi-card-actions .besi-btn,
.besi-card-buttons .besi-btn {
    flex: 1 1 0;             /* chia đều chiều ngang 50/50 */
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;     /* pill tròn 4 góc */
    height: 40px;
    font-size: 14px;
    font-weight: 600;
    padding: 0 16px;
    text-decoration: none;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    box-sizing: border-box;
    white-space: nowrap;
}

/* nút trái – nền đậm */
.besi-btn-primary {
    background: #043448;
    border-color: #043448;
    color: #FFFFFF;
}

/* nút phải – nền trắng */
.besi-btn-ghost {
    background: #FFFFFF;
    border-color: #E4E7EB;
    color: #043448;
}
