/**
 * VNF Collection Sections — namespaced under .vnf-coll* to avoid Kadence collisions.
 * Accent: #7B2D8E (live Shopify purple) — match PDP plugin polish.
 */

.vnf-coll {
  --vnf-purple: #7b2d8e;
  --vnf-purple-dark: #5e1f6e;
  --vnf-purple-soft: #f5eaf8;
  --vnf-gray-bg: #f4f4f6;
  --vnf-gray-border: #e4e4e8;
  --vnf-text: #1a1a1a;
  --vnf-muted: #5c5c66;
  --vnf-radius: 12px;
  --vnf-radius-sm: 8px;
  box-sizing: border-box;
  color: var(--vnf-text);
  font-size: 1rem;
  line-height: 1.5;
}

.vnf-coll *,
.vnf-coll *::before,
.vnf-coll *::after {
  box-sizing: border-box;
}

.vnf-coll-section-title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--vnf-text);
}

/* Hide duplicate archive H1 when brand hero provides the title */
body.vnf-coll-brand .woocommerce-products-header__title,
body.vnf-coll-brand .page-title,
body.vnf-coll-brand .woocommerce-products-header .entry-title,
body.vnf-coll-brand h1.kadence-title-title,
body.vnf-coll-brand .woo-archive-title,
body.vnf-coll-brand .product-category-title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Hero ---------- */
.vnf-coll-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin: 0 0 1.75rem;
  padding: 2.5rem 1.25rem;
  background-color: var(--vnf-purple-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--vnf-radius);
  overflow: hidden;
  color: #fff;
  text-align: center;
}

.vnf-coll-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 10, 32, 0.45) 0%,
    rgba(26, 10, 32, 0.62) 100%
  );
  pointer-events: none;
}

.vnf-coll-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 52rem;
  margin: 0 auto;
}

.vnf-coll-hero__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.vnf-coll-hero__text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.vnf-coll-hero__text p {
  margin: 0 0 0.65rem;
}

.vnf-coll-hero__text p:last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .vnf-coll-hero {
    min-height: 280px;
    padding: 3.25rem 2rem;
  }
}

/* ---------- After-loop stack ---------- */
.vnf-coll-after {
  margin: 2.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  clear: both;
}

/* ---------- SEO HTML block ---------- */
.vnf-coll-seo__content {
  max-width: 100%;
}

.vnf-coll-seo__content > *:first-child {
  margin-top: 0;
}

.vnf-coll-seo__content h2,
.vnf-coll-seo__content h3 {
  color: var(--vnf-text);
  margin-top: 1.75rem;
}

.vnf-coll-seo__content a {
  color: var(--vnf-purple);
  font-weight: 600;
}

.vnf-coll-seo__content a:hover,
.vnf-coll-seo__content a:focus-visible {
  color: var(--vnf-purple-dark);
}

.vnf-coll-seo__content table,
.vnf-coll-seo__content .vnf-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

.vnf-coll-seo__content th,
.vnf-coll-seo__content td {
  border: 1px solid var(--vnf-gray-border);
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.vnf-coll-seo__content th {
  background: var(--vnf-purple-soft);
  color: var(--vnf-purple-dark);
  font-weight: 700;
}

.vnf-coll-seo__content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--vnf-radius-sm);
}

/* ---------- FAQ accordion (parity with PDP) ---------- */
.vnf-coll-faq__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--vnf-gray-border);
  border-radius: var(--vnf-radius);
  overflow: hidden;
  background: #fff;
}

.vnf-coll-faq__item + .vnf-coll-faq__item {
  border-top: 1px solid var(--vnf-gray-border);
}

.vnf-coll-faq__question {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1.15rem;
  background: #fff;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-weight: 650;
  color: var(--vnf-text);
  transition: background 0.15s ease;
}

.vnf-coll-faq__question:hover,
.vnf-coll-faq__question:focus-visible {
  background: var(--vnf-purple-soft);
  outline: none;
}

