/**
 * Lapso Mindbody - Packs
 * Estilos para el shortcode de packs
 */

.lapso-packs-wrapper {
  --primary: #992d2d;
  font-family: "Matter", "Montserrat", sans-serif;
  padding: 20px 0;
}

/* =========================================
   Título
   ========================================= */
.lapso-packs-title.title {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 5%;
  font-family: "Matter", "Montserrat", sans-serif;
  text-align: center;
}

@media (max-width: 736px) {
  .lapso-packs-title.title {
    font-size: 1.88em !important;
  }
}

/* =========================================
   Loading & Empty
   ========================================= */
.lapso-packs-empty {
  text-align: center;
  padding: 40px 20px;
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 16px;
  color: #656565;
}

/* =========================================
   Skeleton Loading
   ========================================= */
.lapso-packs-loading .skeleton-card {
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-title {
  width: 80%;
  height: 20px;
  margin: 12px auto 16px;
}

.skeleton-price {
  width: 60%;
  height: 30px;
  margin: 0 auto 8px;
}

.skeleton-small {
  width: 50%;
  height: 12px;
  margin: 0 auto 12px;
}

.skeleton-validity {
  width: 70%;
  height: 12px;
  margin: 0 auto 12px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* =========================================
   Container de Cards
   ========================================= */
.lapso-packs-wrapper .container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.lapso-packs-wrapper .container#paymentCards * {
  font-family: "Matter", "Montserrat", sans-serif;
}

/* =========================================
   Cards
   ========================================= */
.lapso-packs-wrapper .card {
  cursor: pointer;
  border-radius: 10px;
  padding: 5px;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 150px;
  flex-shrink: 0;
  background-color: white;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.lapso-packs-wrapper .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.lapso-packs-wrapper .card.selected {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Card Title */
.lapso-packs-wrapper .card h3 {
  color: var(--primary);
  text-align: center;
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 0.4px;
}

/* Card Price */
.lapso-packs-wrapper .card .price {
  color: #000;
  text-align: center;
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 30px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  letter-spacing: 0.6px;
}

.lapso-packs-wrapper .card .price small {
  color: #656565;
  text-align: center;
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 0.24px;
  display: block;
}

/* Card Validity */
.lapso-packs-wrapper .card .validity {
  color: #000;
  text-align: center;
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 0.24px;
}

/* =========================================
   Elite Discount Badge
   ========================================= */
.lapso-packs-wrapper .card .elite-discount-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #c9a84c;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  font-family: "Matter", "Montserrat", sans-serif;
  white-space: nowrap;
}

/* =========================================
   Highlighted Pack
   ========================================= */
.lapso-packs-wrapper .card.highlighted-pack {
  background-color: var(--primary);
  color: white;
}

.lapso-packs-wrapper .card.highlighted-pack h3,
.lapso-packs-wrapper .card.highlighted-pack .price,
.lapso-packs-wrapper .card.highlighted-pack .validity,
.lapso-packs-wrapper .card.highlighted-pack small {
  color: white;
}

/* =========================================
   Terms
   ========================================= */
.lapso-packs-wrapper .terms {
  display: flex;
  flex-direction: row;
  margin: 3% 0 1% 0;
  justify-content: center;
  color: black;
  font-size: 18px;
  font-family: "Matter", "Montserrat", sans-serif;
  font-weight: 400;
  letter-spacing: 0.36px;
  word-wrap: break-word;
  margin-bottom: 33px;
}

@media (max-width: 600px) {
  .lapso-packs-wrapper .terms {
    text-align: left;
  }
}

.lapso-packs-wrapper .terms input#terms {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-right: 8px;
  accent-color: var(--primary);
}

.lapso-packs-wrapper .terms a {
  color: var(--primary);
  text-decoration: underline;
}

/* =========================================
   Payment Modal
   ========================================= */
#paymentModal {
  display: none;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999999;
}

#paymentModal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}

.payment-modal-container {
  background-color: #f4f3ec;
  font-family: "Matter", "Montserrat", sans-serif;
  display: flex;
  flex-direction: column;
  color: black;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 28px;
  border-radius: 14px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.payment-modal-container * {
  font-family: "Matter", "Montserrat", sans-serif;
}

.closePaymentContainer {
  position: absolute;
  right: 16px;
  top: 12px;
}

#closePaymentModal {
  border: 0;
  color: var(--primary) !important;
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 36px !important;
  font-weight: 400;
  background: none !important;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: opacity 0.2s;
}

#closePaymentModal:hover {
  opacity: 0.7;
}

/* Cart Header */
.cart-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 16px 0;
  letter-spacing: 0.3px;
  text-align: center;
}

/* Cart Pack Preview */
.cart-pack-preview {
  margin-bottom: 0;
}

