/*
 * Royal Vision Traders - shared product card.
 *
 * These rules were inline in rvt-best-sellers.php. They moved here so the
 * shop archive can render the same cards through rvt_best_sellers_card()
 * without a second copy of the styling.
 *
 * Loaded by rvt-product-card.php wherever the cards appear.
 */
.rvt-bestsellers {
  --rvt-bg: #FBF3EC;
  --rvt-surface: #FFFFFF;
  --rvt-ink: #1A1A1A;
  --rvt-muted: #6E6A66;
  --rvt-accent: #2FA9A0;
  --rvt-accent-hover: #238C85;
  --rvt-coral: #F0806F;
  --rvt-mint: #6FCFA8;
  --rvt-border: #EADFD5;
  --rvt-shadow: var(--rvt-sh, 0 8px 24px rgba(26,26,26,.06));
  --rvt-shadow-hover: 0 16px 40px rgba(26, 26, 26, 0.10);
  --rvt-font-heading: "Satoshi", "Segoe UI", system-ui, -apple-system, sans-serif;
  --rvt-font-body: "General Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  padding: 96px max(24px, calc((100% - 1240px) / 2));
  background: var(--rvt-bg);
  color: var(--rvt-ink);
  font-family: var(--rvt-font-body);
}

.rvt-bestsellers,
.rvt-bestsellers *,
.rvt-bestsellers *::before,
.rvt-bestsellers *::after {
  box-sizing: border-box;
}

.rvt-bs-head {
  max-width: 640px;
  margin: 0 0 48px;
}

.rvt-bs-eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--rvt-accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rvt-bs-head h2 {
  margin: 0;
  color: var(--rvt-ink);
  font-family: var(--rvt-font-heading);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.rvt-bs-head p {
  max-width: 65ch;
  margin: 16px 0 0;
  color: var(--rvt-muted);
  font-size: 16px;
  line-height: 1.55;
}

.rvt-bs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.rvt-bs-card {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--rvt-border);
  border-radius: 16px;
  background: var(--rvt-surface);
  box-shadow: var(--rvt-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rvt-bs-card:hover {
  box-shadow: var(--rvt-shadow-hover);
  transform: translateY(-4px);
}

.rvt-bs-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--rvt-bg);
}

.rvt-bs-media img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 12%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.rvt-bs-card:hover .rvt-bs-media img {
  transform: scale(1.04);
}

.rvt-bs-badge {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
}

.rvt-bs-badge-sale {
  left: 12px;
  background: var(--rvt-coral);
  color: #FFFFFF;
}

.rvt-bs-badge-new {
  right: 12px;
  background: var(--rvt-mint);
  color: var(--rvt-ink);
}

.rvt-bs-soldout {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 243, 236, 0.74);
  color: var(--rvt-ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  inset: 0;
}

.rvt-bs-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.rvt-bs-title {
  margin: 0;
  font-family: var(--rvt-font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.rvt-bs-title a {
  color: var(--rvt-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.rvt-bs-title a:hover,
.rvt-bs-title a:focus-visible {
  color: var(--rvt-accent);
}

.rvt-bs-rating {
  color: var(--rvt-muted);
  font-size: 12px;
}

.rvt-bs-price {
  margin-top: auto;
  padding-top: 4px;
  color: var(--rvt-ink);
  font-family: var(--rvt-font-heading);
  font-size: 17px;
  font-weight: 700;
}

.rvt-bs-price .woocommerce-Price-currencySymbol {
  color: var(--rvt-muted);
  font-size: 80%;
  letter-spacing: 0.02em;
}

.rvt-bs-price del {
  margin-right: 6px;
  color: var(--rvt-muted);
  font-size: 14px;
  font-weight: 500;
}

.rvt-bs-price ins {
  background: none;
  color: var(--rvt-ink);
  font-weight: 700;
  text-decoration: none;
}

.rvt-bs-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 11px 20px;
  border: none;
  border-radius: 999px;
  background: var(--rvt-accent);
  color: var(--rvt-ink, #1A1A1A) !important;
  cursor: pointer;
  font-family: var(--rvt-font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  transition: background-color 0.2s ease;
}

.rvt-bs-cart:hover,
.rvt-bs-cart:focus-visible {
  background: var(--rvt-accent-hover);
  color: var(--rvt-ink, #1A1A1A) !important;
}

.rvt-bs-cart.loading {
  opacity: 0.65;
  pointer-events: none;
}

.rvt-bs-card .added_to_cart {
  margin-top: 8px;
  color: var(--rvt-accent);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-decoration: underline;
}

.rvt-bs-cta {
  display: flex;
  justify-content: center;
  margin-top: 56px;
}

.rvt-bs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 34px;
  border: 1.5px solid var(--rvt-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--rvt-ink) !important;
  font-family: var(--rvt-font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.rvt-bs-button:hover,
.rvt-bs-button:focus-visible {
  background: var(--rvt-ink);
  color: var(--rvt-surface) !important;
}

.rvt-bs-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.2s ease;
}

.rvt-bs-button:hover svg {
  transform: translateX(3px);
}

.rvt-bs-button:focus-visible,
.rvt-bs-cart:focus-visible,
.rvt-bs-title a:focus-visible {
  outline: 2px solid var(--rvt-accent);
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .rvt-bestsellers {
    padding: 72px 24px;
  }

  .rvt-bs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 767px) {
  .rvt-bestsellers {
    padding: 56px 16px;
  }

  .rvt-bs-head {
    margin-bottom: 32px;
  }

  .rvt-bs-head p {
    font-size: 14px;
  }

  /* Two columns keeps all eight products visible on a phone. */
  .rvt-bs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .rvt-bs-body {
    gap: 6px;
    padding: 12px;
  }

  .rvt-bs-title {
    font-size: 14px;
  }

  .rvt-bs-price {
    font-size: 15px;
  }

  .rvt-bs-price del {
    display: block;
    margin-right: 0;
    font-size: 12px;
  }

  .rvt-bs-cart {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .rvt-bs-badge {
    padding: 4px 8px;
    font-size: 10px;
  }

  .rvt-bs-cta {
    margin-top: 36px;
  }

  .rvt-bs-button {
    width: 100%;
    padding: 14px 24px;
  }
}

@media (max-width: 360px) {
  .rvt-bs-grid {
    gap: 10px;
  }

  .rvt-bs-title {
    font-size: 13px;
  }

  .rvt-bs-cart {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rvt-bs-card,
  .rvt-bs-media img,
  .rvt-bs-button,
  .rvt-bs-button svg,
  .rvt-bs-cart {
    transition: none;
  }
}
