/**
 * DENTI B2B Theme — Hyva Product Patterns Upgrade
 * 
 * Enhances existing P7 product pages with modern e-commerce patterns
 * inspired by Hyva Theme (Magento 2). Uses existing denti-b2b CSS variables.
 *
 * Patterns: Gallery Thumbnails, Product Card Hover Actions, Sticky CTA,
 *           Skeleton Loading, Image Zoom, Category Chip Enhancement
 */

/* ============================================================
   0. TOKEN BRIDGE — Map Pearl tokens to denti-b2b vars
   ============================================================ */
:root {
  --hyva-primary: var(--color-primary, #415097);
  --hyva-cta: var(--color-cta, #f27131);
  --hyva-text: var(--color-text, #212121);
  --hyva-text-light: var(--color-text-light, #575757);
  --hyva-bg: var(--color-bg-white, #ffffff);
  --hyva-bg-subtle: var(--color-bg-light, #f5f5f7);
  --hyva-border: var(--color-bone, #e5e7eb);
  --hyva-radius: 12px;
  --hyva-radius-sm: 8px;
  --hyva-shadow-hover: 0 12px 32px rgba(65, 80, 151, 0.12);
}

/* ============================================================
   1. PRODUCT CARD HOVER ACTIONS — PLP Grid Enhancement
   ============================================================ */

/* Smooth card lift with brand shadow */
.p7-card.b2b-product-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--hyva-radius);
  border: 1px solid var(--hyva-border);
  background: var(--hyva-bg);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.p7-card.b2b-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hyva-shadow-hover);
  border-color: rgba(65, 80, 151, 0.15);
}

/* Image container with aspect ratio lock */
.p7-card .product-image-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--hyva-bg-subtle);
}

.p7-card .product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: opacity 0.4s ease, transform 0.35s ease;
}

/* Secondary image on hover (data-hover-img populated by PHP) */
.p7-card .product-image-wrapper .p7-hover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.p7-card.b2b-product-card:hover .product-image-wrapper .p7-hover-image {
  opacity: 1;
}

.p7-card.b2b-product-card:hover .product-image-wrapper .p7-product-thumb {
  opacity: 0;
}

/* Quick action icons — slide in from right */
.p7-card-actions {
  position: absolute;
  top: 12px;
  right: -50px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: right 0.3s ease;
  z-index: 5;
}

.p7-card.b2b-product-card:hover .p7-card-actions {
  right: 12px;
}

.p7-card-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--hyva-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hyva-text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  padding: 0;
}

.p7-card-action-btn:hover {
  background: var(--hyva-primary);
  color: #fff;
  border-color: var(--hyva-primary);
  transform: scale(1.1);
}

.p7-card-action-btn svg {
  width: 16px;
  height: 16px;
}

/* Bottom CTA bar — slides up on hover */
.p7-card-cta-bar {
  position: absolute;
  bottom: -48px;
  left: 0;
  right: 0;
  display: flex;
  gap: 0;
  transition: bottom 0.3s ease;
  z-index: 5;
}

.p7-card.b2b-product-card:hover .p7-card-cta-bar {
  bottom: 0;
}

.p7-card-cta-bar a {
  flex: 1;
  text-align: center;
  padding: 11px 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: background 0.2s ease;
}

.p7-card-cta-bar .p7-cta-detail {
  background: var(--hyva-primary);
  color: #fff;
}

.p7-card-cta-bar .p7-cta-detail:hover {
  background: #344183;
}

.p7-card-cta-bar .p7-cta-quote {
  background: var(--hyva-cta);
  color: #fff;
}

.p7-card-cta-bar .p7-cta-quote:hover {
  background: #e0621e;
}

/* Brand category tag enhancement */
.p7-card .product-category-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hyva-primary);
  background: rgba(65, 80, 151, 0.06);
  border: 1px solid rgba(65, 80, 151, 0.1);
  margin-bottom: 6px;
}

