/**
 * APS Single Product Shortcode — 4 Card Styles
 * modern | minimal | hero | classic
 * All cards always white. No hover animations.
 */

/* Fix: .aps-btn-iconic (Compare button) uses position:absolute; right:5px; bottom:0
   It needs a position:relative ancestor to anchor correctly — restored from OG */
.mf-main-features {
  position: relative;
}

/* ── Shared base ───────────────────────────────────────────────────────────── */
.mf-sc {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin: 16px 0;
  background: #fff;
  color: #374151;
  font-family: inherit;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
/* Always white — even in dark mode */
[data-scheme="dark"] .mf-sc,
.cs-dark .mf-sc {
  background: #fff;
  color: #374151;
  border-color: #e5e7eb;
}

.mf-sc__cover-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.mf-sc__actions,
.aps-add-compare {
  z-index: 2;
}

/* ── Shared: title ─────────────────────────────────────────────────────────── */
.mf-sc__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #111827 !important;
  margin: 0 0 10px !important;
}
/* Force title black in dark mode for all styles */
[data-scheme="dark"] .mf-sc .mf-sc__title,
.cs-dark .mf-sc .mf-sc__title {
  color: #111827 !important;
}

/* ── Shared: price ─────────────────────────────────────────────────────────── */
.mf-sc__price-current {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--cs-light-accent-color, #16a34a);
}
.mf-sc__price-old {
  font-size: 0.85rem;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 400;
}

