/* =====================================================
   LA — Trang Danh Sách & Chi Tiết Sản Phẩm
   Linh Anh
   ===================================================== */

/* ── Breadcrumb ── */
.la-breadcrumb {
    display: flex;         /* Kích hoạt flexbox */
    align-items: center;    /* Căn giữa tất cả theo chiều dọc */
    flex-wrap: wrap;       /* Cho phép xuống hàng nếu quá dài */
    gap: 6px;              /* Khoảng cách đều giữa các chữ và dấu gạch */
    font-size: 12px;
    color: var(--muted);
    line-height: 1;        /* Ép dòng về 1 để không bị lệch do khoảng cách dòng */
}

/* Căn chỉnh riêng cho dấu gạch chéo */
.la-breadcrumb .sep {
    color: #ccc;
    font-family: sans-serif; /* Dùng font hệ thống để dấu / chuẩn xác nhất */
    display: flex;
    align-items: center;
    height: 100%;          /* Đảm bảo chiều cao bằng với chữ xung quanh */
}

/* Nếu dấu gạch cuối vẫn hơi cao/thấp hơn, dùng margin-top để tinh chỉnh */
.la-breadcrumb .sep:last-child {
    margin-top: -1px; 
}

.la-breadcrumb a {
    text-decoration: none;
    color: var(--navy);
    font-weight: 500;
    transition: 0.2s;
}

.la-breadcrumb a:hover {
    color: var(--red);
    text-decoration: underline;
}

.la-breadcrumb .current { color: var(--text); font-weight: 600; }

/* =====================================================
   TRANG DANH SÁCH SẢN PHẨM (taxonomy-product_cat)
   ===================================================== */

.la-archive-head {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--navy);
    padding: 13px 18px;
    margin-bottom: 12px;
    
    /* CHỈNH Ở ĐÂY: Để breadcrumb lên trên, title xuống dưới */
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    gap: 10px; /* Khoảng cách giữa breadcrumb và phần title */
}

.la-archive-head-left {
    display: flex;
    align-items: center; /* Quan trọng: Giúp Icon và Cụm chữ luôn song song trục giữa */
    gap: 15px;           /* Khoảng cách giữa Icon và Chữ */
}

.la-archive-info-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Bạn có thể thêm padding-top ở đây để "nhích" cụm chữ xuống nếu thấy font chữ bị lệch lên */
    padding-top: 2px; 
}

.la-archive-title {
    margin: 0;           /* Xóa margin mặc định của h1 để không làm lệch khối */
    line-height: 1.2;    /* Khống chế độ cao dòng */
    font-size: 16px;
    font-weight: 800;
    color: var(--navy);
    text-transform: uppercase;
}

.la-archive-count {
    margin: 2px 0 0 0;   /* Khoảng cách nhỏ giữa Title và Count */
    font-size: 12px;
    color: var(--muted);
    font-weight: 500px;
}

