/* ==============================================
   eMarket — Components: Badges, Botones, Hero Shapes,
   Forms, Toast, Modal, Footer, WhatsApp, Tabs,
   Steps, Grids, Empty State
   ============================================== */

/* ========== BADGE ========== */
.badge {
  display: inline-block;
  padding: .25rem .85rem;
  border-radius: var(--radius-full);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(0,123,255,.13);
  color: var(--primary-500);
  margin-bottom: .75rem;
}
.badge--secondary { background: rgba(0,170,255,.13); color: var(--secondary-500); }
.badge--accent    { background: rgba(8,0,255,.10);   color: var(--accent-500); }
.badge--success   { background: rgba(37,211,102,.13); color: #16a34a; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.6rem;
  border-radius: var(--radius-md);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

.btn--primary {
  background: var(--primary-500);
  color: #fff;
}
.btn--primary:hover {
  background: var(--primary-600);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,123,255,.35);
}

.btn--secondary {
  background: var(--secondary-500);
  color: #fff;
}
.btn--secondary:hover {
  background: var(--secondary-600);
  color: #fff;
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--primary-500);
  border: 1.5px solid var(--primary-500);
}
.btn--outline:hover {
  background: var(--primary-500);
  color: #fff;
  transform: translateY(-2px);
}

.btn--ghost {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  background: rgba(255,255,255,.22);
  color: #fff;
  transform: translateY(-2px);
}

.btn--sm  { padding: .45rem 1rem; font-size: .85rem; }
.btn--lg  { padding: .9rem 2rem;  font-size: 1.05rem; }
.btn--full{ width: 100%; }

.btn--whatsapp {
  background: #25d366;
  color: #fff;
}
.btn--whatsapp:hover {
  background: #20ba5a;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,211,102,.35);
}

/* ========== HERO SHAPES ========== */
.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: .12;
  filter: blur(60px);
}
.shape--1 { width: 500px; height: 500px; background: var(--primary-500); top: -100px; right: -80px; }
.shape--2 { width: 350px; height: 350px; background: var(--secondary-500); bottom: -60px; left: 20%; }
.shape--3 { width: 250px; height: 250px; background: var(--accent-500); top: 40%; left: -50px; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 1.25rem; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--text-main);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card-alt);
  color: var(--text-main);
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(0,123,255,.15);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
.form-group .field-error {
  font-size: .78rem;
  color: #ef4444;
  margin-top: .3rem;
  display: none;
}
.form-group.has-error .field-error { display: block; }
.form-group textarea { resize: vertical; min-height: 110px; }

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ========== TOAST ========== */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toast-in .3s ease;
}
.toast.toast-out { animation: toast-out .3s ease forwards; }
.toast__icon { font-size: 1.2rem; flex-shrink: 0; margin-top: .05rem; }
.toast__body { flex: 1; }
.toast__title { font-size: .9rem; font-weight: 600; color: var(--text-main); }
.toast__msg   { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }
.toast__close {
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}
.toast--success { border-left: 3px solid #22c55e; }
.toast--error   { border-left: 3px solid #ef4444; }
.toast--info    { border-left: 3px solid var(--primary-500); }
.toast--warning { border-left: 3px solid #f59e0b; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); }   to { opacity: 0; transform: translateX(100%); } }

/* ========== MODAL ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fade-in .2s ease;
}
.modal-backdrop.closing { animation: fade-out .2s ease forwards; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in .25s ease;
}
.modal-backdrop.closing .modal { animation: modal-out .25s ease forwards; }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.modal__title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.modal__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.modal__close:hover { background: var(--bg-card-alt); color: var(--text-main); }
.modal__body    { padding: 1.5rem 1.75rem; }
.modal__footer  { padding: 1rem 1.75rem 1.5rem; display: flex; gap: .75rem; justify-content: flex-end; }

@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-in  { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes modal-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.95); } }

/* ========== CONTACT INFO ITEM ========== */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  margin-bottom: .85rem;
}
.contact-item__icon { font-size: 1.5rem; flex-shrink: 0; }
.contact-item strong { display: block; font-size: .9rem; margin-bottom: .2rem; color: var(--text-main); }
.contact-item p     { font-size: .85rem; margin: 0; }

/* ========== FOOTER ========== */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,.7);
  padding: 3.5rem 0 0;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer__brand p {
  font-size: .87rem;
  color: rgba(255,255,255,.5);
  margin-top: .85rem;
  max-width: 280px;
  line-height: 1.65;
}
.footer__brand .navbar__logo { color: #fff; justify-content: flex-start; }
.footer__brand .navbar__logo:hover { transform: none; }
.footer__brand .navbar__logo .logo-name { color: var(--primary-500); }
.footer__social {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
}
.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
  transition: background .2s, color .2s;
}
.footer__social a:hover {
  background: var(--primary-500);
  color: #fff;
}
.footer__col-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.9);
  margin-bottom: 1rem;
}
.footer__col ul { display: flex; flex-direction: column; gap: .55rem; }
.footer__col a  { font-size: .87rem; color: rgba(255,255,255,.5); }
.footer__col a:hover { color: var(--primary-400); }
.footer__col li:not(:has(a)) { font-size: .87rem; color: rgba(255,255,255,.5); }
.footer__bottom {
  padding: 1.25rem 0;
}
.footer__bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.footer__bottom p { font-size: .82rem; color: rgba(255,255,255,.65); }

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ========== WHATSAPP FLOTANTE ========== */
.whatsapp-float {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 58px; height: 58px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  z-index: 999;
  transition: transform .25s, box-shadow .25s;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  color: #fff;
  box-shadow: 0 6px 28px rgba(37,211,102,.55);
}