/* Product info improvements */
.p7-card .product-info {
  padding: 14px 16px 16px;
}

.p7-card .woocommerce-loop-product__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--hyva-text);
  margin: 4px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hide old product-actions div (replaced by p7-card-cta-bar) */
.p7-card .product-actions {
  display: none;
}

/* ============================================================
   2. PDP GALLERY — Vertical Thumbnails + Lightbox
   ============================================================ */

/* Vertical thumbnail layout in hero zone */
.p7-hero-zone .woocommerce-product-gallery {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
}

.p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs {
  order: -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c2c2c2 transparent;
  list-style: none;
  margin: 0;
  padding: 0;
}

.p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar {
  width: 3px;
}

.p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-thumb {
  background: #c2c2c2;
  border-radius: 2px;
}

.p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs li {
  flex-shrink: 0;
}

.p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs li img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 2px solid transparent;
  border-radius: var(--hyva-radius-sm);
  cursor: pointer;
  opacity: 0.5;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  background: var(--hyva-bg-subtle);
  padding: 4px;
}

.p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs li img:hover,
.p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs li img.flex-active {
  border-color: var(--hyva-primary);
  opacity: 1;
}

/* Main image zoom on hover */
.p7-hero-zone .woocommerce-product-gallery .flex-viewport {
  cursor: zoom-in;
  overflow: hidden;
}

.p7-hero-zone .woocommerce-product-gallery .flex-viewport img {
  transition: transform 0.3s ease-out;
  transform-origin: center center;
}

.p7-hero-zone .woocommerce-product-gallery .flex-viewport:hover img {
  transform: scale(1.5);
}

/* Lightbox trigger button */
.p7-gallery-fullscreen-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--hyva-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  color: var(--hyva-text);
  transition: all 0.2s ease;
  padding: 0;
}

.p7-gallery-fullscreen-btn:hover {
  background: var(--hyva-primary);
  color: #fff;
  border-color: var(--hyva-primary);
}

.p7-gallery-fullscreen-btn svg {
  width: 18px;
  height: 18px;
}

/* Lightbox overlay */
.p7-gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.p7-gallery-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.p7-gallery-lightbox img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

.p7-gallery-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.p7-gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.p7-gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.p7-gallery-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.p7-gallery-lightbox-nav.prev { left: 24px; }
.p7-gallery-lightbox-nav.next { right: 24px; }

/* Mobile gallery: thumbs go horizontal */
@media (max-width: 768px) {
  .p7-hero-zone .woocommerce-product-gallery {
    grid-template-columns: 1fr;
  }

  .p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .p7-hero-zone .woocommerce-product-gallery .flex-control-thumbs li img {
    width: 56px;
    height: 56px;
    scroll-snap-align: start;
  }
}

/* ============================================================
   3. STICKY CTA BAR — B2B Mobile-First Conversion Pattern
   ============================================================ */

.p7-sticky-cta {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: var(--hyva-bg);
  border-top: 1px solid var(--hyva-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 900;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  transition: bottom 0.3s ease;
}

.p7-sticky-cta.visible {
  bottom: 0;
}

.p7-sticky-cta-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--hyva-radius-sm);
  background: var(--hyva-bg-subtle);
  padding: 4px;
}

.p7-sticky-cta-info {
  flex: 1;
  min-width: 0;
}

.p7-sticky-cta-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--hyva-text);
}

.p7-sticky-cta-price {
  font-size: 12px;
  color: var(--hyva-text-light);
}