.vnf-coll-faq__question[aria-expanded="true"] {
  background: var(--vnf-purple-soft);
  color: var(--vnf-purple-dark);
}

.vnf-coll-faq__q-text {
  flex: 1 1 auto;
}

.vnf-coll-faq__icon {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  position: relative;
}

.vnf-coll-faq__icon::before,
.vnf-coll-faq__icon::after {
  content: "";
  position: absolute;
  background: var(--vnf-purple);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.vnf-coll-faq__icon::before {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
}

.vnf-coll-faq__icon::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
}

.vnf-coll-faq__question[aria-expanded="true"] .vnf-coll-faq__icon::after {
  opacity: 0;
  transform: translateX(-50%) rotate(90deg);
}

.vnf-coll-faq__answer {
  background: #fff;
}

.vnf-coll-faq__answer-inner {
  padding: 0 1.15rem 1.1rem;
  color: var(--vnf-muted);
  font-size: 0.95rem;
}

.vnf-coll-faq__answer-inner p:first-child {
  margin-top: 0;
}

.vnf-coll-faq__answer-inner p:last-child {
  margin-bottom: 0;
}

/* ---------- Trust bar ---------- */
.vnf-coll-trust {
  margin: 0;
  padding: 1.25rem 1rem;
  background: linear-gradient(135deg, var(--vnf-purple) 0%, var(--vnf-purple-dark) 100%);
  border-radius: var(--vnf-radius);
  color: #fff;
  box-shadow: 0 4px 14px rgba(123, 45, 142, 0.25);
}

.vnf-coll-trust__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 0.75rem;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .vnf-coll-trust__inner {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.vnf-coll-trust__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  padding: 0.35rem;
}

.vnf-coll-trust__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  position: relative;
}

.vnf-coll-trust__icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.55rem;
  height: 0.9rem;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-10%) rotate(45deg);
}

.vnf-coll-trust__label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

/* ---------- Mobile product grid (VNF) ---------- */
/* 2 columns on phones; keep Select options / Add to cart in-frame (no hover-only CTAs). */
@media (max-width: 767px) {
  body.tax-product_cat ul.products,
  body.tax-product_cat ul.products.content-wrap {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem 0.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.tax-product_cat ul.products li.product,
  body.tax-product_cat ul.products li.entry.product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
  }

  body.tax-product_cat ul.products li.product .woocommerce-loop-image-link,
  body.tax-product_cat ul.products li.product img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  body.tax-product_cat ul.products li.product .product-details,
  body.tax-product_cat ul.products li.product .entry-content-wrap {
    padding: 0.4rem 0.35rem 0.5rem !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.25rem;
  }

  body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
  body.tax-product_cat ul.products li.product .woocommerce-loop-product__title_ink {
    font-size: 0.72rem !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  body.tax-product_cat ul.products li.product .price {
    font-size: 0.78rem !important;
    margin: 0 !important;
  }

  body.tax-product_cat ul.products li.product .product-excerpt {
    display: none !important;
  }

  /* Always show CTA on touch — hover-only hides "Select options" off-screen */
  body.tax-product_cat.woo-archive-action-on-hover ul.products li.product .product-action-wrap,
  body.tax-product_cat ul.products.woo-archive-action-on-hover li.product .product-action-wrap,
  body.tax-product_cat ul.products li.product .product-action-wrap {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    margin-top: auto !important;
    padding-top: 0.25rem !important;
  }

  body.tax-product_cat ul.products li.product .product-action-wrap .button,
  body.tax-product_cat ul.products li.product a.button {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 0.68rem !important;
    line-height: 1.2 !important;
    padding: 0.45rem 0.35rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 2rem !important;
    justify-content: center !important;
  }

  body.tax-product_cat ul.products li.product .product-action-wrap .kadence-svg-iconset {
    display: none !important; /* arrow icon crowds the label on narrow cards */
  }
}

