/* ===== CMX CSS (Clean / Conflict-free / Copy-Paste) ===== */

/* ===== Scope wrapper to avoid WP conflicts ===== */
.cmx-wrap {
  --costa-red: #a6192e;
  --costa-red-dark: #821424;
  --costa-cream: #FAF8F4;
  --costa-brown: #322A26;
  --costa-gold: #D4AF37;

  --bg-primary: #F8F9FA;
  --bg-card: #FFFFFF;
  --text-main: #322A26;
  --text-muted: #6C757D;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.12);

  --font-main: 'Outfit', 'Inter', sans-serif;

  font-family: var(--font-main);
  color: var(--text-main);
}

/* ---- Minimal utility classes (scoped) ---- */
.cmx-wrap .d-flex {
  display: flex;
}

.cmx-wrap .flex-wrap {
  flex-wrap: wrap;
}

.cmx-wrap .flex-column {
  flex-direction: column;
}

.cmx-wrap .flex-grow-1 {
  flex-grow: 1;
}

.cmx-wrap .align-items-center {
  align-items: center;
}

.cmx-wrap .align-items-stretch {
  align-items: stretch;
}

.cmx-wrap .justify-content-between {
  justify-content: space-between;
}

.cmx-wrap .gap-1 {
  gap: 6px;
}

.cmx-wrap .gap-2 {
  gap: 10px;
}

.cmx-wrap .gap-3 {
  gap: 14px;
}

.cmx-wrap .gap-4 {
  gap: 24px;
}

.cmx-wrap .mt-2 {
  margin-top: 10px;
}

.cmx-wrap .mt-3 {
  margin-top: 16px;
}

.cmx-wrap .mt-4 {
  margin-top: 24px;
}

.cmx-wrap .mb-0 {
  margin-bottom: 0;
}

.cmx-wrap .mb-1 {
  margin-bottom: 6px;
}

.cmx-wrap .mb-3 {
  margin-bottom: 16px;
}

.cmx-wrap .pt-0 {
  padding-top: 0;
}

.cmx-wrap .pt-3 {
  padding-top: 16px;
}

.cmx-wrap .pt-4 {
  padding-top: 24px;
}

.cmx-wrap .p-4 {
  padding: 24px;
}

.cmx-wrap .border-top {
  border-top: 1px solid rgba(0, 0, 0, .08);
}

.cmx-wrap .text-muted {
  color: var(--text-muted);
}

.cmx-wrap .text-danger {
  color: var(--costa-red);
}

.cmx-wrap .fw-bold {
  font-weight: 800;
}

.cmx-wrap .small {
  font-size: 12px;
}

.cmx-wrap .overflow-auto {
  overflow: auto;
}

.cmx-wrap .table-responsive {
  width: 100%;
  overflow: auto;
}

/* NOTE:
   We intentionally DO NOT provide .h-100 = height:100%.
   That utility is the main source of height conflicts on WP/Kadence.
*/

/* Alerts */
.cmx-wrap .cmx-alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
}

.cmx-wrap .cmx-alert-warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.cmx-wrap .cmx-alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.cmx-wrap .cmx-muted {
  color: var(--text-muted);
}

.cmx-wrap .cmx-small {
  font-size: 12px;
}

/* ===== Product Card (Modern v3) ===== */
.cmx-wrap .product-card.cmx {
  margin-top: 20px;
}

.cmx-wrap .cmx-shell {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Top row: do NOT stretch heights */
.cmx-wrap .cmx-top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  /* key: no forced equal heights */
}

.cmx-wrap .cmx-media-panel {
  flex: 0 0 420px;
  /* fixed width */
  max-width: 420px;
}

/* Vertically center the left image block relative to nutrition panel */
.cmx-wrap .cmx-media-panel {
  display: flex;
  align-items: center;
  /* ✅ vertical center */
}

/* ===== Square image (1:1) ===== */
.cmx-wrap .cmx-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* ✅ always square */
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #111;
  box-shadow: var(--shadow-lg);
}

/* Image fills the square */
.cmx-wrap .cmx-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.cmx-wrap .cmx-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #111, #333);
}

.cmx-wrap .cmx-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .4) 40%, transparent 70%);
}

/* Text overlay */
.cmx-wrap .cmx-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
  color: #fff;
}

.cmx-wrap .cmx-breadcrumb {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .8;
  margin-bottom: 8px;
}

.cmx-wrap .cmx-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.cmx-wrap .cmx-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.cmx-wrap .cmx-headPrice {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  font-weight: 700;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
}

.cmx-wrap .cmx-badges {
  display: flex;
  gap: 8px;
}

.cmx-wrap .cmx-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .1);
}

/* ===== Card ===== */
.cmx-wrap .cmx-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.cmx-wrap .cmx-cardHead {
  padding: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

summary .cmx-cardTitle {
  font-size: 20px;
  font-weight: 800;
  color: white;
}


.cmx-wrap .cmx-mini {
  font-size: 13px;
  color: white;
  margin-top: 4px;
}

/* Details */
.cmx-wrap .cmx-details {
  cursor: pointer;
}

.cmx-wrap .cmx-details-summary {
  list-style: none;
  outline: none;
  background: #6b1831;
  color: white;
}

.cmx-wrap .cmx-details-summary::-webkit-details-marker {
  display: none;
}

.cmx-wrap .cmx-details-chevron {
  transition: transform .3s ease;
  color: white;
}

.cmx-wrap details[open] .cmx-details-chevron {
  transform: rotate(180deg);
}

.cmx-wrap .cmx-icon-circle {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--costa-red);
  border: 1px solid rgba(0, 0, 0, .08);
}