.cart-pack-card {
  background: white;
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
  border: 2px solid var(--primary);
  position: relative;
}

.cart-pack-card h3 {
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: 0.4px;
}

.cart-pack-card .price {
  color: #000;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.cart-pack-card .price small {
  display: block;
  color: #656565;
  font-size: 13px;
  font-weight: 400;
  margin-top: 2px;
}

.cart-pack-card .validity {
  color: #656565;
  font-size: 12px;
  font-weight: 400;
  margin-top: 6px;
  letter-spacing: 0.2px;
}

.cart-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 0;
  font-size: 16px;
  color: #333;
}

.cart-total-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

/* Modal Divider */
.modal-divider {
  height: 1px;
  background: #ddd;
  margin: 18px 0;
}

/* Payment Section */
.payment-section {
  margin-bottom: 8px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin: 0 0 14px 0;
}

.section-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Payment Methods */
.payment-methods {
  margin-bottom: 0;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-size: 15px;
  background: white;
}

.payment-option:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(153, 45, 45, 0.08);
}

.payment-option input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
}

.payment-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.payment-option-label {
  font-weight: 500;
  font-size: 15px;
  color: #333;
}

.payment-option-detail {
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
}

/* New Card Form */
#newCardForm {
  margin-top: 0;
  margin-bottom: 10px;
}

.card-form {
  background: white;
  border-radius: 10px;
  padding: 20px;
  border: 1.5px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-form label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  letter-spacing: 0.2px;
}

.card-form input,
.card-form select {
  padding: 11px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  font-family: "Matter", "Montserrat", sans-serif;
  background: #fafafa;
  transition:
    border-color 0.2s,
    background 0.2s;
  box-sizing: border-box;
  color: #222;
}

.card-form input:focus,
.card-form select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.card-form input::placeholder {
  color: #bbb;
}

/* Input with icon */
.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper input {
  padding-right: 42px;
  width: 100%;
}

.input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  pointer-events: none;
}

/* Row layout */
.form-row {
  display: flex;
  gap: 12px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-2 .form-group {
  min-width: 0;
}

.save-card-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: #555;
}

.save-card-check input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Payment Terms (inside modal) */
.payment-terms {
  margin: 10px 0 0 0;
  font-size: 14px;
  justify-content: flex-start;
}

.payment-terms input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-right: 8px;
  accent-color: var(--primary);
}

/* Payment Actions */
.payment-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.payment-actions .btn-primary,
.payment-actions .btn-secondary {
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 700;
  border-radius: 25px;
  padding: 12px 32px;
  cursor: pointer;
  border: 2px solid var(--primary);
  transition:
    opacity 0.2s,
    transform 0.15s;
  letter-spacing: 0.36px;
}

.payment-actions .btn-primary {
  background: var(--primary);
  color: white;
}

.payment-actions .btn-secondary {
  background: white;
  color: var(--primary);
}

.payment-actions .btn-primary:disabled {
  background: #aaa;
  border-color: #aaa;
  cursor: not-allowed;
}

.payment-actions .btn-primary:not(:disabled):hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.payment-actions .btn-secondary:hover {
  opacity: 0.85;
}

/* Payment Result */
#paymentResult {
  text-align: center;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}

#paymentResult.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

#paymentResult.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@media (max-width: 600px) {
  .payment-modal-container {
    padding: 22px 16px;
    max-width: 95vw;
    border-radius: 12px;
  }

  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }

  .payment-actions {
    flex-direction: column;
  }

  .payment-actions .btn-primary,
  .payment-actions .btn-secondary {
    width: 100%;
  }

  .cart-pack-card .price {
    font-size: 26px;
  }
}

/* =========================================
   Klarna Badge
   ========================================= */
.klarna-badge {
  display: inline-flex;
  align-items: center;
  background: #ffb3c7;
  color: #17120f;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  margin-right: 8px;
  font-family: "Matter", "Montserrat", sans-serif;
}

/* =========================================
   Apple Pay Native Button (above methods)
   ========================================= */
#applePayOption {
  margin-bottom: 4px;
}

.apple-pay-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 12px 0 16px;
  color: #999;
  font-size: 13px;
}

.apple-pay-divider::before,
.apple-pay-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #ddd;
}

.apple-pay-divider span {
  padding: 0 12px;
  white-space: nowrap;
}

#apple-pay-button-container {
  min-height: 40px;
}

/* =========================================
   Stripe Elements Container
   ========================================= */
#stripeElementsContainer {
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 16px;
  background: white;
  border-radius: 10px;
  border: 1.5px solid #eee;
}

#stripe-payment-element {
  min-height: 40px;
}

