/**
 * Remates Lote21. Usa los tokens del tema Ganados Pro con valores de respaldo,
 * y variables propias (--l21-*) que el widget de Elementor puede cambiar.
 */

.l21 {
    --l21-accent: var(--gp-color-primary-agro, #2e7d32);
    --l21-surface: var(--gp-color-surface, #fff);
    --l21-alt: var(--gp-color-bg-alt, #f6f7f6);
    --l21-border: var(--gp-color-border, #e0e0e0);
    --l21-text: var(--gp-color-text, #212121);
    --l21-muted: var(--gp-color-text-secondary, #6b6b6b);
    --l21-live: #d32f2f;
    --l21-radius: 0.75rem;
    --l21-gap: 1.5rem;
    color: var(--l21-text);
    font-family: var(--gp-font-primary, inherit);
}

.l21 a { color: inherit; }
.l21-title { margin: 0 0 1.25rem; font-size: 1.5rem; font-weight: 700; color: var(--l21-text); }
.l21-none, .l21-empty { margin: 0; padding: 1.25rem; border: 1px dashed var(--l21-border, #ccc); border-radius: var(--l21-radius, 0.75rem); color: var(--l21-muted, #6b6b6b); text-align: center; }

/* Fecha destacada */
.l21-date { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 3.5rem; padding: 0.375rem 0.5rem; border-radius: calc(var(--l21-radius) * 0.75); background: var(--l21-accent); color: #fff; line-height: 1; text-align: center; }
.l21-date-day { font-size: 1.375rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.l21-date-month { margin-top: 0.25rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.l21-date-lg { min-width: 4.5rem; padding: 0.625rem; }
.l21-date-lg .l21-date-day { font-size: 1.875rem; }

/* Etiquetas */
.l21-badge { display: inline-flex; align-items: center; gap: 0.375rem; margin-top: 0.375rem; padding: 0.125rem 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-decoration: none; }
.l21-badge-live { background: var(--l21-live); color: #fff !important; }
.l21-badge-today { background: color-mix(in srgb, var(--l21-accent) 15%, transparent); color: var(--l21-accent); }
.l21-badge-past { background: var(--l21-alt); color: var(--l21-muted); }
.l21-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #fff; animation: l21-pulse 1.4s ease-in-out infinite; }
@keyframes l21-pulse { 50% { opacity: 0.3; } }

/* Datos */
.l21-meta { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.9375rem; color: var(--l21-muted); }
.l21-meta li { display: grid; grid-template-columns: 1.125rem 1fr; gap: 0.5rem; align-items: baseline; overflow-wrap: anywhere; }
.l21-meta i { color: var(--l21-accent); text-align: center; }
.l21-deadline { color: var(--l21-text); font-weight: 600; }

/* Botones */
.l21-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 1.25rem; }
.l21-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.5rem; padding: 0.5rem 1rem; border: 1px solid var(--l21-border); border-radius: calc(var(--l21-radius) * 0.66); background: var(--l21-surface); color: var(--l21-text) !important; font-size: 0.875rem; font-weight: 600; text-decoration: none; transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
.l21-btn:hover { border-color: var(--l21-accent); color: var(--l21-accent) !important; }
.l21-btn-primary { flex: 1; background: var(--l21-accent); border-color: var(--l21-accent); color: #fff !important; }
.l21-btn-primary:hover { background: color-mix(in srgb, var(--l21-accent) 85%, #000); color: #fff !important; }
.l21-btn-icon { width: 2.5rem; padding: 0; }
.l21-btn:focus-visible, .l21 a:focus-visible, .l21 button:focus-visible { outline: 2px solid var(--l21-accent); outline-offset: 2px; }

/* Agregar a mi calendario: botón + menú de calendarios */
.l21-addcal { position: relative; display: flex; flex: 1; gap: 1px; }
.l21-addcal .l21-addcal-main { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.l21-addcal-toggle { width: 2.75rem; padding: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; background: var(--l21-accent); border-color: var(--l21-accent); color: #fff !important; cursor: pointer; }
.l21-addcal-toggle:hover { background: color-mix(in srgb, var(--l21-accent) 85%, #000); border-color: color-mix(in srgb, var(--l21-accent) 85%, #000); color: #fff !important; }
.l21-addcal-toggle i { transition: transform 200ms ease; }
.l21-addcal-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.l21-addcal-menu { position: absolute; z-index: 20; left: 0; right: 0; bottom: calc(100% + 0.375rem); display: grid; padding: 0.375rem; background: var(--l21-surface); border: 1px solid var(--l21-border); border-radius: calc(var(--l21-radius) * 0.75); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); }
.l21-addcal-menu[hidden] { display: none; }
.l21-addcal-menu a { display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; padding: 0.5rem 0.75rem; border-radius: calc(var(--l21-radius) * 0.5); color: var(--l21-text) !important; font-size: 0.875rem; font-weight: 600; text-decoration: none; }
.l21-addcal-menu a:hover, .l21-addcal-menu a:focus-visible { background: var(--l21-alt); outline: none; }
.l21-addcal-menu i { width: 1.125rem; text-align: center; color: var(--l21-accent); }
.l21-ev-ics, .l21-list-go { cursor: pointer; }

/* Tarjetas */
.l21-cards { --l21-cols: var(--l21-cols-max, 3); display: grid; grid-template-columns: repeat(var(--l21-cols), minmax(0, 1fr)); gap: var(--l21-gap); }
.l21-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--l21-surface); border: 1px solid var(--l21-border); border-radius: var(--l21-radius); box-shadow: var(--gp-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05)); }
.l21-card.is-past { opacity: 0.75; }
.l21-card-poster { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--l21-alt); }
.l21-card-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.l21-card-body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem; }
.l21-card-top { display: flex; gap: 0.875rem; align-items: flex-start; }
.l21-card-head { min-width: 0; }
.l21-card-title { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.l21-card-title a { text-decoration: none; }
.l21-card-title a:hover { color: var(--l21-accent); }

/* Lista compacta */
.l21-list { list-style: none; margin: 0; padding: 0; background: var(--l21-surface); border: 1px solid var(--l21-border); border-radius: var(--l21-radius); overflow: hidden; }
.l21-list-item { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 0.875rem 1.125rem; border-top: 1px solid var(--l21-border); }
.l21-list-item:first-child { border-top: 0; }
.l21-list-item.is-past { opacity: 0.7; }
.l21-list-info { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.5rem; }
.l21-list-info .l21-badge { margin-top: 0; }
.l21-list-title { font-weight: 700; text-decoration: none; }
.l21-list-title:hover { color: var(--l21-accent); }
.l21-list-meta { flex-basis: 100%; margin-top: 0.25rem; font-size: 0.875rem; color: var(--l21-muted); overflow-wrap: anywhere; }
.l21-list-go { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--l21-border); color: var(--l21-accent) !important; text-decoration: none; }
.l21-list-go:hover { background: var(--l21-accent); border-color: var(--l21-accent); color: #fff !important; }

/* Próximo remate destacado */
.l21-featured { display: grid; grid-template-columns: 1fr; overflow: hidden; background: var(--l21-surface); border: 1px solid var(--l21-border); border-radius: var(--l21-radius); border-top: 4px solid var(--l21-accent); }
.l21-featured.has-poster { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.l21-featured-poster { display: block; width: 100%; height: 100%; min-height: 220px; object-fit: cover; background: var(--l21-alt); }
.l21-eyebrow { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--l21-accent); }
.l21-featured-title { margin: 0.25rem 0 0; font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.l21-featured-body { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-content: start; padding: 1.5rem; }
.l21-featured-body > .l21-meta, .l21-featured-body > .l21-countdown, .l21-featured-body > .l21-actions { grid-column: 1 / -1; }
.l21-featured-body > .l21-date { align-self: start; }
.l21-countdown { display: flex; gap: 0.5rem; margin-top: 1.25rem; }
.l21-countdown span { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0.625rem 0.25rem; background: var(--l21-alt); border: 1px solid var(--l21-border); border-radius: calc(var(--l21-radius) * 0.66); font-size: 0.75rem; color: var(--l21-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.l21-countdown b { font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: var(--l21-text); font-variant-numeric: tabular-nums; text-transform: none; }
.l21-countdown.is-live { justify-content: center; padding: 0.75rem; border-radius: calc(var(--l21-radius) * 0.66); background: var(--l21-live); color: #fff; font-weight: 700; }

/* Calendario mensual */
.l21-calendar { padding: 1.25rem; background: var(--l21-surface); border: 1px solid var(--l21-border); border-radius: var(--l21-radius); }
.l21-cal-nav { display: none; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.l21-calendar.is-js .l21-cal-nav { display: flex; }
.l21-calendar.is-js .l21-month-title { display: none; }
.l21-cal-label { font-size: 1.125rem; font-weight: 700; }
.l21-cal-nav button { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--l21-border); border-radius: 50%; background: var(--l21-surface); color: var(--l21-text); cursor: pointer; transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease; }
.l21-cal-nav button:hover:not(:disabled) { background: var(--l21-accent); border-color: var(--l21-accent); color: #fff; }
.l21-cal-nav button:disabled { opacity: 0.35; cursor: default; }
.l21-month-title { margin: 1.5rem 0 0.75rem; font-size: 1.125rem; }
.l21-month:first-of-type .l21-month-title { margin-top: 0; }
.l21-dow, .l21-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.25rem; }
.l21-dow span { padding: 0.25rem 0; font-size: 0.75rem; font-weight: 700; text-align: center; text-transform: uppercase; color: var(--l21-muted); }
.l21-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: calc(var(--l21-radius) * 0.5); font-size: 0.9375rem; font-variant-numeric: tabular-nums; text-decoration: none; }
.l21-day.is-past { color: var(--l21-muted); }
.l21-day.is-today { box-shadow: inset 0 0 0 2px var(--l21-accent); font-weight: 700; }
.l21-day.has-event { background: var(--l21-accent); color: #fff !important; font-weight: 800; cursor: pointer; transition: transform 150ms ease; }
.l21-day.has-event.is-past { background: color-mix(in srgb, var(--l21-accent) 40%, var(--l21-surface)); }
.l21-day.has-event:hover { transform: scale(1.08); }
.l21-month-events { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.l21-month-events li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 0.75rem; align-items: center; padding: 0.625rem 0.75rem; background: var(--l21-alt); border: 1px solid var(--l21-border); border-radius: calc(var(--l21-radius) * 0.66); transition: border-color 200ms ease, box-shadow 200ms ease; }
.l21-month-events li.is-past { opacity: 0.7; }
.l21-month-events li.is-focus { border-color: var(--l21-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--l21-accent) 25%, transparent); }
.l21-ev-date { font-size: 0.8125rem; font-weight: 700; text-transform: capitalize; color: var(--l21-accent); }
.l21-ev-info { min-width: 0; display: flex; flex-direction: column; }
.l21-ev-info a { font-weight: 700; text-decoration: none; }
.l21-ev-info a:hover { color: var(--l21-accent); }
.l21-ev-info small { font-size: 0.8125rem; color: var(--l21-muted); overflow-wrap: anywhere; }
.l21-ev-ics { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; color: var(--l21-accent) !important; text-decoration: none; }
.l21-ev-ics:hover { background: var(--l21-surface); }
.l21-calendar .l21-none { margin-top: 1rem; padding: 0.75rem; }

/* Responsive */
@media (max-width: 1024px) {
    .l21-cards { --l21-cols: min(var(--l21-cols-max, 3), 2); }
    .l21-featured.has-poster { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 767px) {
    .l21-cards { --l21-cols: 1; }
    .l21-featured.has-poster { grid-template-columns: 1fr; }
    .l21-featured-poster { max-height: 260px; }
    .l21-featured-body, .l21-card-body, .l21-calendar { padding: 1rem; }
    .l21-featured-title { font-size: 1.25rem; }
    .l21-countdown b { font-size: 1.375rem; }
    .l21-month-events li { grid-template-columns: 1fr auto; }
    .l21-ev-date { grid-column: 1 / -1; }
    .l21-list-item { gap: 0.75rem; padding: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .l21-dot { animation: none; }
    .l21-day.has-event:hover { transform: none; }
}

[data-theme="dark"] .l21-day.has-event.is-past { color: var(--l21-text) !important; }