/* Options */
.cmx-wrap .cmx-opt-label {
  font-weight: 800;
  font-size: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cmx-wrap .cmx-opt-label .material-symbols-outlined {
  color: var(--costa-red);
  font-size: 20px;
}

.cmx-wrap .cmx-opt-group {
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.cmx-wrap .cmx-opt-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cmx-wrap .cmx-chips,
.cmx-wrap .cm-cardGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
}

.cmx-wrap .cm-cardGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding-top: 0;
}

.cmx-wrap .cmx-chip,
.cmx-wrap .cm-optionCard {
  border: 2px solid #f0f0f0;
  background: #fff;
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 100px;
  justify-content: center;
  color: grey;
}

.cmx-wrap .cmx-chip:hover,
.cmx-wrap .cm-optionCard:hover {
  border-color: #e0e0e0;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cmx-wrap .cmx-chip.is-active,
.cmx-wrap .cm-optionCard.is-active,
.cmx-wrap .var-card.is-active {
  border-color: var(--costa-red);
  background: rgba(166, 25, 46, 0.04);
  color: var(--costa-red);
  box-shadow: 0 4px 12px rgba(166, 25, 46, 0.1);
}

.cmx-wrap .cm-optionCard-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmx-wrap .cm-ic {
  font-size: 20px;
  opacity: .7;
}

.cmx-wrap .cm-optionCard.is-active .cm-ic {
  opacity: 1;
}

/* Nutrition area */
.cmx-wrap .nutrition-wrap {
  padding: 24px;
}

/* Table */
.cmx-wrap .nutrition-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #eee;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .02);
}

.cmx-wrap .nutrition-table th {
  background: #fdfdfd;
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #f8f8f8;
}

.cmx-wrap .nutrition-table td {
  padding: 4px 8px;
  font-size: 14px;
  border-bottom: 1px solid #f9f9f9;
  color: var(--text-main);
  transition: background .2s ease;
  text-align: center;
}

.cmx-wrap .nutrition-table td:first-child {
  text-align: left;
}

.cmx-wrap .nutrition-table tr:hover td {
  background: #fafafa;
}

.cmx-wrap .nutrition-table tr:last-child td {
  border-bottom: none;
}

/* Chips / badges */
.cmx-wrap .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
  margin-bottom: 8px;
}

.cmx-wrap .chip-danger {
  background: #fee2e2;
  color: #991b1b;
}

.cmx-wrap .chip-warn {
  background: #fef3c7;
  color: #92400e;
}

.cmx-wrap .chip-muted {
  background: #f1f5f9;
  color: #475569;
}

.cmx-wrap .chip-ok {
  background: #dcfce7;
  color: #166534;
}

.cmx-wrap .mi {
  font-size: 18px;
}

.cmx-wrap .selection-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
}

/* Micro-animations */
@keyframes cmxFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cmx-wrap .product-card {
  animation: cmxFadeIn .4s ease-out;
}

/* Extra safety: if theme overrides aspect-ratio, force it */
.cmx-wrap .product-card .cmx-media {
  aspect-ratio: 1 / 1 !important;
}

/* Responsive tweaks */
@media (max-width: 991px) {
  .cmx-wrap .cmx-media-panel {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .cmx-wrap .cmx-shell {
    gap: 24px;
  }

  .cmx-wrap .cmx-top-row {
    gap: 20px;
    overflow: auto;
  }
}
  .cmx-cardHead .cmx-cardTitle {
    font-size: 20px;
    font-weight: 600;
  }
@media (max-width: 768px) {
  .cmx-wrap .cmx-meta {
    padding: 0px;
  }

  .cmx-wrap .cmx-title {
    font-size: clamp(32px, 8vw, 42px);
    line-height: 1.1;
  }

  .cmx-wrap .cmx-breadcrumb {
    font-size: 12px;
  }

  .cmx-wrap .nutrition-wrap {
    padding: 16px;
  }

  .cmx-wrap .cmx-card {
    padding: 0px;
  }

  .cmx-cardHead .cmx-cardTitle {
    font-size: 20px;
    font-weight: 600;
  }

  .cmx-wrap .cmx-icon-circle {
    width: 40px;
    height: 40px;
  }

  .cmx-wrap .cmx-opt-label {
    font-size: 14px;
  }

  .cmx-wrap .cm-cardGrid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  .cmx-wrap .cmx-meta {
    padding: 20px;
  }

  .cmx-wrap .cmx-title {
    font-size: 28px;
  }

  .cmx-wrap .cmx-headPrice {
    font-size: 20px;
    padding: 6px 12px;
  }

  .cmx-wrap .cmx-badges {
    flex-wrap: wrap;
  }

  .cmx-wrap .cmx-cardHead {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  .cmx-wrap .nutrition-price-header {
    width: 100%;
    text-align: right;
  }

  .cmx-wrap .cmx-chip,
  .cmx-wrap .cm-optionCard {
    min-width: 80px;
    font-size: 11px;
    padding: 8px 4px;
  }
}