#stripe-payment-message {
  color: #721c24;
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 12px;
  background: #f8d7da;
  border-radius: 6px;
}

/* =========================================
   Klarna Return Banner
   ========================================= */
.klarna-result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 500;
  animation: bannerSlideIn 0.3s ease;
}

.klarna-result-banner.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.klarna-result-banner.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.klarna-result-banner p {
  margin: 0;
}

.klarna-result-banner button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
  padding: 0 0 0 16px;
  line-height: 1;
}

@keyframes bannerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   Modal de Compra Exitosa
   ========================================= */
.success-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
}

.success-modal-overlay.is-open {
  display: flex;
}

.success-modal {
  position: relative;
  background: #f5f0eb;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  padding: 48px 40px 40px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  animation: successModalIn 0.25s ease;
}

@keyframes successModalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none !important;
  border: none !important;
  font-size: 36px !important;
  line-height: 1;
  color: var(--primary) !important;
  cursor: pointer;
  padding: 4px 8px;
  font-family: "Matter", "Montserrat", sans-serif;
  transition: opacity 0.2s;
}

.success-modal-close:hover {
  opacity: 0.7;
}

.success-modal-title {
  font-family: "Matter", "Montserrat", sans-serif;
  font-style: italic;
  font-size: 36px;
  font-weight: 700;
  color: var(--primary, #a52e2d);
  margin: 0 0 20px;
}

.success-modal-text {
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin: 0;
}

.success-modal-text + .success-modal-text {
  margin-top: 16px;
}

/* Warning modal specific */
.warning-modal-highlight {
  font-weight: 700;
  color: #111;
  margin-top: 20px !important;
}

.warning-modal-checkbox {
  margin: 24px 0 20px;
  font-family: "Matter", "Montserrat", sans-serif;
  font-size: 14px;
  color: #333;
}

.warning-modal-checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.warning-modal-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #a52e2d);
  cursor: pointer;
}

#warningNext {
  width: 100%;
  max-width: 280px;
  padding: 12px 24px;
  font-size: 15px;
  font-family: "Matter", "Montserrat", sans-serif;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
  background-color: var(--primary, #a52e2d);
  color: #fff;
  border: 1px solid var(--primary, #a52e2d);
}

#warningNext:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================================
   Gift Card Payment Method
   ========================================= */
.giftcard-method-icon {
  color: var(--primary);
  vertical-align: middle;
  margin-right: 4px;
}

#giftcardForm {
  margin-top: 0;
  margin-bottom: 10px;
}

#giftcardForm .card-form {
  background: white;
  border-radius: 10px;
  padding: 20px;
  border: 1.5px solid #eee;
}

.giftcard-input-wrapper {
  display: flex;
  gap: 10px;
}

.giftcard-input-wrapper input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: "Matter", "Montserrat", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-sizing: border-box;
}

.giftcard-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary, #a52e2d);
  box-shadow: 0 0 0 3px rgba(165, 46, 45, 0.1);
}

.lapso-packs-wrapper .btn-validate-giftcard,
.lapso-packs-wrapper button.btn-validate-giftcard {
  padding: 12px 20px !important;
  background: transparent !important;
  color: var(--primary, #a52e2d) !important;
  border: 1px solid var(--primary, #a52e2d) !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Matter", "Montserrat", sans-serif !important;
  white-space: nowrap;
  line-height: normal !important;
  letter-spacing: normal !important;
  min-height: auto !important;
  box-shadow: none !important;
  text-transform: none !important;
}

.lapso-packs-wrapper .btn-validate-giftcard:hover,
.lapso-packs-wrapper button.btn-validate-giftcard:hover {
  background: var(--primary, #a52e2d) !important;
  color: #fff !important;
}

.lapso-packs-wrapper .btn-validate-giftcard:disabled,
.lapso-packs-wrapper button.btn-validate-giftcard:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.giftcard-validation-result {
  margin-top: 10px;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 13px;
}

.giftcard-validation-result.error {
  background: #fee;
  color: #c00;
}

.giftcard-validation-result.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.giftcard-valid-message {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding: 15px;
  background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
  border-radius: 10px;
  color: #fff;
}

.giftcard-valid-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.giftcard-valid-text {
  display: flex;
  flex-direction: column;
}

.giftcard-valid-text strong {
  font-size: 15px;
  font-weight: 600;
}

.giftcard-valid-text span {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 2px;
}

@media (max-width: 480px) {
  .giftcard-input-wrapper {
    flex-direction: column;
  }

  .lapso-packs-wrapper .btn-validate-giftcard {
    width: 100% !important;
  }
}

/* Referral discount row */
.referral-discount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #e8f5e9;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 14px;
  color: #2e7d32;
  font-weight: 500;
}