/* ── Shared: badges ────────────────────────────────────────────────────────── */
.mf-sc__badge--sale {
  display: inline-flex;
  align-items: center;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.mf-sc__badge--sale-sm {
  display: inline-flex;
  align-items: center;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Shared: buttons ───────────────────────────────────────────────────────── */
.mf-sc__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.mf-sc__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.mf-sc__btn--primary {
  background: var(--cs-light-accent-color, #16a34a);
  color: #fff !important;
  border-color: var(--cs-light-accent-color, #16a34a);
}
.mf-sc__btn--outline {
  background: transparent;
  color: #111827 !important;
  border-color: #d1d5db;
}
.mf-sc__btn--outline.aps-in-compare {
  background: var(--cs-light-accent-color, #16a34a);
  color: #fff !important;
  border-color: var(--cs-light-accent-color, #16a34a);
}

/* ── Shared: spec grid ─────────────────────────────────────────────────────── */
.mf-sc__spec-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #f3f4f6;
}
.mf-sc__spec-row {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
}
.mf-sc__spec-row:nth-child(odd) { background: #f9fafb; }
.mf-sc__spec-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-bottom: 2px;
}
.mf-sc__spec-val {
  font-size: 0.82rem;
  font-weight: 500;
  color: #111827;
}
/* Always white in dark mode */
[data-scheme="dark"] .mf-sc__spec-row,
.cs-dark .mf-sc__spec-row { background: #fff; }
[data-scheme="dark"] .mf-sc__spec-row:nth-child(odd),
.cs-dark .mf-sc__spec-row:nth-child(odd) { background: #f9fafb; }
[data-scheme="dark"] .mf-sc__spec-val,
.cs-dark .mf-sc__spec-val { color: #111827; }

@media (max-width: 600px) {
  .mf-sc__spec-table { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .mf-sc__spec-table { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   MODERN — image left, info right, 4 chips, no spec table below
   ══════════════════════════════════════════════════════════════════════════════ */
.mf-sc__mod-layout {
  display: flex;
  align-items: stretch;
  min-height: 200px;
}

/* Image column — always white */
.mf-sc__mod-img-col {
  position: relative;
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #f3f4f6;
  overflow: hidden;
  padding: 12px;
  aspect-ratio: 1 / 1;
}
.mf-sc__mod-img-col img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.mf-sc__mod-img-col .mf-sc__badge--sale {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

/* Info column */
.mf-sc__mod-info {
  flex: 1;
  padding: 20px 20px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mf-sc__mod-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* Spec chips */
.mf-sc__mod-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
  flex: 1;
}
.mf-sc__mod-chip {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mf-sc__mod-chip-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cs-light-accent-color, #16a34a);
}
.mf-sc__mod-chip-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 540px) {
  .mf-sc__mod-layout { flex-direction: column; }
  .mf-sc__mod-img-col {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid #f3f4f6;
  }
  .mf-sc__mod-chip-val {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}
@media (max-width: 380px) {
  .mf-sc__mod-chips { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   MINIMAL — white left panel + dotted spec list
   ══════════════════════════════════════════════════════════════════════════════ */
.mf-sc__min-wrap {
  display: flex;
  align-items: stretch;
}

/* Left white panel */
.mf-sc__min-panel {
  width: 150px;
  flex-shrink: 0;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  gap: 12px;
}
.mf-sc__min-img-wrap {
  width: 110px;
  height: 110px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}
.mf-sc__min-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mf-sc__min-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.mf-sc__min-price-main {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}
.mf-sc__min-price-old {
  font-size: 0.7rem;
  color: #9ca3af;
  text-decoration: line-through;
}

/* Right content */
.mf-sc__min-content {
  flex: 1;
  padding: 18px 18px 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mf-sc--minimal .mf-sc__title { font-size: 0.98rem; }

/* Dotted feature list — override theme ul padding */
.mf-sc__min-feats {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 4px !important;
  flex: 1;
}
.mf-sc__min-feats li {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.8rem;
  min-width: 0;
}
.mf-sc__min-feat-name {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  flex-shrink: 0;
}
.mf-sc__min-feat-dots {
  flex: 1;
  border-bottom: 2px dotted #d1d5db;
  margin: 0 4px 3px;
  min-width: 10px;
}
.mf-sc__min-feat-val {
  color: #6b7280;
  text-align: right;
  flex-shrink: 0;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .mf-sc__min-wrap { flex-direction: column; }
  .mf-sc__min-panel {
    width: 100%;
    flex-direction: row;
    padding: 14px 16px;
    gap: 16px;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  .mf-sc__min-img-wrap { width: 110px; height: 110px; flex-shrink: 0; }
  .mf-sc__min-price { align-items: flex-start; text-align: left; }
  .mf-sc__min-price-main { font-size: 1.1rem; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   CLASSIC — image right, zebra table, all specs always visible
   ══════════════════════════════════════════════════════════════════════════════ */
.mf-sc__cls-head {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f3f4f6;
}
.mf-sc__cls-meta {
  flex: 1;
  padding: 20px 20px 16px;
  min-width: 0;
}
.mf-sc__cls-price {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* Image col — always white, fills full height */
.mf-sc__cls-img {
  width: 180px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
  aspect-ratio: 1 / 1;
}
.mf-sc__cls-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
[data-scheme="dark"] .mf-sc__cls-img,
.cs-dark .mf-sc__cls-img { background: #fff; border-color: #f3f4f6; }
[data-scheme="dark"] .mf-sc__cls-head,
.cs-dark .mf-sc__cls-head { border-color: #f3f4f6; }

/* Spec table */
.mf-sc__cls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.mf-sc__cls-table th,
.mf-sc__cls-table td {
  padding: 9px 16px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
.mf-sc__cls-table th {
  width: 34%;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
  background: #fff;
}
.mf-sc__cls-table td {
  color: #111827;
  background: #fff;
}
.mf-sc__cls-row--even th,
.mf-sc__cls-row--even td { background: #f9fafb; }
.mf-sc__cls-table tr:last-child th,
.mf-sc__cls-table tr:last-child td { border-bottom: none; }

/* Always white in dark mode */
[data-scheme="dark"] .mf-sc__cls-table th,
[data-scheme="dark"] .mf-sc__cls-table td,
.cs-dark .mf-sc__cls-table th,
.cs-dark .mf-sc__cls-table td { color: #111827; border-color: #f3f4f6; background: #fff; }
[data-scheme="dark"] .mf-sc__cls-row--even th,
[data-scheme="dark"] .mf-sc__cls-row--even td,
.cs-dark .mf-sc__cls-row--even th,
.cs-dark .mf-sc__cls-row--even td { background: #f9fafb; }

@media (max-width: 540px) {
  .mf-sc__cls-head { flex-direction: column-reverse; }
  .mf-sc__cls-img {
    width: 100%;
    height: 180px;
    border-left: none;
    border-bottom: 1px solid #f3f4f6;
  }
  .mf-sc__cls-table th { width: 40%; white-space: normal; }
}

/* Fix: remove .aps-row negative margins around shortcode */
.aps-row:has(.mf-sc) {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
