/* ==========================================================
   CHECKOUT EN MODAL
   ========================================================== */
html.amr-co-open,
html.amr-co-open body { overflow: hidden; }

.amr-co-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  pointer-events: none;
  font-family: var(--amr-font);
}

.amr-co-modal.is-open { visibility: visible; pointer-events: auto; }

.amr-co-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 3, 38, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s ease;
}

.amr-co-modal.is-open .amr-co-backdrop { opacity: 1; }

.amr-co-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(30, 3, 38, .55);
  opacity: 0;
  translate: 0 24px;
  scale: .97;
  transition: opacity .3s ease, translate .4s cubic-bezier(.2, .9, .3, 1.1), scale .4s cubic-bezier(.2, .9, .3, 1.1);
}

.amr-co-modal.is-open .amr-co-panel { opacity: 1; translate: 0 0; scale: 1; }

.amr-co-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 16px 24px;
  background: linear-gradient(120deg, var(--amr-c1-dark), var(--amr-c1));
  color: #ffffff;
}

.amr-co-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amr-co-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border: none !important;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15) !important;
  color: #ffffff !important;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .2s ease, rotate .3s ease;
}

.amr-co-close:hover { background: rgba(255, 255, 255, .28) !important; rotate: 90deg; }

.amr-co-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.amr-co-body { position: relative; flex: 1 1 auto; background: #ffffff; }

.amr-co-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity .3s ease;
}

.amr-co-modal.is-loaded .amr-co-frame { opacity: 1; }

.amr-co-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.amr-co-modal.is-loaded .amr-co-loading { display: none; }

.amr-co-spin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--amr-c1-soft);
  border-top-color: var(--amr-c1);
  animation: amrCoSpin .8s linear infinite;
}

@keyframes amrCoSpin { to { rotate: 360deg; } }

@media (max-width: 600px) {
  .amr-co-modal { padding: 0; align-items: flex-end; }
  .amr-co-panel {
    max-width: none;
    height: 92vh;
    height: 92dvh;
    border-radius: 22px 22px 0 0;
    translate: 0 60px;
  }
}

/* ==========================================================
   DENTRO DEL MODAL (iframe): solo el formulario
   ========================================================== */
html.amr-embed { margin-top: 0 !important; }

html.amr-embed #wpadminbar,
html.amr-embed .amr-nav-root,
html.amr-embed .amr-nav-spacer,
html.amr-embed .amr-footer,
html.amr-embed header.elementor-location-header,
html.amr-embed footer.elementor-location-footer,
html.amr-embed .page-header,
html.amr-embed .woocommerce-store-notice,
html.amr-embed .wc-block-components-notice-banner.is-info { display: none !important; }

html.amr-embed body { background: #ffffff; }

html.amr-embed body.woocommerce-page main.site-main { padding: 22px 22px 34px; max-width: none; }

html.amr-embed .woocommerce .col2-set .col-1,
html.amr-embed .woocommerce .col2-set .col-2,
html.amr-embed .woocommerce-page .col2-set .col-1,
html.amr-embed .woocommerce-page .col2-set .col-2 { float: none; width: 100%; }

html.amr-embed .woocommerce .col2-set .col-2:empty { display: none; }

/* ==========================================================
   CHECKOUT CLÁSICO (en modal y en la página): estilo de marca
   ========================================================== */
body.woocommerce-checkout form.checkout h3,
body.woocommerce-checkout #order_review_heading {
  font-family: var(--amr-font);
  font-size: 18px;
  font-weight: 800;
  color: #0b1e36;
  margin: 0 0 14px;
}

body.woocommerce-checkout form.checkout .form-row { margin-bottom: 14px; }

body.woocommerce-checkout form.checkout label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

body.woocommerce-checkout form.checkout .input-text {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  background: #ffffff;
  transition: border-color .2s ease, box-shadow .2s ease;
}

body.woocommerce-checkout form.checkout .input-text:focus {
  outline: none;
  border-color: var(--amr-c1);
  box-shadow: 0 0 0 4px rgba(var(--amr-c1-rgb), .12);
}

body.woocommerce-checkout #order_review {
  background: #faf7fb;
  border: 1px solid var(--amr-c1-soft);
  border-radius: 18px;
  padding: 18px;
}

body.woocommerce-checkout #order_review table.shop_table {
  border: none;
  margin: 0 0 14px;
}

body.woocommerce-checkout #order_review table.shop_table th,
body.woocommerce-checkout #order_review table.shop_table td {
  border-color: rgba(var(--amr-c1-rgb), .1);
  padding: 10px 6px;
  font-size: 14px;
}

body.woocommerce-checkout #order_review .order-total th,
body.woocommerce-checkout #order_review .order-total td { font-size: 17px; color: var(--amr-c1); }

body.woocommerce-checkout #payment {
  background: transparent;
  border-radius: 14px;
}

body.woocommerce-checkout #payment #place_order {
  width: 100%;
  float: none;
  padding: 16px 24px;
  border: none;
  border-radius: 999px;
  background: var(--amr-c2);
  color: var(--amr-c2-text);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 10px 24px -6px rgba(var(--amr-c2-rgb), .6);
  cursor: pointer;
  transition: background-color .2s ease, translate .2s ease;
}

body.woocommerce-checkout #payment #place_order:hover { background: var(--amr-c2-dark); translate: 0 -2px; }


/* ==========================================================
   CHECKOUT: PASOS + VIDEO EXPLICATIVO
   ========================================================== */
.amr-co-steps-wrap {
  margin: 0 0 22px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--amr-c1-softer), #ffffff);
  border: 1px solid var(--amr-c1-soft);
  font-family: var(--amr-font);
}

.amr-co-steps-title {
  margin: 0 0 12px !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amr-c1);
}

.amr-co-steps {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  counter-reset: none;
}

.amr-co-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 !important;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 16px -10px rgba(var(--amr-c1-rgb), .35);
}

.amr-co-step-n {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--amr-c1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.amr-co-step:nth-child(2) .amr-co-step-n { background: var(--amr-c2); color: var(--amr-c2-text); }
.amr-co-step:nth-child(3) .amr-co-step-n { background: #16a34a; }

.amr-co-step-tx { display: flex; flex-direction: column; min-width: 0; }
.amr-co-step-tx strong { font-size: 13.5px; color: #0b1e36; line-height: 1.3; }
.amr-co-step-tx small { font-size: 12.5px; color: #64748b; line-height: 1.4; margin-top: 2px; }

/* Video */
.amr-co-video { margin-top: 14px; }

.amr-co-video summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--amr-c1);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.amr-co-video summary::-webkit-details-marker { display: none; }
.amr-co-video summary::marker { content: ""; }

.amr-co-play {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--amr-c1);
  box-shadow: 0 0 0 0 rgba(var(--amr-c1-rgb), .45);
  animation: amrCoPulse 2s ease-out infinite;
}

.amr-co-play::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  border-style: solid;
  border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent #ffffff;
}

@keyframes amrCoPulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--amr-c1-rgb), .45); }
  100% { box-shadow: 0 0 0 10px rgba(var(--amr-c1-rgb), 0); }
}

.amr-co-video-box {
  margin-top: 12px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000000;
}

.amr-co-video-box iframe,
.amr-co-video-box video { display: block; width: 100%; height: 100%; border: 0; }

@media (max-width: 420px) {
  .amr-co-steps { grid-template-columns: 1fr; }
}
