/* Charlotte Vane Core — storefront helpers, v1.0.2 */

.cv-core-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 1280px);
  min-height: 92px;
  margin: auto;
  border-bottom: 1px solid #dfe4dc;
  padding: 0 clamp(12px, 2vw, 22px);
}

.cv-core-trust > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-width: 0;
  border-right: 1px solid #dfe4dc;
  padding: 16px;
}

.cv-core-trust > div:last-child {
  border-right: 0;
}

.cv-core-trust svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  fill: none;
  stroke: #2d5d4c;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cv-core-trust > div > span {
  min-width: 0;
}

.cv-core-trust b,
.cv-core-trust small {
  display: block;
}

.cv-core-trust b {
  color: #17211b;
  font-size: 13px;
  line-height: 1.3;
}

.cv-core-trust small {
  margin-top: 2px;
  color: #68736b;
  font-size: 11px;
  line-height: 1.35;
}

.cv-core-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.cv-core-categories > a {
  position: relative;
  height: 420px;
  min-width: 0;
  overflow: hidden;
  background: #f3f5f1;
}

.cv-core-categories img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

@media (hover: hover) {
  .cv-core-categories > a:hover img {
    transform: scale(1.025);
  }
}

.cv-core-categories > a::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(15, 23, 18, 0.78));
}

.cv-core-categories span {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 22px;
  left: 24px;
  color: #fff;
}

.cv-core-categories b,
.cv-core-categories small,
.cv-core-categories em {
  display: block;
}

.cv-core-categories b {
  font: 500 27px / 1.2 Lora, Georgia, serif;
}

.cv-core-categories small {
  margin: 4px 0 12px;
  opacity: 0.82;
}

.cv-core-categories em {
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.cv-saved-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.cv-saved-card {
  min-width: 0;
  background: #f3f5f1;
}

.cv-saved-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.cv-saved-card > div {
  padding: 15px;
}

.cv-saved-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.cv-saved-card .price {
  font-weight: 800;
}

.cv-saved-empty {
  background: #f3f5f1;
  padding: 70px 20px;
  text-align: center;
}

@media (max-width: 1000px) {
  .cv-core-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cv-saved-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .cv-core-trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    padding: 8px;
  }

  .cv-core-trust > div {
    justify-content: flex-start;
    gap: 10px;
    border: 0;
    padding: 12px 8px;
  }

  .cv-core-trust svg {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .cv-core-trust b {
    font-size: 12px;
  }

  .cv-core-trust small {
    font-size: 10px;
  }

  .cv-core-categories {
    display: flex;
    gap: 12px;
    margin-right: -16px;
    margin-left: -2px;
    padding: 0 16px 8px 2px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .cv-core-categories > a {
    flex: 0 0 min(82vw, 350px);
    height: min(105vw, 420px);
    scroll-snap-align: start;
  }

  .cv-saved-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .cv-core-trust {
    grid-template-columns: 1fr;
  }

  .cv-core-trust > div {
    border-bottom: 1px solid #e7ebe5;
  }

  .cv-core-trust > div:last-child {
    border-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   1.0.3 premium sync with theme 1.3.0
   -------------------------------------------------------------------------- */
.cv-core-trust {
  margin-top: 22px;
  border: 1px solid #e2e7e0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 26, 20, 0.05);
  padding-top: 6px;
  padding-bottom: 6px;
}

.cv-core-trust svg {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #f3f5f1;
  padding: 8px;
}

.cv-core-categories > a {
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(16, 26, 20, 0.1);
  transition: box-shadow 0.28s ease, transform 0.28s ease;
}

@media (hover: hover) {
  .cv-core-categories > a:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 44px rgba(16, 26, 20, 0.16);
  }
}

.cv-core-categories em {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
}

.cv-saved-grid {
  gap: 22px;
}

.cv-saved-card {
  overflow: hidden;
  border: 1px solid #e6eae4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 26, 20, 0.06);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
  .cv-saved-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(16, 26, 20, 0.12);
  }
}

.cv-saved-card > div {
  padding: 17px;
}

.cv-saved-card h3 a {
  color: inherit;
  text-decoration: none;
}

.cv-saved-empty {
  border: 1px dashed #d4dbd2;
  border-radius: 12px;
  background: #f7f8f5;
}

@media (max-width: 760px) {
  .cv-core-trust {
    border-radius: 12px;
    padding: 6px;
  }

  .cv-core-trust svg {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    padding: 7px;
  }

  .cv-core-categories > a {
    border-radius: 10px;
  }
}

/* --------------------------------------------------------------------------
   1.0.6 — trust cards behave like the product-page confidence cards
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .cv-core-trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    margin-top: 14px;
    padding: 0;
  }

  .cv-core-trust > div,
  .cv-core-trust > div:last-child {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 92px;
    border: 1px solid #e2e7e0;
    border-radius: 10px;
    background: #fff;
    padding: 12px 10px;
    text-align: center;
  }

  .cv-core-trust svg {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    padding: 6px;
  }

  .cv-core-trust > div > span,
  .cv-core-trust b,
  .cv-core-trust small {
    text-align: center;
  }
}

@media (max-width: 420px) {
  .cv-core-trust,
  .cv-core-trust > div,
  .cv-core-trust > div:last-child {
    /* keep the 2-column card layout all the way down — matches the store */
    border: 1px solid #e2e7e0;
  }

  .cv-core-trust {
    border: 0;
  }
}

/* --------------------------------------------------------------------------
   1.0.8 — categories: bulletproof 2x2 compact grid on tablets and phones
   (Scroll mechanics kept failing on real devices; a compact grid is always
   fully visible and never depends on overflow behaviour.)
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .cv-core-categories {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .cv-core-categories > a {
    flex: none;
    width: auto !important;
    max-width: none;
    height: min(48vw, 230px) !important;
    border-radius: 12px;
  }

  .cv-core-categories > a::after {
    inset: 35% 0 0;
  }

  .cv-core-categories > a span {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .cv-core-categories b {
    font-size: 19px;
  }

  .cv-core-categories small {
    margin: 2px 0 8px;
    font-size: 11px;
  }

  .cv-core-categories em {
    font-size: 11px;
  }
}