.p7-sticky-cta-btn {
  padding: 10px 20px;
  background: var(--hyva-cta);
  color: #fff;
  border: none;
  border-radius: var(--hyva-radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.p7-sticky-cta-btn:hover {
  background: #e0621e;
  color: #fff;
}

.p7-sticky-cta-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   4. SKELETON LOADING — Perceived Performance
   ============================================================ */

@keyframes p7-skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.p7-skeleton {
  background: linear-gradient(90deg, #f0f0f2 25%, #e4e4e8 50%, #f0f0f2 75%);
  background-size: 200% 100%;
  animation: p7-skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--hyva-radius-sm);
}

.p7-skeleton-image {
  aspect-ratio: 4 / 3;
  width: 100%;
}

.p7-skeleton-text { height: 14px; margin-bottom: 8px; }
.p7-skeleton-text--short { width: 50%; }
.p7-skeleton-price { height: 16px; width: 35%; margin-top: 6px; }

/* ============================================================
   5. CATEGORY FILTER CHIPS — Enhanced Styling
   ============================================================ */

.ane-category-filter .cat-pill {
  padding: 8px 18px;
  border: 1.5px solid var(--hyva-border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hyva-text-light);
  text-decoration: none;
  transition: all 0.2s ease;
  background: var(--hyva-bg);
}

.ane-category-filter .cat-pill:hover {
  border-color: var(--hyva-primary);
  color: var(--hyva-primary);
  background: rgba(65, 80, 151, 0.04);
}

.ane-category-filter .cat-pill.active {
  background: var(--hyva-primary);
  color: #fff;
  border-color: var(--hyva-primary);
}

/* Sub-category pills */
.ane-subcategory-filter .cat-pill {
  padding: 5px 14px;
  font-size: 12px;
  border-color: rgba(65, 80, 151, 0.15);
}

.ane-subcategory-filter .cat-pill.active {
  background: rgba(65, 80, 151, 0.08);
  color: var(--hyva-primary);
  border-color: var(--hyva-primary);
}

/* ============================================================
   6. FACETED FILTER BAR — Improved Styling
   ============================================================ */

.p7-faceted-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 20px;
  background: var(--hyva-bg-subtle);
  border: 1px solid var(--hyva-border);
  border-radius: var(--hyva-radius);
  margin-bottom: 20px;
}

.p7-faceted-bar label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hyva-text-light);
  margin-bottom: 4px;
  display: block;
}

.p7-faceted-bar select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--hyva-border);
  border-radius: var(--hyva-radius-sm);
  font-size: 13px;
  background: var(--hyva-bg);
  color: var(--hyva-text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23575757' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

@media (max-width: 768px) {
  .p7-faceted-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .p7-faceted-bar {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   7. RESULTS COUNTER BADGE
   ============================================================ */

.p7-results-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--hyva-text-light);
  margin-bottom: 16px;
}

.p7-results-badge strong {
  color: var(--hyva-text);
  font-weight: 700;
}

/* ============================================================
   8. RESPONSIVE REFINEMENTS
   ============================================================ */

/* Mobile: hide hover-only elements, show tap targets */
@media (max-width: 768px) {
  .p7-card-actions {
    display: none;
  }

  .p7-card-cta-bar {
    position: static;
    bottom: auto;
  }

  .p7-card-cta-bar a {
    padding: 10px 8px;
    font-size: 11px;
  }

  /* Gallery zoom off on touch devices */
  .p7-hero-zone .woocommerce-product-gallery .flex-viewport:hover img {
    transform: none;
  }
}

/* Desktop: hide sticky CTA on large screens where sidebar is visible */
@media (min-width: 1024px) {
  .p7-sticky-cta {
    display: none;
  }
}
/* ============================================================
   9. PLP & MOBILE UX REWRITE (Giai đoạn 2)
   ============================================================ */

/* 9.1 Giao diện Danh mục (PLP) */
/* Ẩn Category Tag trên trang Archive để đỡ rối mắt */
.archive .product-category-tag,
.tax-product_cat .product-category-tag,
.tax-pwb-brand .product-category-tag,
.search-results .product-category-tag {
    display: none !important;
}

/* Đồng bộ thẻ ảnh sản phẩm: Tỷ lệ 4:3, can giữa, nền xám nhạt */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--hyva-radius-sm) var(--hyva-radius-sm) 0 0;
}
.product-image-wrapper img.p7-product-thumb,
.product-image-wrapper img.p7-hover-image,
.product-image-wrapper img.attachment-woocommerce_thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px; /* Tránh ảnh chạm lề */
    background-color: transparent;
}