/* ========== COOKIE BANNER ========== */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  padding: 1rem 0;
  transform: translateY(100%);
  transition: transform .3s ease;
}
.cookie-banner--visible { transform: translateY(0); }
.cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.cookie-banner__text {
  flex: 1;
  min-width: 220px;
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.cookie-banner__text a { color: var(--primary-500); text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: .65rem; flex-shrink: 0; }
.has-cookie-banner .whatsapp-float { bottom: 6rem; }

/* ========== FOOTER LEGAL LINKS ========== */
.footer__legal { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.footer__legal a { font-size: .82rem; color: rgba(255,255,255,.65); transition: color .2s; }
.footer__legal a:hover { color: var(--primary-400); }
.footer__legal span { color: rgba(255,255,255,.45); font-size: .82rem; }

/* ========== LEGAL CONTENT ========== */
.legal-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 0 4rem;
}
.legal-content h2 {
  font-size: 1.2rem;
  margin: 2.25rem 0 .6rem;
  color: var(--text-main);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li {
  font-size: .93rem;
  color: var(--text-muted);
  line-height: 1.75;
}
.legal-content ul { padding-left: 1.25rem; margin: .5rem 0 1rem; }
.legal-content ul li { margin-bottom: .35rem; }
.legal-content strong { color: var(--text-main); }
.legal-last-update {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  opacity: .7;
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.tab-btn {
  padding: .55rem 1.3rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.tab-btn:hover { border-color: var(--primary-500); color: var(--primary-500); }
.tab-btn.active {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: #fff;
}

/* ========== STEP INDICATOR ========== */
.steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  width: calc(100% - 12px);
  min-width: 60px;
  height: 2px;
  background: var(--border-color);
  transition: background .3s;
}
.step-item.done::after { background: var(--primary-500); }

.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all .3s;
  position: relative;
  z-index: 1;
}
.step-item.active .step-circle {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: #fff;
}
.step-item.done .step-circle {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: #fff;
}
.step-label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.step-item.active .step-label { color: var(--primary-500); font-weight: 600; }

/* ========== GRIDS RESPONSIVE ========== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ========== ESTADO VACÍO ========== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p     { font-size: .95rem; }

/* ===== PROMO BANNER ===== */
.promo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.promo-banner__left {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
}
.promo-banner__tag {
  font-size: .8rem;
  font-weight: 700;
  background: rgba(0,0,0,.2);
  border-radius: 999px;
  padding: .25rem .75rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.promo-banner strong {
  font-size: .95rem;
}

/* Countdown */
.promo-countdown {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}
.promo-countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,.25);
  border-radius: .4rem;
  padding: .25rem .55rem;
  min-width: 44px;
}
.promo-countdown__unit strong {
  font-size: 1.1rem;
  line-height: 1.2;
  font-weight: 800;
}
.promo-countdown__unit small {
  font-size: .58rem;
  opacity: .85;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.promo-countdown__sep {
  font-size: 1.2rem;
  font-weight: 800;
  opacity: .6;
  margin-bottom: .6rem;
}

/* Precio con descuento en tabla */
.price-original {
  display: block;
  font-size: .82rem;
  font-weight: 400;
  opacity: .55;
  text-decoration: line-through;
}
.price-discounted {
  display: inline;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-500);
}
.promo-badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 999px;
  margin-left: .3rem;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .promo-banner { justify-content: center; text-align: center; }
  .promo-banner__left { justify-content: center; }
}
