/* ==========================================================================
   Calendar Page Styles
   Compact toolbar + compact event cards, strong month landmarks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Calendar Toolbar (sticky, replaces hero + filter bar)
   Title left, controls right in one row. Sticks below header.
   -------------------------------------------------------------------------- */
.calendar-toolbar {
    margin-top: 70px;
    background: var(--white);
    padding: 16px 0;
    position: sticky;
    top: 70px;
    z-index: 100;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* WP Admin Bar offset.

   Header heights: 70px desktop, 60px mobile (≤782px). Admin bar: 32 / 46.

   IMPORTANT: WordPress injects `html { margin-top: 32px }` (46 on mobile)
   when the admin bar is visible, which already pushes the main flow down
   by the admin bar height. So `.calendar-toolbar`'s `margin-top` must
   only account for the HEADER, not the admin bar — otherwise we double-
   count and a 32/46px gap appears above the toolbar. The sticky `top`
   value DOES need both (it's measured from the viewport, not the flow). */
.admin-bar .calendar-toolbar {
    /* margin-top inherited from base = 70px (header only) */
    top: 102px; /* 70 header + 32 bar */
}

@media (max-width: 782px) {
    /* Non-admin mobile: header is 60px, not 70. */
    .calendar-toolbar {
        margin-top: 60px;
        top: 60px;
    }
    .admin-bar .calendar-toolbar {
        /* margin-top still 60 (header only); admin bar already in html. */
        top: 106px; /* 60 mobile header + 46 mobile bar */
    }
}

.calendar-toolbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 24px;
}

.calendar-toolbar__title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    line-height: 1;
    flex-shrink: 0;
}

.calendar-toolbar__controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* --------------------------------------------------------------------------
   Filter Buttons
   -------------------------------------------------------------------------- */
.filter-buttons {
    display: flex;
    gap: 6px;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #e5e7eb;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    text-decoration: none;
}

.filter-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: #faf5ff;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.25);
}

/* --------------------------------------------------------------------------
   Year Navigator
   -------------------------------------------------------------------------- */
.year-navigator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.year-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 13px;
    text-decoration: none;
}

.year-nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #faf5ff;
}

.year-nav-btn.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.year-label {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    min-width: 52px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Workshop Filter Banner
   -------------------------------------------------------------------------- */
.workshop-filter-banner {
    background: #faf5ff;
    border-bottom: 1px solid #e9d5ff;
}

.workshop-filter-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 20px;
    gap: 16px;
}

.workshop-filter-banner__text {
    font-size: 13px;
    color: var(--text-light);
}

.workshop-filter-banner__text strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.workshop-filter-banner__clear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid #e9d5ff;
    background: var(--white);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.workshop-filter-banner__clear:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.workshop-filter-banner__clear .icon {
    width: 12px;
    height: 12px;
}

/* --------------------------------------------------------------------------
   Events Section
   -------------------------------------------------------------------------- */
.events-section {
    background: var(--bg-light);
    padding: 28px 0 60px;
    min-height: 400px;
}

.events-section > .container {
    max-width: 960px;
}

/* --------------------------------------------------------------------------
   Month Group Headers — strong landmarks
   -------------------------------------------------------------------------- */
.month-group-header {
    padding: 36px 0 14px;
}

.month-group-header:first-child {
    padding-top: 4px;
}

.month-group-header h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.month-group-header h3::before {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Event Card — Compact 4-column grid
   [image 72px] [date 68px] [body 1fr] [actions auto]
   -------------------------------------------------------------------------- */
.event-card {
    display: grid;
    grid-template-columns: 72px 68px 1fr auto;
    gap: 0 18px;
    align-items: start;
    background: var(--white);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   Image Column — small square thumbnail with rounded corners
   that echo the card's outer radius.
   -------------------------------------------------------------------------- */
.event-image {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #4c1d95, #8b5cf6);
    flex-shrink: 0;
    align-self: center;
    text-decoration: none;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --------------------------------------------------------------------------
   Date Column — typographic, no gradient
   -------------------------------------------------------------------------- */
.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1px;
}

.event-date__day {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
    white-space: nowrap;
}

.event-date__month {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Body Column — title, badges, meta
   -------------------------------------------------------------------------- */
.event-body {
    min-width: 0;
}

.event-body__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.event-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
    margin: 0;
}

.event-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.event-title a:hover {
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.event-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.6;
}

.event-badge .icon {
    font-size: 9px;
    width: 10px;
    height: 10px;
}

.badge-online {
    background: #f3e8ff;
    color: var(--primary);
    border: 1px solid rgba(216, 180, 254, 0.6);
}

.badge-presencial {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid rgba(252, 211, 77, 0.6);
}

.badge-sold-out,
.badge-agotado {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid rgba(252, 165, 165, 0.6);
}

.badge-cancelado {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.badge-pospuesto {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid rgba(254, 240, 138, 0.6);
}

/* --------------------------------------------------------------------------
   Meta Items — scannable row of icon + text
   -------------------------------------------------------------------------- */
.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: var(--text-light);
}

.event-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.event-meta__item .icon {
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.75;
    width: 14px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Actions Column — CTA + link, right-aligned, vertically centered in card
   -------------------------------------------------------------------------- */
.event-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    align-self: center;
}

/* --------------------------------------------------------------------------
   Buttons — compact versions for card context
   -------------------------------------------------------------------------- */
/* Metricas compartidas por todos los botones de accion de un evento.
   Antes .btn-inscripcion pisaba con 14px 26px / 14px mientras estos quedaban
   en 7px 18px / 13px, y "Reservar" se veia achatado al lado de "Inscripcion". */
.btn-event-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 14px 26px;
    border-radius: 50px;
    font-size: 14px;
    /* line-height explicito: "Reservar" es un <a> y hereda el 1.6 del body,
       mientras que "Inscripcion" es un <button> y el navegador le aplica
       `normal` (~1.2). Con el mismo padding eso daba 50.4px contra 44.8px.
       Fijandolo aca, los dos botones miden igual sin importar la etiqueta. */
    line-height: 1.6;

    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    box-shadow: 0 6px 14px -4px rgba(124, 58, 237, 0.32);
}

.btn-event-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 8px 18px -4px rgba(124, 58, 237, 0.4);
}

