:root {
    /* Colores corporativos Turismo Paraíso (ajusta si los hex son distintos) */
    --tp-cta-normal: #f2a20b;
    /* Naranjo botones estado normal */
    --tp-cta-hover: #e0301e;
    /* Rojo estado activo / hover */
    --tp-card-bg: #ffffff;
    --tp-border-soft: #e0e4ec;
    --tp-text-main: #111111;
    --tp-text-muted: #666666;
}

/* Contenedor general */
.tp-sorteo-wrapper {
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
    background: #ffffff;
}

/* Header */
.tp-sorteo-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--tp-text-main);
    text-align: center;
}

.tp-sorteo-subtitle {
    text-align: center;
    color: var(--tp-text-muted);
    margin-bottom: 1rem;
}

/* Variante para subtítulo solo admin (front) */
.tp-sorteo-subtitle--admin {
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

/* Barra de progreso */
.tp-progress-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #f3f4f6;
    overflow: hidden;
    margin: 10px auto 4px;
}

.tp-progress-bar__inner {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--tp-cta-normal), var(--tp-cta-hover));
    transition: width 0.4s ease;
}

.tp-progress-bar__label {
    text-align: center;
    font-size: 0.9rem;
    color: var(--tp-text-muted);
    margin-bottom: 1.5rem;
}

/* -------------------------------------------------
   COUNTDOWN – estilo mejorado con bloques
   ------------------------------------------------- */
.tp-countdown {
    margin: 30px auto 40px;
    padding: 20px;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.tp-countdown-title {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--tp-text-main);
    margin: 0;
    line-height: 1.4;
}

.tp-countdown-blocks {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tp-countdown-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 20px 24px;
    background: #ffffff;
    border: 2px solid var(--tp-cta-normal);
    /* Naranjo */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(242, 162, 11, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tp-countdown-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(242, 162, 11, 0.25);
}

.tp-countdown-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--tp-cta-hover);
    /* Rojo */
    line-height: 1;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Mono", monospace;
}

.tp-countdown-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tp-text-muted);
    margin-top: 8px;
}

/* Responsive countdown */
@media (max-width: 600px) {
    .tp-countdown {
        margin: 20px auto 30px;
        padding: 15px;
    }

    .tp-countdown-title {
        font-size: 1rem;
    }

    .tp-countdown-blocks {
        gap: 12px;
    }

    .tp-countdown-block {
        min-width: 85px;
        padding: 16px 20px;
    }

    .tp-countdown-number {
        font-size: 2rem;
    }

    .tp-countdown-label {
        font-size: 0.7rem;
    }
}

/* Tarjetas */
.tp-cards-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.tp-card {
    position: relative;
    background: var(--tp-card-bg);
    border-radius: 18px;
    border: 2px solid var(--tp-border-soft);
    padding: 22px 24px 26px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tp-card-featured {
    border-color: var(--tp-cta-hover);
    box-shadow: 0 16px 40px rgba(224, 48, 30, 0.18);
}

.tp-card-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--tp-text-muted);
    margin-bottom: 10px;
}

.tp-card-badge-featured {
    background: var(--tp-cta-hover);
    color: #ffffff;
}

.tp-card-title {
    font-size: 1.4rem;
    margin: 2px 0 4px;
    color: var(--tp-text-main);
}

.tp-card-subtitle {
    font-size: 0.95rem;
    margin: 0 0 10px;
    color: var(--tp-text-muted);
}

/* Precio en las tarjetas */
.tp-card-price {
    margin-bottom: 18px;
}

.tp-price-current {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--tp-text-main);
}

.tp-price-regular {
    margin-right: 8px;
    font-size: 1rem;
    color: var(--tp-text-muted);
}

.tp-price-regular del {
    color: var(--tp-text-muted);
}

.tp-price-sale {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tp-cta-hover);
}

/* Botones */
.tp-card-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--tp-cta-normal);
    color: #ffffff;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.tp-card-btn-featured {
    background: var(--tp-cta-hover);
}