/* Mỏng hoá thanh Toolbar (Sorting + Products count) */
.woocommerce-before-shop-loop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hyva-border);
}
.woocommerce-result-count {
    font-size: 14px;
    color: var(--hyva-text-light);
    margin: 0;
}
.woocommerce-ordering select {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 32px 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hyva-text);
    background-color: transparent;
    border: 1px solid var(--hyva-border);
    border-radius: 20px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
}
.woocommerce-ordering select:focus {
    outline: none;
    border-color: var(--hyva-primary);
}

/* 9.2 Trải nghiệm Mobile */
@media (max-width: 768px) {
    /* Đưa Grid sản phẩm về 2 cột */
    ul.products, 
    .woocommerce ul.products {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .woocommerce ul.products li.product, 
    .woocommerce-page ul.products li.product {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Thu gọn Padding thẻ card tren Mobile để lấy diện tích hiển thị */
    .p7-card .product-info {
        padding: 12px 8px;
    }
    .woocommerce-loop-product__title {
        font-size: 13px !important;
    }
    .price-contact {
        font-size: 12px !important;
    }
    .product-image-wrapper img.attachment-woocommerce_thumbnail {
        padding: 10px;
    }
    
    /* Off-canvas Sidebar Mobile */
    /* 1. Mặc định ẩn sidebar trên mobile */
    .woocommerce-sidebar,
    #secondary,
    aside.sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        max-width: 90vw;
        height: 100vh;
        background: #fff;
        z-index: 999999;
        overflow-y: auto;
        padding: 24px;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
    }
    
    /* Class này sẽ được toggle qua file JS */
    body.offcanvas-open .woocommerce-sidebar,
    body.offcanvas-open #secondary,
    body.offcanvas-open aside.sidebar {
        left: 0;
    }
    
    /* Lớp overlay đen khi mở off-canvas */
    .p7-offcanvas-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }
    body.offcanvas-open .p7-offcanvas-overlay {
        opacity: 1;
        visibility: visible;
    }
    
    /* Z-index fix cho Cookie và Sticky CTA */
    /* Sticky CTA có z-index: 900, do đó widget nào đè lên phải chỉnh lại */
    #cookie-law-info-bar { /* Ví dụ class mặc định plugin cookie */
        z-index: 899 !important;
    }
}

/* Nút mở Off-canvas Filter trên Mobile */
.p7-filter-toggle-btn {
    display: none; /* Ẩn trên desktop */
}

