/* =========================================================
   Cuponeta · Tarjetas de promociones APP-first · V593
   Alcance visual aislado a /cuponeta/.
   ========================================================= */

.jc-cuponeta-shell .jc-coupon-card-v593{
  position:relative;
  display:flex;
  min-width:0;
  flex-direction:column;
  overflow:visible;
  border:1px solid #e1e8ef;
  border-radius:18px;
  background:#fff;
  box-shadow:0 10px 28px rgba(18,46,70,.08);
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-media{
  position:relative;
  aspect-ratio:16/9;
  overflow:hidden;
  border-radius:17px 17px 0 0;
  background:#eef5f0;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-media img,
.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-placeholder{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-benefit{
  position:absolute;
  z-index:2;
  left:12px;
  top:12px;
  bottom:auto;
  max-width:calc(100% - 24px);
  padding:7px 11px;
  overflow:hidden;
  border-radius:999px;
  background:#159a39;
  color:#fff;
  box-shadow:0 7px 18px rgba(21,154,57,.26);
  font-size:14px;
  font-weight:900;
  line-height:1.1;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-body{
  display:flex;
  min-width:0;
  flex:1 1 auto;
  flex-direction:column;
  padding:14px;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-business{
  display:flex;
  min-width:0;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 6px;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-business__name{
  min-width:0;
  overflow:hidden;
  color:#1769aa;
  font-size:14px;
  font-weight:850;
  line-height:1.25;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-business__locality{
  flex:0 1 auto;
  min-width:0;
  overflow:hidden;
  color:#65788a;
  font-size:13px;
  font-weight:700;
  line-height:1.25;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-title-v593{
  display:-webkit-box;
  margin:0;
  overflow:hidden;
  color:#102a43;
  font-size:18px;
  font-weight:900;
  line-height:1.22;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

/* El detalle descriptivo se conserva en HTML y pasa al cuadro de condiciones. */
.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-summary-v593,
.jc-cuponeta-shell .jc-coupon-card-v593>.jc-coupon-body>.jc-coupon-loyalty-badge{
  display:none;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-meta-v593{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:10px 0 0;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-meta-v593 span{
  display:none;
  min-height:30px;
  align-items:center;
  padding:5px 8px;
  border-radius:999px;
  background:#f1f5f8;
  color:#52667a;
  font-size:13px;
  font-weight:750;
  line-height:1.15;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-meta-v593 .jc-coupon-meta__end,
.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-meta-v593 .jc-coupon-availability{
  display:inline-flex;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-meta-v593 .jc-coupon-availability{
  background:#edf8f0;
  color:#176b32;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-action-stack-v593{
  display:grid;
  gap:9px;
  margin-top:auto;
  padding-top:14px;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-get{
  display:flex;
  width:100%;
  min-height:46px;
  align-items:center;
  justify-content:center;
  margin:0;
  padding:9px 14px;
  border:0;
  border-radius:12px;
  background:#169c3a;
  color:#fff;
  box-shadow:0 8px 18px rgba(22,156,58,.20);
  font-size:15px;
  font-weight:900;
  line-height:1.15;
  text-align:center;
  text-decoration:none;
  cursor:pointer;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-get.is-owned{
  background:#0f6aa2;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-get.is-disabled{
  background:#e9eef2;
  color:#6f7f8d;
  box-shadow:none;
  cursor:not-allowed;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-card-actions-v593{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-open,
.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-save{
  display:flex;
  min-height:44px;
  align-items:center;
  justify-content:center;
  margin:0;
  padding:8px 12px;
  border:1px solid #d6e0e8;
  border-radius:11px;
  background:#fff;
  color:#2f4b61;
  box-shadow:none;
  font-size:14px;
  font-weight:800;
  line-height:1.15;
  cursor:pointer;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-save{
  min-width:104px;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-save.is-saved,
.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-save[aria-pressed="true"]{
  border-color:#f0b7bf;
  background:#fff7f8;
  color:#9c2339;
}

/* Condiciones: un único cuadro flotante por vez. */
.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-details-v593[hidden]{
  display:none!important;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-details-v593:not([hidden]){
  position:fixed;
  z-index:100510;
  left:50%;
  bottom:calc(12px + env(safe-area-inset-bottom,0px));
  display:grid;
  gap:12px;
  width:min(calc(100vw - 24px),560px);
  max-height:min(76dvh,620px);
  margin:0;
  padding:18px 18px 72px;
  overflow-x:hidden;
  overflow-y:auto;
  border:1px solid #d3dee7;
  border-radius:20px;
  background:#fff;
  box-shadow:0 28px 84px rgba(5,25,42,.34);
  color:#20384f;
  transform:translateX(-50%);
  overscroll-behavior:contain;
}

.jc-coupon-modal-backdrop-v593{
  position:fixed;
  z-index:100500;
  inset:0;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  background:rgba(7,22,35,.50);
  backdrop-filter:blur(2px);
  cursor:pointer;
}

body.jc-coupon-modal-v593-open{
  overflow:hidden!important;
  overscroll-behavior:none;
}

.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-details-v593:not([hidden])>strong{
  display:block;
  padding-right:42px;
  color:#102a43;
  font-size:19px;
  font-weight:950;
  line-height:1.22;
}

.jc-cuponeta-shell .jc-coupon-details-v593__summary{
  margin:0;
  color:#52667a;
  font-size:15px;
  line-height:1.5;
}

.jc-cuponeta-shell .jc-coupon-details-v593__facts{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}

.jc-cuponeta-shell .jc-coupon-details-v593__facts span{
  display:grid;
  gap:2px;
  min-width:0;
  padding:10px;
  border-radius:12px;
  background:#f5f8fa;
  color:#3d5568;
  font-size:13px;
  line-height:1.3;
}

.jc-cuponeta-shell .jc-coupon-details-v593__facts b,
.jc-cuponeta-shell .jc-coupon-details-v593__terms>b{
  color:#18364c;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.jc-cuponeta-shell .jc-coupon-details-v593__loyalty{
  padding:10px 12px;
  border:1px solid #d9ecd9;
  border-radius:12px;
  background:#f4fbf5;
  color:#315f3b;
  font-size:13px;
  line-height:1.4;
}

.jc-cuponeta-shell .jc-coupon-details-v593__terms{
  display:grid;
  gap:5px;
  padding-top:2px;
}

.jc-cuponeta-shell .jc-coupon-details-v593__terms small{
  display:block;
  color:#536b7d;
  font-size:14px;
  line-height:1.5;
}

.jc-cuponeta-shell .jc-coupon-details-v593__merchant{
  justify-self:start;
  min-height:44px;
  margin:0;
}

/* El mismo botón de la tarjeta se transforma en cerrar, preservando el JS/métricas existentes. */
.jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-open[aria-expanded="true"]{
  position:fixed;
  z-index:100520;
  right:max(20px,calc((100vw - 560px)/2 + 20px));
  bottom:calc(22px + env(safe-area-inset-bottom,0px));
  width:auto;
  min-width:106px;
  min-height:42px;
  padding:8px 13px;
  border-color:#18364c;
  border-radius:10px;
  background:#18364c;
  color:#fff;
  box-shadow:0 8px 22px rgba(8,30,47,.22);
}

@media(max-width:430px){
  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-body{
    padding:13px;
  }

  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-benefit{
    left:10px;
    top:10px;
    padding:6px 10px;
    font-size:13px;
  }

  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-business__name{
    font-size:14px;
  }

  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-business__locality{
    font-size:13px;
  }

  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-title-v593{
    font-size:18px;
  }

  .jc-cuponeta-shell .jc-coupon-details-v593__facts{
    grid-template-columns:1fr;
  }

  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-details-v593:not([hidden]){
    width:calc(100vw - 16px);
    bottom:calc(8px + env(safe-area-inset-bottom,0px));
    max-height:min(80dvh,640px);
    padding:16px 14px 70px;
    border-radius:18px;
  }

  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-open[aria-expanded="true"]{
    right:16px;
    bottom:calc(16px + env(safe-area-inset-bottom,0px));
  }
}

@media(min-width:681px){
  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-body{
    padding:16px;
  }

  .jc-cuponeta-shell .jc-coupon-card-v593 .jc-coupon-title-v593{
    font-size:19px;
  }
}

@media(prefers-reduced-motion:reduce){
  .jc-cuponeta-shell .jc-coupon-card-v593,
  .jc-cuponeta-shell .jc-coupon-card-v593 *,
  .jc-coupon-modal-backdrop-v593{
    scroll-behavior:auto!important;
    transition:none!important;
    animation:none!important;
  }
}