/* Các phần icon, title, count giữ nguyên như code của bạn */
.la-archive-icon {
    width: 50px; height: 50px;
    background: var(--navy);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.la-archive-icon svg { width: 25px; height: 25px; fill: white; }


/* Filter bar */
.la-filter-bar {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 9px 14px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.la-filter-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.la-filter-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.la-filter-tag {
  font-size: 11.5px; font-weight: 600; color: var(--navy);
  border: 1px solid var(--border); background: #f7f8fc;
  padding: 4px 12px; cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
}
.la-filter-tag.active,
.la-filter-tag:hover {
  background: var(--navy); color: white; border-color: var(--navy);
}

.la-sort-form { display: flex; align-items: center; }
.la-sort-select {
  font-size: 12.5px; font-family: inherit; color: var(--text);
  border: 1px solid var(--border); padding: 6px 10px;
  background: #f7f8fc; cursor: pointer; outline: none;
  transition: border-color 0.15s;
}
.la-sort-select:focus { border-color: var(--navy); }

/* Archive block */
.la-archive-block {
  background: var(--white);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Archive grid — 3 cột (Ép buộc hiển thị) */
.la-archive-grid {
  display: grid !important; /* Dùng !important để tránh bị các lớp container cũ của theme đè */
  grid-template-columns: repeat(4, 1fr) !important; 
    row-gap: 15px !important;    /* Khoảng cách trên dưới (Tăng con số này theo ý bạn) */
    column-gap: 15px !important; /* Khoảng cách trái phải giữa các ô */  
    background: var(--border); /* Tạo đường kẻ giữa các ô nếu cần */
  border: 1px solid var(--border);
  padding: 2px 5px;
}

/* Điều chỉnh lại Card sản phẩm để khớp với Grid có gap */
.la-archive-grid .la-prod-card {
  background: white;
  border: none !important; /* Bỏ border cũ vì đã có gap và background của grid làm nhiệm vụ phân cách */
  height: 100%;
}

/* Bỏ các đoạn nth-child cũ vì khi dùng gap chúng ta không cần tính toán Border-right nữa */
.la-archive-grid .la-prod-card:nth-child(3n),
.la-archive-grid .la-prod-card:nth-child(4n) { 
  border-right: none !important; 
}

/* Sub-cat badge */
.la-prod-cat-badge {
  font-size: 10px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.5px;
  background: #eef0fa; padding: 2px 8px; width: fit-content;
}

/* No product message */
.la-no-product-msg {
  padding: 40px; text-align: center;
  font-size: 14px; color: var(--muted);
}
.la-no-product-msg a {
  color: var(--navy); font-weight: 600; text-decoration: none; display: block; margin-top: 10px;
}

/* Pagination */
.la-pagination {
  padding: 16px; display: flex; justify-content: center;
  border-top: 1px solid var(--border);
}
.la-pagination ul {
  display: flex; gap: 4px; list-style: none; padding: 0; margin: 0;
}
.la-pagination ul li a,
.la-pagination ul li span {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  font-size: 13px; font-weight: 600; color: var(--text);
  border: 1px solid var(--border); background: #fff;
  text-decoration: none; transition: all 0.12s;
}
.la-pagination ul li.active span,
.la-pagination ul li span.current {
  background: var(--navy); color: white; border-color: var(--navy);
}
.la-pagination ul li a:hover {
  background: #f0f3ff; border-color: var(--navy); color: var(--navy);
}

/* =====================================================
   TRANG CHI TIẾT SẢN PHẨM (single-product)
   ===================================================== */

/* Category bar trên cùng */
.la-product-catbar {
  background: var(--navy);
  color: white;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; margin-bottom: 12px;
  border-left: 4px solid var(--red);
}
.la-product-catbar-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.la-product-catbar-icon svg { width: 16px; height: 16px; }
.la-product-catbar-name {
  font-size: 12.5px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
}

/* Detail card wrapper */
.la-product-detail {
  background: var(--white);
  border: 1px solid var(--border);
}

/* Top: grid 2 cột */
.la-product-top {
  display: grid;
  grid-template-columns: 360px 1fr;
}

/* ── Gallery ── */
.la-product-gallery {
  border-right: 1px solid var(--border);
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
}

.la-product-main-img {
  border: 1px solid var(--border);
  background: #fafafa;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-in;
}
.la-product-main-img img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 0.3s ease;
}
.la-product-main-img:hover img { transform: scale(1.05); }

.la-product-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.la-thumb {
  width: 62px; height: 62px;
  border: 2px solid var(--border);
  background: #fafafa;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  transition: border-color 0.15s;
}
.la-thumb img { width: 100%; height: 100%; object-fit: contain; }
.la-thumb:hover { border-color: var(--navy); }
.la-thumb.active { border-color: var(--red); }

/* ── Info panel ── */
.la-product-info-panel {
  padding: 22px 26px;
  display: flex; flex-direction: column; gap: 14px;
}

.la-product-title {
  font-size: 21px; font-weight: 800; color: var(--text);
  line-height: 1.3; padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  margin: 0;
}

/* Meta table */
.la-product-meta-table {
  width: 100%; border-collapse: collapse;
}
.la-product-meta-table tr { border-bottom: 1px solid #f0f2f8; }
.la-product-meta-table tr:last-child { border-bottom: none; }
.la-product-meta-table td {
  padding: 8px 4px; font-size: 13px; vertical-align: middle;
}
.la-product-meta-table td:first-child {
  font-weight: 700; color: var(--text); width: 136px;
  white-space: nowrap; padding-right: 12px;
}
.la-product-meta-table td:last-child { color: #445; }

.la-meta-catlink {
  color: var(--navy); font-weight: 600; text-decoration: none;
}
.la-meta-catlink:hover { color: var(--red); }

.la-stock-badge {
  font-size: 11.5px; font-weight: 700; padding: 2px 10px;
}
.la-instock  { color: #16a34a; background: #dcfce7; }
.la-outofstock { color: var(--red); background: #fee2e2; }

/* Price row */
.la-product-price-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.la-product-price-main {
  font-size: 22px; font-weight: 900; color: var(--red);
}
.la-product-price-main .woocommerce-Price-amount { color: var(--red); }
.la-product-price-note {
  font-size: 11.5px; color: var(--muted); font-weight: 600;
  background: #f7f8fc; border: 1px solid var(--border); padding: 3px 10px;
}

/* Action buttons */
.la-product-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.la-btn-contact {
  background: var(--red); color: white;
  font-size: 13px; font-weight: 700; padding: 11px 24px;
  text-decoration: none; text-transform: uppercase; letter-spacing: 0.8px;
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.la-btn-contact:hover {
  background: var(--red2); color: white;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(224,32,32,0.28);
}

.la-btn-quote {
  background: var(--navy); color: white;
  font-size: 13px; font-weight: 700; padding: 11px 22px;
  text-decoration: none; text-transform: uppercase; letter-spacing: 0.8px;
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.la-btn-quote:hover { background: var(--navy2); color: white; }

/* Catalog download */
.la-catalog-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: #f7f8fc;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  width: fit-content;
  max-width: 100%;
}
.la-catalog-link:hover { border-color: var(--navy); background: #eef0fa; }
.la-catalog-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.la-catalog-link:hover .la-catalog-icon { background: var(--red); }
.la-catalog-icon svg { width: 18px; height: 18px; }
.la-catalog-txt strong {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--navy); margin-bottom: 2px;
}
.la-catalog-txt span { font-size: 11.5px; color: var(--muted); }

/* Contact strip */
.la-product-contact-strip {
  padding: 11px 14px;
  background: #fef2f2;
  border: 1px solid rgba(224,32,32,0.15);
  display: flex; align-items: center; gap: 10px;
}
.la-product-contact-strip svg {
  width: 18px; height: 18px; flex-shrink: 0; color: var(--red);
}
.la-product-contact-strip p { font-size: 12.5px; color: var(--text); }
.la-product-contact-strip a { color: var(--navy); font-weight: 700; text-decoration: none; }
.la-product-contact-strip a:hover { color: var(--red); }

/* ── Tabs ── */
.la-product-tabs { border-top: 2px solid var(--border); }

.la-tabs-nav {
  display: flex;
  background: #f7f8fc;
  border-bottom: 2px solid var(--border);
}
.la-tab-nav-btn {
  padding: 12px 22px; font-size: 12.5px; font-weight: 700;
  color: var(--muted); cursor: pointer; border: none; background: transparent;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: inherit; text-transform: uppercase; letter-spacing: 0.5px;
  transition: color 0.15s, border-color 0.15s;
}
.la-tab-nav-btn.active {
  color: var(--navy); border-bottom-color: var(--red); background: var(--white);
}
.la-tab-nav-btn:hover:not(.active) { color: var(--text); }

.la-tab-content { display: none; padding: 24px; }
.la-tab-content.active { display: block; }

/* Mô tả */
.la-short-desc { margin-bottom: 16px; }
.la-short-desc p,
.la-full-desc p { font-size: 13.5px; line-height: 1.75; color: #334; margin-bottom: 10px; }
.la-short-desc a, .la-full-desc a { color: var(--navy); }

.la-full-desc h4,
.la-full-desc h3,
.la-full-desc strong {
  color: var(--text); font-weight: 700;
}
.la-full-desc ul, .la-full-desc ol { padding-left: 0; list-style: none; }
.la-full-desc li {
  font-size: 13.5px; color: #334; padding: 4px 0 4px 16px;
  position: relative; border-bottom: 1px solid #f3f4f9; line-height: 1.6;
}
.la-full-desc li::before {
  content: '-'; position: absolute; left: 0; color: var(--navy); font-weight: 700;
}
.la-no-desc { font-size: 13px; color: var(--muted); }

/* Spec table */
.la-spec-table { width: 100%; border-collapse: collapse; }
.la-spec-table tr { border-bottom: 1px solid #f0f2f8; }
.la-spec-table tr:last-child { border-bottom: none; }
.la-spec-table tr:nth-child(even) td { background: #f9fafb; }
.la-spec-table td { padding: 9px 14px; font-size: 13px; }
.la-spec-table td:first-child {
  font-weight: 700; color: var(--navy); width: 200px;
  border-right: 1px solid var(--border);
}

/* Compatible */
.la-compatible {
  background: #eef0fa; border: 1px solid var(--border);
  padding: 12px 16px; margin-top: 16px;
}
.la-compatible strong {
  font-size: 11.5px; font-weight: 800; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.5px;
  display: block; margin-bottom: 5px;
}
.la-compatible p { font-size: 13px; color: #334; }

/* Related products */
.la-related-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.la-related-card {
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; transition: background 0.15s;
}
.la-related-card:nth-child(4n) { border-right: none; }
.la-related-card:hover { background: #fef2f2; }
.la-related-card img { width: 100%; height: 100px; object-fit: contain; }
.la-related-card span {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4;
}
.la-related-card:hover span { color: var(--red); }
.la-related-price { font-size: 13px; font-weight: 800; color: var(--red); margin-top: auto; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
  .la-archive-grid { grid-template-columns: repeat(2, 1fr); }
  .la-archive-grid .la-prod-card:nth-child(3n) { border-right: 1px solid var(--border); }
  .la-archive-grid .la-prod-card:nth-child(2n) { border-right: none; }
  .la-product-top { grid-template-columns: 300px 1fr; }
  .la-related-grid { grid-template-columns: repeat(3, 1fr); }
  .la-related-card:nth-child(4n) { border-right: 1px solid var(--border); }
  .la-related-card:nth-child(3n) { border-right: none; }
}

@media (max-width: 768px) {
  .la-product-top { grid-template-columns: 1fr; }
  .la-product-gallery { border-right: none; border-bottom: 1px solid var(--border); }
  .la-archive-grid { grid-template-columns: repeat(2, 1fr); }
  .la-related-grid { grid-template-columns: repeat(2, 1fr); }
  .la-related-card:nth-child(3n) { border-right: 1px solid var(--border); }
  .la-related-card:nth-child(2n) { border-right: none; }
  .la-tabs-nav { flex-wrap: wrap; }
  .la-tab-nav-btn { font-size: 11.5px; padding: 10px 14px; }
}

/* Header & Pills */
.la-info-header { border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 15px; }
.la-product-title { font-size: 22px; color: var(--navy); line-height: 1.3; margin-bottom: 8px; }
.la-product-meta-pills { display: flex; gap: 15px; font-size: 13px; color: var(--muted); }
.t-green { color: var(--green); }
.t-red { color: var(--red); }

/* Grid Meta */
.la-product-main-meta { 
    display: grid; grid-template-columns: 1fr 1fr; 
    background: #f8fafc; border: 1px solid var(--border);
    padding: 12px; border-radius: 4px; margin-bottom: 15px;
}
.la-meta-item { display: flex; flex-direction: column; }
.la-meta-label { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.5px; }
.la-meta-val { font-weight: 700; color: #334155; }

/* Container chứa các nút hành động */
.la-product-actions-v2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

/* Base style cho cả hai nút (giữ nguyên) */
.la-btn-main {
    text-decoration: none !important; /* Bỏ gạch chân */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 4px;
    transition: 0.3s ease-in-out; /* Hiệu ứng chuyển màu mượt mà */
    border: none;
    cursor: pointer;
}

/* Style cho chữ bên trong nút (giữ nguyên) */
.la-btn-main strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}
.la-btn-main span {
    font-size: 11px;
    opacity: 0.9;
}

/* --- CẬP NHẬT MÀU SẮC CHÍNH --- */

/* Nút đầu tiên (Gọi tư vấn) -> MÀU ĐỎ */
.la-btn-call {
    background-color: var(--red) !important; /* Dùng biến màu đỏ của bạn */
    color: #ffffff !important; /* Chữ mặc định màu trắng */
    border-bottom: 3px solid var(--red2) !important; /* Viền đổ bóng màu đỏ đậm */
}

/* Nút thứ hai (Yêu cầu báo giá) -> MÀU XANH BIỂN (NAVY) */
.la-btn-email {
    background-color: var(--navy) !important; /* Dùng biến màu navy của bạn */
    color: #ffffff !important; /* Chữ mặc định màu trắng */
    border-bottom: 3px solid var(--navy2) !important; /* Viền đổ bóng màu navy đậm */
}

/* --- HIỆU ỨNG HOVER CHO TEXT --- */

/* Khi hover nút Call -> TEXT đổi sang màu XANH BIỂN */
.la-btn-call:hover {
    color: var(--navy) !important;
    background-color: #fef2f2 !important; /* Đổi nền trắng hồng nhẹ để chữ Navy nổi bật */
    border-bottom-color: var(--navy2) !important;
}
.la-btn-call:hover span {
    color: var(--navy) !important;
}

/* Khi hover nút Email -> TEXT đổi sang màu ĐỎ */
.la-btn-email:hover {
    color: var(--red) !important;
    background-color: #eef0fa !important; /* Đổi nền xanh nhạt để chữ Đỏ nổi bật */
    border-bottom-color: var(--red2) !important;
}
.la-btn-email:hover span {
    color: var(--red) !important;
}

/* Giữ nguyên hiệu ứng nhích nhẹ khi hover của cả 2 nút */
.la-btn-main:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Catalog Card */
.la-catalog-card {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px dashed #cbd5e1; padding: 12px;
    text-decoration: none; color: inherit; border-radius: 6px; transition: 0.2s;
}
.la-catalog-card:hover { border-color: var(--navy); background: #f1f5f9; }
.la-catalog-icon-v2 { 
    background: #ef4444; color: #fff; font-weight: 900; font-size: 10px;
    padding: 8px 5px; border-radius: 4px; line-height: 1;
}
.la-catalog-info strong { display: block; font-size: 14px; color: var(--navy); }
.la-catalog-info span { font-size: 12px; color: var(--muted); }
.la-download-arrow { width: 20px; margin-left: auto; fill: none; stroke: var(--muted); stroke-width: 2; }

/* Container sản phẩm liên quan */
.la-related-section {
    padding-top: 30px;
    border-top: 1px solid #eee;
    /* Đường kẻ mờ ngăn cách */
}

/* Tiêu đề phần liên quan */
.la-related-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    position: relative;
    padding-left: 15px;
}

/* Tạo gạch đứng màu cam bên cạnh tiêu đề cho đẹp */    
.la-related-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--orange);
}

/* Grid sản phẩm */
.la-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 cột */
    gap: 20px;
}

/* Card sản phẩm liên quan */
.la-related-card {
    background: #fff;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.la-related-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: var(--orange);
}

.la-related-card-img {
    aspect-ratio: 1/1;
    overflow: hidden;
    padding: 10px;
}

.la-related-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.la-related-card-info {
    padding: 12px;
    border-top: 1px solid #f9f9f9;
}

.la-related-name {
    display: block;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 8px;
    height: 40px;
    /* Giới hạn 2 dòng */
    overflow: hidden;
}

.la-related-price {
    color: var(--red);
    font-weight: 700;
    font-size: 15px;
}

/* Mobile: Chuyển về 2 cột */
@media (max-width: 768px) {
    .la-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
