/* =============================================
   RISKON · Shop (Carrito + Checkout)
   Colores: navy #173856 · naranja #F59300
   Dinámico e interactivo — sincronizado con rk_cart
   ============================================= */

.rk-shop {
  --rk-navy: #173856;
  --rk-navy-2: #0f2740;
  --rk-orange: #F59300;
  --rk-orange-d: #eb8d00;
  --rk-ink: #141516;
  --rk-body: #55606b;
  --rk-muted: #8b95a1;
  --rk-line: #e8ecf0;
  --rk-bg: #f5f7f9;
  --rk-ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Inter", sans-serif;
  color: var(--rk-body);
  padding-bottom: clamp(60px, 7vw, 120px);
}

/* ---------- Steps bar ---------- */
.rk-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: clamp(30px, 4vw, 56px);
}
.rk-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--rk-muted);
  font-weight: 500;
  font-size: 15px;
}
.rk-step .rk-step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e6eaee;
  color: var(--rk-muted);
  font-weight: 700;
  font-size: 14px;
  transition: 0.3s var(--rk-ease);
}
.rk-step.is-active { color: var(--rk-navy); }
.rk-step.is-active .rk-step-num {
  background: var(--rk-orange);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(245, 147, 0, 0.9);
}
.rk-step.is-done .rk-step-num { background: var(--rk-navy); color: #fff; }
.rk-step-sep {
  width: clamp(24px, 5vw, 64px);
  height: 2px;
  background: #e0e5ea;
  border-radius: 2px;
}

/* ---------- Grid ---------- */
.rk-shop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
  gap: clamp(20px, 2.4vw, 36px);
}
.rk-checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 2.4vw, 36px);
}

/* ---------- Cards ---------- */
.rk-card {
  background: #fff;
  border: 1px solid var(--rk-line);
  border-radius: 20px;
  box-shadow: 0 24px 50px -34px rgba(15, 39, 64, 0.35);
}
.rk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--rk-line);
}
.rk-card-head h2 {
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--rk-ink);
  margin: 0;
}
.rk-card-head .rk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--rk-navy);
  background: #eaf0f6;
  padding: 4px 12px;
  border-radius: 100px;
}

/* ---------- Cart line items ---------- */
.rk-lines { padding: 6px 26px; }
.rk-line {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--rk-line);
  animation: rkFadeIn 0.5s var(--rk-ease) both;
}
.rk-line:last-child { border-bottom: 0; }
.rk-line.is-removing {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
@keyframes rkFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.rk-line__img {
  width: 88px;
  height: 66px;
  border-radius: 12px;
  object-fit: cover;
  background: #eef1f4;
}
.rk-line__name {
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--rk-ink);
  line-height: 1.35;
  margin: 0 0 6px;
}
.rk-line__meta {
  font-size: 12.5px;
  color: var(--rk-muted);
  margin: 0 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rk-line__meta .rk-tag {
  background: #fbf1e0;
  color: var(--rk-orange-d);
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 600;
}
.rk-line__unit { font-size: 13px; color: var(--rk-body); }
.rk-line__unit strong { color: var(--rk-navy); }

.rk-line__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.rk-line__total {
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--rk-navy);
  white-space: nowrap;
}

/* Quantity stepper */
.rk-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dfe4ea;
  border-radius: 100px;
  overflow: hidden;
  background: #fff;
}
.rk-qty button {
  width: 34px;
  height: 34px;
  border: 0;
  background: #f4f6f8;
  color: var(--rk-navy);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  display: grid;
  place-items: center;
}
.rk-qty button:hover { background: var(--rk-orange); color: #fff; }
.rk-qty input {
  width: 40px;
  height: 34px;
  border: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--rk-ink);
  background: #fff;
  -moz-appearance: textfield;
}
.rk-qty input::-webkit-outer-spin-button,
.rk-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.rk-line__del {
  border: 0;
  background: none;
  color: var(--rk-muted);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  padding: 0;
}
.rk-line__del:hover { color: #e23b3b; }

/* Cart footer actions */
.rk-cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  padding: 22px 26px;
  border-top: 1px solid var(--rk-line);
}

/* ---------- Empty state ---------- */
.rk-empty {
  text-align: center;
  padding: 70px 20px;
}
.rk-empty__ico {
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2f6;
  color: var(--rk-navy);
  font-size: 40px;
}
.rk-empty h3 {
  font-family: "Poppins", "Inter", sans-serif;
  color: var(--rk-ink);
  font-size: 22px;
  margin-bottom: 8px;
}
.rk-empty p { margin-bottom: 26px; color: var(--rk-muted); }