@media (max-width: 768px) {
    .p7-filter-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        background: var(--hyva-bg-subtle, #f0f2f5);
        border: 1px solid var(--hyva-border, #e5e7eb);
        border-radius: 20px;
        font-size: 14px;
        font-weight: 600;
        color: var(--hyva-text);
        cursor: pointer;
        margin-right: 12px;
    }
    
    .woocommerce-before-shop-loop {
        justify-content: flex-start;
    }
    .woocommerce-result-count {
        display: none; /* Ẩn bớt để có chỗ cho nút Filter */
    }
}

/* 9.3 Tối ưu PDP Right Column */
.single-product .summary.entry-summary {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

/* Fix store-sidebar inline styles on mobile */
@media (max-width: 768px) {
    .store-sidebar,
    .woocommerce-sidebar,
    #secondary,
    aside.sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 300px !important;
        max-width: 90vw !important;
        height: 100vh !important;
        background: #fff !important;
        z-index: 999999 !important;
        overflow-y: auto !important;
        padding: 24px !important;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15) !important;
        transition: left 0.3s ease !important;
        display: block !important;
    }
    
    body.offcanvas-open .store-sidebar,
    body.offcanvas-open .woocommerce-sidebar,
    body.offcanvas-open #secondary,
    body.offcanvas-open aside.sidebar {
        left: 0 !important;
    }
    
    .store-container {
        flex-direction: column;
    }
    
    .p7-filter-toggle-btn {
        display: inline-flex !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANE PRODUCT TYPE ARCHITECTURE — Custom CSS
   Lanes B + C + D + E
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Thông số kỹ thuật (Tech Specs Tab) ──────────────────────────── */
.ane-tech-specs-wrapper {
    padding: 8px 0;
}
.ane-spec-group-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-primary, #0F4C8A);
    margin: 20px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--color-primary, #0F4C8A);
}
.ane-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.ane-specs-table tr {
    border-bottom: 1px solid #eef0f4;
}
.ane-specs-table tr:last-child { border-bottom: none; }
.ane-specs-table th.ane-spec-key,
.ane-specs-table .ane-spec-row-label {
    padding: 10px 16px 10px 0;
    font-weight: 600;
    color: #374151;
    width: 38%;
    vertical-align: top;
    text-align: left;
    background: transparent;
}
.ane-specs-table td.ane-spec-value,
.ane-specs-table td {
    padding: 10px 0;
    color: #1f2937;
    vertical-align: top;
}
.ane-spec-unit {
    color: #6b7280;
    font-size: 12px;
    margin-left: 4px;
}

/* Cert badges */
.ane-cert-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
    margin-right: 6px;
}