.tp-card-btn:hover {
    background: var(--tp-cta-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Estado deshabilitado (sorteo agotado) */
.tp-btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #999 !important;
}

.tp-btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.tp-soldout-msg {
    color: var(--tp-cta-hover);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

/* Botón header deshabilitado */
a.header-btn-1.tp-header-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Precios en el carrito (precio tachado + promo) */
.tp-price-regular-cart del {
    color: var(--tp-text-muted);
}

.tp-price-sale-cart {
    color: var(--tp-cta-hover);
    font-weight: 600;
    margin-left: 4px;
}

/* Responsive general */
@media (max-width: 768px) {
    .tp-cards-container {
        grid-template-columns: 1fr;
    }

    .tp-sorteo-wrapper {
        padding: 15px;
    }
}

/* -------------------------------------------------
   Estilos genéricos para tablas del plugin
   (tp-table, tp-table-mis-tickets, tp-table-ganadores, etc.)
   ------------------------------------------------- */
.tp-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.tp-table th,
.tp-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e0e4ec;
}

.tp-table th {
    text-align: left;
    background: #f7f8fc;
    font-weight: 600;
    color: var(--tp-text-main);
}

/* -------------------------------------------------
   Tabla profesional con acordeón y paginación
   ------------------------------------------------- */
.tp-tickets-wrapper {
    margin: 20px 0;
}

.tp-table-pro {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.tp-table-pro th,
.tp-table-pro td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e4ec;
}

.tp-table-pro thead th {
    background: #f7f8fc;
    font-weight: 600;
    color: var(--tp-text-main);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.tp-table-pro tbody tr:hover {
    background: #f9fafb;
}

/* Fila de encabezado de pedido */
.tp-order-header-row {
    background: #fff7e6 !important;
    font-weight: 600;
}

.tp-order-header-row td {
    padding: 14px 16px;
    border-bottom: 2px solid var(--tp-cta-normal);
}

.tp-order-header-row strong {
    color: var(--tp-cta-hover);
}

/* Botón de toggle */
.tp-toggle-order {
    background: var(--tp-cta-normal);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: background 0.2s ease;
    min-width: 28px;
}

.tp-toggle-order:hover {
    background: var(--tp-cta-hover);
}

/* Filas de tickets */
.tp-ticket-row td {
    padding-left: 24px;
    font-size: 0.875rem;
}

.tp-ticket-row code {
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--tp-cta-hover);
    font-weight: 600;
}

/* Paginación */
.tp-pagination {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    background: #f7f8fc;
    border-radius: 8px;
}

.tp-pagination-btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    background: var(--tp-cta-normal);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease, transform 0.1s ease;
}

.tp-pagination-btn:hover {
    background: var(--tp-cta-hover);
    transform: translateY(-1px);
    color: #ffffff;
}

.tp-pagination-info {
    display: inline-block;
    margin: 0 12px;
    font-size: 0.9rem;
    color: var(--tp-text-muted);
    font-weight: 500;
}

/* Tabla versión usuario (menos columnas) */
.tp-table-user th:first-child,
.tp-table-user td:first-child {
    width: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .tp-table-pro {
        font-size: 0.8rem;
    }

    .tp-table-pro th,
    .tp-table-pro td {
        padding: 8px 10px;
    }

    .tp-order-header-row td {
        font-size: 0.85rem;
    }

    .tp-toggle-order {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    /* En móvil, permitir scroll horizontal si es necesario */
    .tp-tickets-wrapper {
        overflow-x: auto;
    }

    .tp-pagination {
        padding: 12px;
    }

    .tp-pagination-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* -------------------------------------------------
   Estilos heredados de la versión anterior (00)
   para Mis tickets, Ganadores y Página de gracias
   ------------------------------------------------- */

/* Mis tickets (compatibilidad con versión anterior) */
.tp-raffle-my-tickets table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.tp-raffle-my-tickets th,
.tp-raffle-my-tickets td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0e4ec;
}

/* Ganadores */
.tp-raffle-winners ul {
    list-style: disc;
    padding-left: 1.5rem;
}

/* Página de gracias */
.tp-raffle-thankyou ul {
    list-style: disc;
    padding-left: 1.5rem;
}

/* -------------------------------------------------
   NUEVO: Shortcode compacto [tp_countdown_sorteo]
   ------------------------------------------------- */
.tp-sorteo-compact {
    max-width: 1100px;
    margin: 20px auto;
    padding: 20px;
}

.tp-sorteo-compact .tp-sorteo-header h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.tp-sorteo-compact .tp-countdown {
    margin: 20px auto 40px;
}

@media (max-width: 480px) {
    .tp-sorteo-compact {
        padding: 15px;
    }
}