/* ==========================================================================
   WS Woocommerce Parcelamentos MP – Estilos
   Autor: Wesley Souza (wesleysouza.dev)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Widget resumo
   -------------------------------------------------------------------------- */

.ws-mp-parcelamento {
  display: inline-block;
  font-family: inherit;
}

.ws-mp-parc-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-mp-parc-icon {
  display: flex;
  align-items: center;
  color: #004E06;
  flex-shrink: 0;
}

.ws-mp-parc-text {
  font-size: 0.95rem;
  color: inherit;
}

.ws-mp-parc-text strong {
  font-weight: 700;
}

.ws-mp-parc-details-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 0.85rem;
  color: #004E06;
  text-decoration: underline;
  font-family: inherit;
  line-height: 1.4;
}

.ws-mp-parc-details-btn:hover,
.ws-mp-parc-details-btn:focus {
  color: #004E06;
  outline: 2px solid #004E06;
  outline-offset: 2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Modal – backdrop
   -------------------------------------------------------------------------- */

.ws-mp-parc-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ws-mp-parc-modal[hidden] {
  display: none !important;
}

.ws-mp-parc-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   Modal – caixa
   -------------------------------------------------------------------------- */

.ws-mp-parc-modal-inner {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: ws-mp-modal-in 0.2s ease;
}

@keyframes ws-mp-modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Modal – cabeçalho
   -------------------------------------------------------------------------- */

.ws-mp-parc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #ebebeb;
  flex-shrink: 0;
}

.ws-mp-parc-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}

.ws-mp-parc-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.ws-mp-parc-modal-close:hover,
.ws-mp-parc-modal-close:focus {
  color: #1a1a1a;
  background: #f2f2f2;
  outline: none;
}

.ws-mp-parc-modal-close:focus-visible {
  outline: 2px solid #009ee3;
}

/* --------------------------------------------------------------------------
   Modal – corpo (lista de parcelas)
   -------------------------------------------------------------------------- */

.ws-mp-parc-modal-body {
  overflow-y: auto;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

.ws-mp-parc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ws-mp-parc-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
}

.ws-mp-parc-table tbody tr:last-child {
  border-bottom: none;
}

.ws-mp-parc-table tbody tr:hover {
  background: #f8f8f8;
}

.ws-mp-col-info {
  padding: 12px 20px;
  color: #1a1a1a;
  line-height: 1.5;
}

.ws-mp-col-info .ws-mp-parc-count {
  font-weight: 700;
}

.ws-mp-col-total {
  padding: 12px 20px 12px 8px;
  text-align: right;
  white-space: nowrap;
  color: #444;
  font-size: 0.85rem;
}

.ws-mp-total-label {
  font-weight: 700;
  color: #1a1a1a;
  margin-right: 4px;
}

/* Badge "sem juros" */
.ws-mp-badge-no-interest {
  display: inline-block;
  background: #e6f7ee;
  color: #1a7240;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Linha "sem juros" – fundo levemente verde */
.ws-mp-parc-row.ws-mp-row--no-interest {
  background: #f4fbf7;
}

.ws-mp-parc-row.ws-mp-row--no-interest:hover {
  background: #e9f6ef;
}

/* --------------------------------------------------------------------------
   Modal – rodapé (logos das bandeiras)
   -------------------------------------------------------------------------- */

.ws-mp-parc-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #ebebeb;
  flex-shrink: 0;
}

.ws-mp-card-logos {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ws-mp-card-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  padding: 2px 4px;
  background: #fff;
}

/* --------------------------------------------------------------------------
   Responsividade
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
  .ws-mp-parc-modal-inner {
    border-radius: 12px 12px 0 0;
    max-height: 80vh;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    animation: ws-mp-modal-up 0.25s ease;
  }

  @keyframes ws-mp-modal-up {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .ws-mp-parc-modal {
    align-items: flex-end;
    padding: 0;
  }

  .ws-mp-col-info,
  .ws-mp-col-total {
    padding: 10px 14px;
  }
}