/* ── Spec Group Comparison Table (Tab "So sánh trong nhóm") ─────── */
.ane-spec-group-table-wrapper {
    padding: 8px 0;
}
.ane-spec-group-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ane-spec-group-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 13px;
}
.ane-spec-group-table thead th {
    background: #f8f9fc;
    padding: 12px 16px;
    text-align: center;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: bottom;
    line-height: 1.3;
    font-size: 12px;
}
.ane-spec-group-table thead th img {
    display: block;
    margin: 0 auto 6px;
    width: 60px;
    height: 45px;
    object-fit: contain;
}
.ane-spec-group-table thead th a {
    color: var(--color-primary, #0F4C8A);
    text-decoration: none;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}
.ane-spec-group-table tbody th.ane-spec-row-label {
    padding: 9px 16px 9px 0;
    font-weight: 600;
    color: #374151;
    background: #fafbfc;
    white-space: nowrap;
    border-right: 1px solid #e2e8f0;
    font-size: 13px;
    width: 30%;
}
.ane-spec-group-table tbody td {
    padding: 9px 16px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #1f2937;
}
.ane-spec-group-table tbody tr:hover td,
.ane-spec-group-table tbody tr:hover th {
    background: #f0f4ff;
}
/* Highlight current product column */
.ane-spec-col-current {
    background: rgba(15,76,138,.05) !important;
    border-left: 2px solid var(--color-primary, #0F4C8A) !important;
    border-right: 2px solid var(--color-primary, #0F4C8A) !important;
}
thead .ane-spec-col-current { border-top: 2px solid var(--color-primary, #0F4C8A) !important; }
.ane-current-badge {
    display: inline-block;
    background: var(--color-primary, #0F4C8A);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 4px;
}

/* ── Medicament Tabs ─────────────────────────────────────────────── */
.ane-medicament-usage,
.ane-storage-info {
    padding: 4px 0;
}
.ane-usage-content p { line-height: 1.8; color: #374151; }
.ane-download-ifu {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 16px;
    background: #f0f4ff;
    border: 1px solid #c7d7f8;
    border-radius: 6px;
    color: var(--color-primary, #0F4C8A);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.ane-download-ifu:hover { background: #dde9ff; }

/* ── Media Tab (Video & Tài liệu) ────────────────────────────────── */
.ane-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 12px;
}
.ane-video-item iframe { width: 100%; border-radius: 6px; }
.ane-video-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-top: 8px;
}
.ane-docs-list { list-style: none; padding: 0; margin: 12px 0 0; }
.ane-docs-list li { margin-bottom: 8px; }
.ane-docs-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    color: #1f2937;
    font-size: 13px;
    transition: background .2s;
}
.ane-docs-list a:hover { background: #f0f4ff; }
.ane-doc-type-badge {
    background: var(--color-primary, #0F4C8A);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}
.ane-doc-download-icon { margin-left: auto; color: #9ca3af; }

/* ── Bundle & Compatibility Sections ─────────────────────────────── */
.ane-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-navy, #1a2a4a);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ane-bundle-disc-badge {
    background: var(--color-accent, #e05c2c);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 20px;
}

/* Compatibility grid */
.ane-compatibility-section { padding: 24px 0; }
.ane-compat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.ane-compat-card {
    position: relative;
    display: block;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    transition: all .2s;
    text-align: center;
}
.ane-compat-card:hover {
    border-color: var(--color-primary, #0F4C8A);
    box-shadow: 0 4px 12px rgba(15,76,138,.12);
    transform: translateY(-2px);
}
.ane-compat-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.ane-compat-badge--required    { background: #fee2e2; color: #dc2626; }
.ane-compat-badge--recommended { background: #dbeafe; color: #1d4ed8; }
.ane-compat-badge--optional    { background: #f3f4f6; color: #6b7280; }
.ane-compat-img { margin: 10px auto 8px; max-height: 80px; }
.ane-compat-img img { width: 100%; height: 80px; object-fit: contain; }
.ane-compat-name {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin: 0 0 4px;
}
.ane-compat-note {
    font-size: 11px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.3;
}

/* Bundle suggestion block */
.ane-bundle-suggestion {
    background: linear-gradient(135deg, #fffbf0, #fef3e2);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}
.ane-bundle-name {
    color: #92400e;
    font-size: 13px;
    margin: -8px 0 16px;
}
.ane-bundle-items {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.ane-bundle-plus {
    font-size: 20px;
    font-weight: 700;
    color: #92400e;
}
.ane-bundle-item {
    text-align: center;
    padding: 10px;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 8px;
    min-width: 90px;
    flex: 0 0 auto;
}
.ane-bundle-item--current {
    border-color: var(--color-primary, #0F4C8A);
    border-width: 2px;
}
.ane-bundle-item img { width: 70px; height: 55px; object-fit: contain; }
.ane-bundle-item-name { font-size: 10px; color: #374151; margin: 4px 0 0; line-height: 1.3; }
.ane-bundle-qty { font-size: 11px; font-weight: 700; color: #92400e; }
.ane-bundle-pricing {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ane-bundle-original {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 15px;
}
.ane-bundle-final {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-primary, #0F4C8A);
}
.ane-bundle-save {
    background: #d1fae5;
    color: #065f46;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.ane-bundle-btn {
    background: var(--color-accent, #e05c2c) !important;
    color: #fff !important;
    font-weight: 700;
    border: none !important;
    padding: 12px 24px;
    border-radius: 6px;
    transition: background .2s;
}
.ane-bundle-btn:hover { background: #c44e22 !important; }

/* Bundle content (khi xem bundle PDP) */
.ane-bundle-content { padding: 24px 0; }
.ane-bundle-items-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.ane-bundle-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.ane-bundle-list-item img { width: 80px; height: 60px; object-fit: contain; flex-shrink: 0; }
.ane-bundle-list-item a {
    color: var(--color-primary, #0F4C8A);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

/* ── Responsive adjustments ──────────────────────────────────────── */
@media (max-width: 768px) {
    .ane-compat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ane-bundle-items { gap: 8px; }
    .ane-bundle-item { min-width: 80px; }
    .ane-videos-grid { grid-template-columns: 1fr; }
    .ane-specs-table th.ane-spec-key,
    .ane-specs-table .ane-spec-row-label { width: 45%; }
}