.btn-event-primary:disabled,
.btn-event-primary.disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
}

.btn-event-outline {
    background: transparent;
    color: var(--primary-dark);
    padding: 14px 26px;
    border-radius: 50px;
    font-size: 14px;
    /* line-height explicito: "Reservar" es un <a> y hereda el 1.6 del body,
       mientras que "Inscripcion" es un <button> y el navegador le aplica
       `normal` (~1.2). Con el mismo padding eso daba 50.4px contra 44.8px.
       Fijandolo aca, los dos botones miden igual sin importar la etiqueta. */
    line-height: 1.6;

    font-weight: 600;
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.btn-event-outline:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.04);
}

/* Inscripción CTA — promoted to filled gradient pill (matches the
   "Únete al seminario" button on the workshop detail page). Overrides
   the outline base so it reads as the primary action in the card. */
.btn-inscripcion.btn-event-outline,
/* Solo el color: el tamano ya viene de .btn-event-outline. */
.btn-event-outline.btn-inscripcion {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    box-shadow: 0 6px 14px -4px rgba(124, 58, 237, 0.32);
}

.btn-inscripcion.btn-event-outline:hover,
.btn-event-outline.btn-inscripcion:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    filter: brightness(1.05);
    box-shadow: 0 8px 18px -4px rgba(124, 58, 237, 0.4);
}

.btn-inscripcion.btn-event-outline .icon {
    width: 14px;
    height: 14px;
}

/* Loading state for buy button */
.btn-event-primary.is-loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

/* PayPal button */
.btn-paypal {
    gap: 6px;
}

/* Tip / Voluntary Contribution Selector */
.uw-tip-selector {
    width: 100%;
    margin-bottom: 8px;
}

.uw-tip-label {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    margin: 0 0 6px;
    font-weight: 500;
}

