/* ═══════════════════════════════════════
   CUOTAS MODAL – modal.css
   ═══════════════════════════════════════ */

/* ── Variables ── */
:root {
  --cm-primary:   #2563EB;
  --cm-primary-dk:#1d4ed8;
  --cm-green:     #059669;
  --cm-green-bg:  #ECFDF5;
  --cm-orange:    #EA580C;
  --cm-orange-bg: #FFF7ED;
  --cm-gray-50:   #F8FAFC;
  --cm-gray-100:  #F1F5F9;
  --cm-gray-200:  #E2E8F0;
  --cm-gray-400:  #94A3B8;
  --cm-gray-600:  #475569;
  --cm-gray-800:  #1E293B;
  --cm-radius:    14px;
  --cm-shadow:    0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
}

/* ── Trigger button ── */
.cm-trigger-wrap {
  margin: 10px 0 6px;
}
.cm-trigger-btn {
  display: inline-flex;
  align-items: center;
  background: #dd183b !important;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;   
  height: 32px !important;        
  font-size: 12px;     
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  line-height: 1;
}
.cm-trigger-btn:hover {
  background: #000;
  color: #fff;
}
.cm-trigger-btn svg {
  flex-shrink: 0;
  stroke: #fff;
  width: 14px !important;   
  height: 14px;
}

/* ── Overlay ── */
.cm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 99999;
  padding: 0;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .2s ease;
}
.cm-overlay.cm-visible {
  opacity: 1;
}
.cm-overlay[hidden] {
  display: none !important;
}

/* ── Modal panel ── */
.cm-modal {
  background: #fff;
  width: 100%;
  max-width: 520px;
  border-radius: var(--cm-radius) var(--cm-radius) 0 0;
  box-shadow: var(--cm-shadow);
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  transition: transform .3s cubic-bezier(.34,1.2,.64,1);
  overscroll-behavior: contain;
}
.cm-overlay.cm-visible .cm-modal {
  transform: translateY(0);
}

/* Desktop: centrado y con bordes redondeados completos */
@media (min-width: 600px) {
  .cm-overlay {
    align-items: center;
    padding: 20px;
  }
  .cm-modal {
    border-radius: var(--cm-radius);
    max-height: 88vh;
    transform: translateY(16px) scale(.98);
  }
  .cm-overlay.cm-visible .cm-modal {
    transform: translateY(0) scale(1);
  }
}

/* ── Header ── */
.cm-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--cm-gray-200);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.cm-modal__header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--cm-gray-800);
}
.cm-modal__close {
  border: none;
  border-radius: 50%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--cm-gray-600);
  flex-shrink: 0;
  transition: background .15s;
}
.cm-modal__close:hover { background: var(--cm-gray-200); }

/* ── Price banner ── */
.cm-modal__price-banner {
  background: var(--cm-gray-50);
  border-bottom: 1px solid var(--cm-gray-200);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cm-price-info {
  display: flex;
  flex-direction: column;
}
.cm-price-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--cm-gray-400);
  font-weight: 500;
}
.cm-price-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--cm-gray-800);
  line-height: 1.2;
}
.cm-price-value .woocommerce-Price-amount { font-size: inherit; }