/* ---------- Summary ---------- */
.rk-summary { position: sticky; top: 24px; }
.rk-summary__body { padding: 22px 26px; }
.rk-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14.5px;
  padding: 9px 0;
}
.rk-sum-row span:first-child { color: var(--rk-body); }
.rk-sum-row span:last-child { font-weight: 600; color: var(--rk-ink); }
.rk-sum-row.rk-discount span:last-child { color: #1f9d55; }
.rk-sum-divider { height: 1px; background: var(--rk-line); margin: 12px 0; }
.rk-sum-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0 4px;
}
.rk-sum-total .rk-total-label {
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--rk-ink);
}
.rk-sum-total .rk-total-value {
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--rk-navy);
}
.rk-sum-note { font-size: 12px; color: var(--rk-muted); margin: 4px 0 0; }

/* Coupon */
.rk-coupon { display: flex; gap: 10px; margin: 16px 0 4px; }
.rk-coupon input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid #dfe4ea;
  border-radius: 100px;
  padding: 0 18px;
  font-size: 13.5px;
  color: var(--rk-ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rk-coupon input:focus {
  border-color: var(--rk-orange);
  box-shadow: 0 0 0 3px rgba(245, 147, 0, 0.14);
}
.rk-coupon button {
  flex-shrink: 0;
  height: 46px;
  padding: 0 20px;
  border: 1px solid var(--rk-navy);
  background: var(--rk-navy);
  color: #fff;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.rk-coupon button:hover { background: var(--rk-orange); border-color: var(--rk-orange); }
.rk-coupon-msg { font-size: 12.5px; margin: 8px 2px 0; min-height: 16px; }
.rk-coupon-msg.ok { color: #1f9d55; }
.rk-coupon-msg.err { color: #e23b3b; }
.rk-coupon-hint {
  font-size: 11.5px;
  color: var(--rk-muted);
  margin: 10px 2px 0;
}
.rk-coupon-hint code {
  background: #eef2f6;
  color: var(--rk-navy);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* Trust badges */
.rk-trust {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 26px;
  border-top: 1px solid var(--rk-line);
}
.rk-trust div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--rk-body);
}
.rk-trust svg { color: var(--rk-orange); flex-shrink: 0; }

/* ---------- Buttons ---------- */
.rk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 100px;
  padding: 14px 26px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s var(--rk-ease), background 0.25s, color 0.25s, box-shadow 0.25s;
  text-decoration: none;
  font-family: "Inter", sans-serif;
}
.rk-btn:active { transform: scale(0.97); }
.rk-btn--primary {
  background: var(--rk-orange);
  color: #fff;
  box-shadow: 0 14px 28px -14px rgba(245, 147, 0, 0.9);
}
.rk-btn--primary:hover { background: var(--rk-orange-d); color: #fff; }
.rk-btn--navy { background: var(--rk-navy); color: #fff; }
.rk-btn--navy:hover { background: var(--rk-orange); color: #fff; }
.rk-btn--ghost {
  background: #fff;
  color: var(--rk-navy);
  border-color: #d7dde3;
}
.rk-btn--ghost:hover { border-color: var(--rk-navy); color: var(--rk-navy); background: #f6f8fa; }
.rk-btn--block { width: 100%; }
.rk-btn--lg { padding: 16px 28px; font-size: 15px; }

/* ---------- Checkout form ---------- */
.rk-form-section { padding: 24px 26px; }
.rk-form-section + .rk-form-section { border-top: 1px solid var(--rk-line); }
.rk-form-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.rk-form-legend .rk-leg-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rk-navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.rk-form-legend h3 {
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 17px;
  color: var(--rk-ink);
  margin: 0;
}
.rk-form-legend p { margin: 2px 0 0; font-size: 12.5px; color: var(--rk-muted); }

.rk-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rk-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.rk-field.rk-col-2 { grid-column: span 2; }
.rk-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rk-ink);
}
.rk-field label .rk-req { color: var(--rk-orange); }
.rk-input, .rk-select, .rk-textarea {
  height: 50px;
  border: 1px solid #dfe4ea;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--rk-ink);
  background: #fff;
  outline: none;
  width: 100%;
  font-family: "Inter", sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rk-textarea { height: auto; padding: 14px 16px; resize: vertical; min-height: 96px; }
.rk-input:focus, .rk-select:focus, .rk-textarea:focus {
  border-color: var(--rk-orange);
  box-shadow: 0 0 0 3px rgba(245, 147, 0, 0.14);
}
.rk-input.is-invalid, .rk-select.is-invalid {
  border-color: #e23b3b;
  box-shadow: 0 0 0 3px rgba(226, 59, 59, 0.12);
}
.rk-error { font-size: 11.5px; color: #e23b3b; min-height: 14px; }
.rk-check.is-invalid-check { color: #e23b3b !important; }
.rk-check.is-invalid-check input { outline: 2px solid #e23b3b; outline-offset: 2px; border-radius: 3px; }

/* Payment methods */
.rk-pay-methods { display: grid; gap: 12px; }
.rk-pay {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid #dfe4ea;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s var(--rk-ease);
}
.rk-pay:hover { border-color: #c3ccd5; }
.rk-pay input { position: absolute; opacity: 0; pointer-events: none; }
.rk-pay .rk-pay-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #c3ccd5;
  flex-shrink: 0;
  transition: 0.2s;
  position: relative;
}
.rk-pay input:checked ~ .rk-pay-dot {
  border-color: var(--rk-orange);
}
.rk-pay input:checked ~ .rk-pay-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--rk-orange);
}
.rk-pay:has(input:checked) {
  border-color: var(--rk-orange);
  background: #fffaf2;
  box-shadow: 0 10px 22px -16px rgba(245, 147, 0, 0.9);
}
.rk-pay-info { flex: 1; }
.rk-pay-info strong { display: block; font-size: 14.5px; color: var(--rk-ink); }
.rk-pay-info small { font-size: 12px; color: var(--rk-muted); }
.rk-pay-logos { display: flex; gap: 6px; align-items: center; color: var(--rk-navy); }

.rk-card-fields {
  margin-top: 4px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s var(--rk-ease), opacity 0.3s, margin 0.3s;
}
.rk-card-fields.is-open {
  max-height: 320px;
  opacity: 1;
  margin-top: 16px;
}

/* ---------- Order summary (checkout) ---------- */
.rk-order-items { display: flex; flex-direction: column; }
.rk-order-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rk-line);
}
.rk-order-item:last-child { border-bottom: 0; }
.rk-order-item img { width: 54px; height: 44px; border-radius: 9px; object-fit: cover; background: #eef1f4; }
.rk-order-item__name { font-size: 13.5px; font-weight: 600; color: var(--rk-ink); line-height: 1.3; margin: 0 0 3px; }
.rk-order-item__meta { font-size: 12px; color: var(--rk-muted); margin: 0; }
.rk-order-item__price { font-size: 14px; font-weight: 700; color: var(--rk-navy); white-space: nowrap; }
.rk-qty-pill {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: var(--rk-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 100px;
  padding: 1px 7px;
  margin-right: 4px;
}

/* ---------- Success modal ---------- */
.rk-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 24, 44, 0.6);
}
.rk-modal.is-open { display: flex; }
.rk-modal__box {
  background: #fff;
  border-radius: 22px;
  padding: 44px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: rkPop 0.45s var(--rk-ease) both;
}
@keyframes rkPop {
  from { opacity: 0; transform: translateY(20px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}
.rk-modal__check {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: #eaf7ef;
  display: grid;
  place-items: center;
  color: #1f9d55;
}
.rk-modal__check svg { width: 44px; height: 44px; }
.rk-modal__box h3 {
  font-family: "Poppins", "Inter", sans-serif;
  color: var(--rk-ink);
  font-size: 24px;
  margin-bottom: 10px;
}
.rk-modal__box p { color: var(--rk-body); margin-bottom: 8px; }
.rk-modal__order {
  font-size: 13px;
  color: var(--rk-navy);
  font-weight: 700;
  margin-bottom: 26px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .rk-shop-grid, .rk-checkout-grid { grid-template-columns: 1fr; }
  .rk-summary { position: static; }
  .rk-checkout-grid .rk-summary-col { order: -1; }
}
@media (max-width: 575px) {
  .rk-line {
    grid-template-columns: 68px 1fr;
    grid-template-rows: auto auto;
    gap: 12px 14px;
  }
  .rk-line__img { width: 68px; height: 54px; }
  .rk-line__right {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .rk-grid-2 { grid-template-columns: 1fr; }
  .rk-field.rk-col-2 { grid-column: auto; }
  .rk-lines, .rk-card-head, .rk-cart-actions, .rk-summary__body, .rk-form-section { padding-left: 18px; padding-right: 18px; }
  .rk-cart-actions .rk-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .rk-line, .rk-modal__box, .rk-card-fields { animation: none !important; transition: none !important; }
}