.uw-tip-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.uw-tip-chip {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    border: 1.5px solid rgba(124, 58, 237, 0.15);
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.uw-tip-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.uw-tip-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.uw-tip-custom-field {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.uw-tip-custom-field.show {
    display: flex;
}

.uw-tip-input {
    width: 80px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.15s;
}

.uw-tip-input:focus {
    border-color: var(--primary);
}

/* Hide spinner arrows on number input */
.uw-tip-input::-webkit-outer-spin-button,
.uw-tip-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.uw-tip-input[type=number] {
    -moz-appearance: textfield;
}

.uw-tip-currency {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.btn-event-link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 2px;
    transition: color 0.15s ease;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-event-link:hover {
    color: var(--primary-dark);
}

.btn-event-link .icon {
    font-size: 11px;
    transition: transform 0.15s ease;
}

.btn-event-link:hover .icon {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Event Warning — inline, compact
   -------------------------------------------------------------------------- */
.event-warning {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 3px 10px;
    background: #fefce8;
    border: 1px solid rgba(254, 240, 138, 0.6);
    border-radius: 6px;
    font-size: 11px;
    color: #854d0e;
}

.event-warning .icon {
    color: #ca8a04;
    flex-shrink: 0;
    font-size: 11px;
}

/* --------------------------------------------------------------------------
   Sold-Out / Canceled / Postponed States
   -------------------------------------------------------------------------- */
.event-card.sold-out,
.event-card.agotado {
    background: #fafafa;
}

.event-card.sold-out .event-title,
.event-card.sold-out .event-title a,
.event-card.agotado .event-title,
.event-card.agotado .event-title a {
    color: var(--text-light);
}

.event-card.sold-out .event-date__day,
.event-card.agotado .event-date__day {
    color: var(--text-light);
}

.event-card.sold-out .event-date__month,
.event-card.agotado .event-date__month {
    color: #d1d5db;
}

.event-card.sold-out:hover,
.event-card.agotado:hover {
    border-color: rgba(226, 232, 240, 0.6);
    box-shadow: none;
}

.event-card.cancelado {
    background: #fafafa;
    opacity: 0.5;
}

.event-card.cancelado:hover {
    border-color: rgba(226, 232, 240, 0.6);
    box-shadow: none;
}

.event-card.pospuesto {
    background: #fffef5;
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
    display: none;
    text-align: center;
    padding: 72px 20px;
}

.empty-state.show {
    display: block;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: #f3e8ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-state-icon .icon {
    font-size: 26px;
    color: var(--primary-light);
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-light);
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Responsive — Tablet (768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .calendar-toolbar {
        margin-top: 60px;
        top: 60px;
        padding: 14px 0;
    }

    .calendar-toolbar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .calendar-toolbar__title {
        font-size: 22px;
        text-align: center;
    }

    .calendar-toolbar__controls {
        justify-content: space-between;
    }

    /* Cards: 3-column (image + date + body) with actions below */
    .event-card {
        grid-template-columns: 56px 56px 1fr;
        gap: 6px 12px;
        padding: 12px 14px;
    }

    .event-image {
        width: 56px;
        height: 56px;
        border-radius: 9px;
    }

    .event-actions {
        grid-column: 1 / -1;
        padding-top: 10px;
        margin-top: 4px;
        border-top: 1px solid #f1f5f9;
        flex-wrap: wrap;
    }

    .event-warning {
        grid-column: 1 / -1;
    }

    .event-date__day {
        font-size: 20px;
    }

    .event-title {
        font-size: 15px;
    }

    .month-group-header {
        padding: 28px 0 10px;
    }

    .month-group-header h3 {
        font-size: 18px;
    }
}

/* --------------------------------------------------------------------------
   Responsive — Mobile (480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    /* Vertical: nudge up — a bit more air above title, a bit more
       breathing room before pills, a bit more below the controls. */
    .calendar-toolbar {
        padding: 20px 0 16px;
    }
    .calendar-toolbar__inner {
        gap: 18px;
    }
    /* Title keeps its mobile 22px from the ≤782px block — original size. */

    /* All / Online / In-Person + ← 2026 → centered as a single cluster
       with a tight gap between the two halves (NOT space-between, which
       leaves a chasm in the middle). Slightly bumped sizes for tap-
       comfort on phone. */
    .calendar-toolbar__controls {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: 16px;
        width: 100%;
    }

    .filter-buttons {
        gap: 6px;
        flex-shrink: 0;
    }

    .filter-btn {
        padding: 9px 16px;
        font-size: 13px;
        min-height: 0;
    }

    .year-navigator {
        gap: 10px;
        flex-shrink: 0;
    }

    .year-nav-btn {
        width: 36px;
        height: 36px;
    }

    .year-label {
        font-size: 19px;
        min-width: 56px;
    }

    .year-label {
        font-size: 16px;
    }

    /* Cards: image left (spans date+body rows), date+body stacked on the right,
       actions full-width below. Title in body__header wraps to multiple lines as needed. */
    .event-card {
        grid-template-columns: 52px 1fr;
        gap: 4px 12px;
        padding: 12px 14px;
    }

    .event-image {
        display: block;
        width: 52px;
        height: 52px;
        border-radius: 9px;
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: start;
        margin-top: 2px;
    }

    .event-date {
        grid-column: 2;
        flex-direction: row;
        gap: 6px;
        align-items: baseline;
        justify-content: flex-start;
    }

    .event-body {
        grid-column: 2;
    }

    .event-date__day {
        font-size: 18px;
    }

    .event-date__month {
        font-size: 11px;
        margin-top: 0;
    }

    .event-body__header {
        gap: 6px;
    }

    .event-meta {
        gap: 10px;
        font-size: 12px;
    }

    /* Mobile: keep the separator bar (cascades from 768px) and center the link. */
    .event-actions {
        justify-content: center;
        padding-top: 10px;
        margin-top: 4px;
    }

    /* Los tres bajan juntos. Antes .btn-inscripcion se salvaba de esta regla
       por especificidad (0-2-0 contra 0-1-0) y quedaba grande en movil. */
    .btn-event-primary,
    .btn-event-outline {
        padding: 12px 20px;
        font-size: 13px;
    }

    .month-group-header h3 {
        font-size: 17px;
    }

    .empty-state {
        padding: 48px 20px;
    }

    .empty-state h3 {
        font-size: 17px;
    }

    .empty-state p {
        font-size: 13px;
    }

    .workshop-filter-banner__inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