.cm-price-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.cm-method-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.cm-pill--transfer { background:#EFF6FF; color:#1D4ED8; }
.cm-pill--debit    { background:#F0FDF4; color:#15803D; }
.cm-pill--cash     { background:#FFF7ED; color:#C2410C; }

/* ── Tabs ── */
.cm-tabs {
  display: flex;
  border-bottom: 2px solid var(--cm-gray-200);
  padding: 0 20px;
  gap: 0;
}
.cm-tab {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--cm-gray-400);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.cm-tab:hover { color: var(--cm-gray-800); }
.cm-tab--active {
  color: var(--cm-primary);
  border-bottom-color: var(--cm-primary);
}

/* ── Tab content ── */
.cm-tab-content { display: none; padding: 16px 20px; }
.cm-tab-content--active { display: block; }

/* ── Card section ── */
.cm-card-section { margin-bottom: 20px; }
.cm-card-section:last-child { margin-bottom: 0; }

.cm-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cm-card-logos {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cm-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cm-gray-800);
}

/* logos */
.cm-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-weight: 700;
}
.cm-logo--visa {
  background: #1A1F71;
  color: #fff;
  font-family: serif;
  font-size: 11px;
  padding: 3px 7px;
  letter-spacing: -.3px;
}
.cm-logo--mc {
  display: inline-flex;
  width: 30px;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.cm-mc-left {
  width: 20px; height: 20px;
  background: #EB001B;
  border-radius: 50%;
  position: absolute; left: 0;
}
.cm-mc-right {
  width: 20px; height: 20px;
  background: #F79E1B;
  border-radius: 50%;
  position: absolute; right: 0;
  mix-blend-mode: multiply;
}
.cm-logo--naranja {
  background: #FF6F00;
  color: #fff;
  font-size: 13px;
  width: 26px; height: 22px;
  border-radius: 5px;
}

/* ── Cuota rows ── */
.cm-cuotas-list {
  border: 1px solid var(--cm-gray-200);
  border-radius: 10px;
  overflow: hidden;
}
.cm-cuota-row {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--cm-gray-200);
  gap: 8px;
  font-size: 14px;
  transition: background .1s;
}
.cm-cuota-row:last-child { border-bottom: none; }
.cm-cuota-row:hover { background: var(--cm-gray-50); }
.cm-cuota-row--free { background: var(--cm-green-bg); }
.cm-cuota-row--free:hover { background: #D1FAE5; }

.cm-cuota-n {
  width: 90px;
  flex-shrink: 0;
  color: var(--cm-gray-800);
  font-weight: 500;
}
.cm-badge-free {
  background: var(--cm-green);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
  flex-shrink: 0;
}
.cm-cuota-recargo {
  font-size: 12px;
  color: var(--cm-orange);
  background: var(--cm-orange-bg);
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
}
.cm-cuota-price {
  margin-left: auto;
  font-weight: 600;
  color: var(--cm-gray-800);
  text-align: right;
}
.cm-cuota-price small {
  display: block;
  font-size: 11px;
  color: var(--cm-gray-400);
  font-weight: 400;
}
.cm-cuota-price .woocommerce-Price-amount { font-size: inherit; }

/* ── Getnet tab ── */
.cm-getnet-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--cm-gray-600);
  background: var(--cm-gray-50);
  border: 1px solid var(--cm-gray-200);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.cm-promos-section { margin-bottom: 16px; }
.cm-section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
  color: var(--cm-gray-400);
  margin-bottom: 8px;
}
.cm-section-label--hoy { color: var(--cm-green); }
.cm-promo-dia-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--cm-gray-400);
  margin: 10px 0 5px;
  padding-left: 4px;
}
.cm-promo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--cm-gray-200);
  border-radius: 10px;
  margin-bottom: 6px;
  gap: 12px;
}
.cm-promo-row--active {
  border-color: var(--cm-green);
  background: var(--cm-green-bg);
  box-shadow: 0 0 0 1px var(--cm-green);
}
.cm-promo-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cm-promo-left strong { font-size: 14px; color: var(--cm-gray-800); }
.cm-promo-left span   { font-size: 12px; color: var(--cm-gray-600); }
.cm-promo-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.cm-promo-pct {
  background: var(--cm-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}
.cm-promo-pct--other {
  background: var(--cm-gray-200);
  color: var(--cm-gray-600);
}
.cm-promo-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--cm-green);
}
.cm-promo-price--other {
  color: var(--cm-gray-600);
  font-size: 13px;
}
.cm-promo-price .woocommerce-Price-amount,
.cm-promo-price--other .woocommerce-Price-amount { font-size: inherit; }

.cm-empty {
  font-size: 14px;
  color: var(--cm-gray-400);
  text-align: center;
  padding: 30px 0;
}

/* ── Footer legal ── */
.cm-modal__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--cm-gray-200);
  font-size: 11px;
  color: var(--cm-gray-400);
  text-align: center;
  line-height: 1.5;
}

/* ── Scrollbar ── */
.cm-modal::-webkit-scrollbar { width: 4px; }
.cm-modal::-webkit-scrollbar-thumb { background: var(--cm-gray-200); border-radius: 4px; }
