/* Mega Desistimiento - front office styles */

.megadesist-wrapper {
  --md-accent: #FF4013;
  --md-accent-dark: #d9330a;
  --md-border: #e6e6e6;
  --md-muted: #717171;
  --md-bg-soft: #faf7f5;
  max-width: 820px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Card */
.megadesist-card {
  background: #fff;
  border: 1px solid var(--md-border);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .06);
  overflow: hidden;
}
.megadesist-card-head {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--md-accent), var(--md-accent-dark));
  color: #fff;
}
.megadesist-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, .18);
  border-radius: 12px;
}
.megadesist-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  color: #fff;
}
.megadesist-subtitle {
  margin: 4px 0 0;
  font-size: .9rem;
  opacity: .92;
}

/* Body */
.megadesist-formbody { padding: 24px 28px 28px; }

.megadesist-fieldset {
  border: 0;
  border-top: 1px solid var(--md-border);
  margin: 0;
  padding: 22px 0 4px;
}
.megadesist-fieldset:first-of-type { border-top: 0; padding-top: 6px; }
.megadesist-legend {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--md-accent-dark);
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  width: auto;
}

/* Grid of fields */
.megadesist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
@media (max-width: 560px) { .megadesist-grid { grid-template-columns: 1fr; } }

.megadesist-field { display: flex; flex-direction: column; margin-bottom: 4px; }
.megadesist-field label { font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.megadesist-field small { color: var(--md-muted); font-size: .8rem; margin-top: 5px; }

.megadesist-field input,
.megadesist-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--md-border);
  border-radius: 9px;
  font-size: .95rem;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.megadesist-field input:focus,
.megadesist-field textarea:focus {
  outline: 0;
  border-color: var(--md-accent);
  box-shadow: 0 0 0 3px rgba(255, 64, 19, .15);
}

/* Scope options */
.megadesist-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) { .megadesist-options { grid-template-columns: 1fr; } }
.megadesist-option { position: relative; cursor: pointer; margin: 0; }
.megadesist-option input { position: absolute; opacity: 0; }
.megadesist-option-box {
  display: block;
  padding: 14px 16px;
  border: 2px solid var(--md-border);
  border-radius: 11px;
  transition: border-color .15s, background .15s;
  height: 100%;
}
.megadesist-option-box strong { display: block; font-size: .95rem; }
.megadesist-option-box span { display: block; color: var(--md-muted); font-size: .82rem; margin-top: 3px; }
.megadesist-option input:checked + .megadesist-option-box {
  border-color: var(--md-accent);
  background: var(--md-bg-soft);
}
.megadesist-option input:focus-visible + .megadesist-option-box {
  box-shadow: 0 0 0 3px rgba(255, 64, 19, .15);
}
.megadesist-items { margin-top: 16px; }

/* Logged-in item picker */
.megadesist-itemlist-title {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: .92rem;
}
.megadesist-itemlist {
  border: 1px solid var(--md-border);
  border-radius: 10px;
  overflow: hidden;
}
.megadesist-itemlist-msg {
  margin: 0;
  padding: 14px 16px;
  color: var(--md-muted);
  font-size: .88rem;
}
.megadesist-itemrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--md-border);
  transition: background .15s;
}
.megadesist-itemrow:first-child { border-top: 0; }
.megadesist-itemrow.is-selected { background: var(--md-bg-soft); }
.megadesist-itemcheck {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
  flex: 1 1 auto;
}
.megadesist-itemcheck input { width: 18px; height: 18px; flex: 0 0 auto; }
.megadesist-itemname { font-weight: 600; }
.megadesist-itemname small { color: var(--md-muted); font-weight: 400; }
.megadesist-itemqty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--md-muted);
  font-size: .85rem;
}
.megadesist-itemqty input {
  width: 68px;
  padding: 7px 9px;
  border: 1px solid var(--md-border);
  border-radius: 8px;
  font-size: .9rem;
}
.megadesist-itemqty input:disabled { background: #f3f3f3; color: #aaa; }

/* Non-returnable items */
.megadesist-itemrow.is-noreturn { background: #fafafa; opacity: .75; }
.megadesist-itemrow.is-noreturn .megadesist-itemname { color: var(--md-muted); }
.megadesist-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fdecea;
  color: #a11;
  border: 1px solid #f5c6c0;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .megadesist-itemrow { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Privacy + alerts */
.megadesist-privacy {
  font-size: .82rem;
  color: var(--md-muted);
  background: var(--md-bg-soft);
  border-radius: 9px;
  padding: 12px 14px;
  margin: 18px 0 0;
}
.megadesist-alert {
  border-radius: 9px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.megadesist-alert--error { background: #fdecea; border: 1px solid #f5c6c0; color: #a11; }
.megadesist-errors { margin: 0; padding-left: 1.1rem; }

/* Submit */
.megadesist-actions { margin-top: 24px; }
.megadesist-btn {
  display: inline-block;
  width: 100%;
  padding: 14px 22px;
  background: var(--md-accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.megadesist-btn:hover { background: var(--md-accent-dark); }
.megadesist-btn:active { transform: translateY(1px); }
.megadesist-btn:disabled,
.megadesist-btn.is-disabled {
  background: #c8c8c8;
  cursor: not-allowed;
  transform: none;
}

/* Honeypot */
.megadesist-hp {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  height: 0; width: 0; overflow: hidden;
}

/* Footer button / link (hooks) */
.megadesist-footer { width: 100%; padding: .75rem 0; }
.megadesist-align-left { text-align: left; }
.megadesist-align-center { text-align: center; }
.megadesist-align-right { text-align: right; }
.megadesist-footer-btn { display: inline-block; font-weight: 600; }
.megadesist-footer-link { text-decoration: underline; }
.megadesist-account-card .material-icons { vertical-align: middle; }
