/* ==========================================================================
   Colombiadolls Rifas - Frontend Styles
   ========================================================================== */

.cd-raffle-container {
    max-width: 900px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    font-family: inherit;
    border: 1px solid #eef0f3;
}

/* Header & Product Presentation */
.cd-raffle-header {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 30px;
    background: linear-gradient(180deg, #fbfbfd 0%, #ffffff 100%);
    border-bottom: 1px solid #edf2f7;
}

.cd-raffle-media {
    flex: 1 1 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cd-raffle-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    object-fit: cover;
    max-height: 320px;
}

.cd-raffle-meta {
    flex: 1 1 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cd-badge-super-balota {
    display: inline-block;
    align-self: flex-start;
    background: linear-gradient(135deg, #7c4dff, #651fff);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0 3px 8px rgba(124, 77, 255, 0.25);
}

.cd-raffle-title {
    font-size: 26px;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 8px;
    line-height: 1.25;
}

.cd-original-price {
    font-size: 14px;
    color: #718096;
    margin-bottom: 15px;
}

.cd-original-price span {
    text-decoration: line-through;
    font-weight: 600;
}

.cd-ticket-price-box {
    background: #f7fafc;
    border: 1px dashed #cbd5e0;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 15px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.cd-price-label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.cd-price-amount {
    font-size: 24px;
    font-weight: 800;
    color: #2b6cb0;
}

.cd-draw-countdown-box {
    margin-bottom: 15px;
    background: #fffaf0;
    border-left: 4px solid #dd6b20;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    color: #744210;
}

.cd-countdown-title {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

/* Barra de Progreso */
.cd-progress-wrapper {
    margin-top: 10px;
}

.cd-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 6px;
}

.cd-progress-bar {
    width: 100%;
    height: 10px;
    background: #edf2f7;
    border-radius: 10px;
    overflow: hidden;
}

.cd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Aviso de Acumulado / Rollover */
.cd-raffle-rollover-alert {
    background: #fffaf0;
    border-left: 5px solid #ed8936;
    padding: 18px 24px;
    margin: 20px 30px 0;
    border-radius: 8px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(237, 137, 54, 0.1);
}

.cd-rollover-icon {
    font-size: 26px;
    line-height: 1;
}

.cd-rollover-text strong {
    font-size: 15px;
    color: #c05621;
    display: block;
    margin-bottom: 4px;
}

.cd-rollover-text p {
    margin: 0;
    font-size: 14px;
    color: #7b341e;
    line-height: 1.5;
}

/* Área interactiva y Cuadrícula de Números */
.cd-raffle-interactive-area {
    padding: 30px;
}

.cd-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.cd-grid-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.cd-legend {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #718096;
}

.cd-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cd-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.cd-dot-available { background: #48bb78; }
.cd-dot-selected  { background: #7c4dff; }
.cd-dot-sold      { background: #cbd5e0; }

/* Grid de Números */
.cd-numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.cd-number-btn {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
}

.cd-number-btn .cd-num-val {
    font-size: 19px;
    font-weight: 800;
    color: #2d3748;
    line-height: 1;
}

.cd-number-btn .cd-num-sub {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 3px;
}

/* Estados de los botones */
.cd-number-btn.cd-status-available {
    border-color: #c6f6d5;
    background: #f0fff4;
    color: #22543d;
}

.cd-number-btn.cd-status-available:hover {
    transform: translateY(-3px);
    border-color: #48bb78;
    background: #e6fffa;
    box-shadow: 0 6px 14px rgba(72, 187, 120, 0.2);
}

.cd-number-btn.is-selected {
    border-color: #7c4dff !important;
    background: linear-gradient(135deg, #7c4dff, #9c27b0) !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(124, 77, 255, 0.35) !important;
}

.cd-number-btn.is-selected .cd-num-val {
    color: #ffffff !important;
}

.cd-number-btn.cd-status-paid,
.cd-number-btn[disabled] {
    background: #edf2f7;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.65;
}

.cd-number-btn.cd-status-paid .cd-num-val {
    color: #a0aec0;
    text-decoration: line-through;
}

.cd-number-btn.cd-status-paid .cd-num-sub {
    color: #e53e3e;
}

.cd-number-btn.cd-status-reserved {
    border-color: #feebc8;
    background: #fffaf0;
    cursor: not-allowed;
    opacity: 0.8;
}

.cd-number-btn.cd-status-reserved .cd-num-val {
    color: #dd6b20;
}

/* Barra Flotante / Inferior de Acción */
.cd-action-bar {
    background: #ffffff;
    border: 2px solid #7c4dff;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    box-shadow: 0 8px 25px rgba(124, 77, 255, 0.15);
    animation: cdFadeIn 0.3s ease;
}

@keyframes cdFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cd-selected-numbers-text {
    font-size: 14px;
    color: #4a5568;
}

.cd-selected-numbers-text strong {
    color: #7c4dff;
}

.cd-total-price {
    font-size: 18px;
    color: #2d3748;
    margin-top: 4px;
}

.cd-total-price strong {
    font-size: 22px;
    color: #27ae60;
    font-weight: 800;
}

.cd-buy-btn {
    background: linear-gradient(135deg, #7c4dff, #ff4081);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 64, 129, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cd-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 64, 129, 0.45);
}

.cd-buy-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.cd-security-guarantee {
    display: flex;
    justify-content: center;
    gap: 25px;
    font-size: 12px;
    color: #718096;
    margin-top: 20px;
    flex-wrap: wrap;
    text-align: center;
}

/* Tarjeta Celebración Ganador */
.cd-raffle-winner-banner {
    padding: 40px 30px;
    text-align: center;
    background: radial-gradient(circle at top, #fffdf0 0%, #ffffff 100%);
}

.cd-winner-badge {
    display: inline-block;
    background: #ffd700;
    color: #7c5200;
    font-weight: 800;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.cd-winner-heading {
    font-size: 28px;
    font-weight: 800;
    color: #2d3748;
    margin: 0 0 25px;
}

.cd-winner-details {
    display: inline-flex;
    align-items: center;
    gap: 25px;
    background: #f7fafc;
    border: 2px dashed #e2e8f0;
    padding: 20px 30px;
    border-radius: 16px;
    text-align: left;
}

.cd-winner-ball {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #ff9800, #f44336);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(244, 67, 54, 0.3);
}

.cd-winner-ball span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cd-winner-ball strong {
    font-size: 28px;
    line-height: 1;
}

.cd-winner-info p {
    margin: 0 0 6px;
    font-size: 16px;
    color: #2d3748;
}

.cd-winner-status {
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
}

/* Shortcode [rifas_activas] Grid */
.cd-raffles-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.cd-raffle-card {
    background: #ffffff;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.cd-raffle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.cd-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #7c4dff;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

.cd-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.cd-card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cd-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #2d3748;
}

.cd-card-price {
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 12px;
}

.cd-card-price strong {
    font-size: 18px;
    color: #2b6cb0;
}

.cd-card-progress {
    margin-bottom: 15px;
}

.cd-card-bar {
    width: 100%;
    height: 6px;
    background: #edf2f7;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px;
}

.cd-card-bar-fill {
    height: 100%;
    background: #48bb78;
}

.cd-card-btn {
    margin-top: auto;
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s ease;
}

.cd-card-btn:hover {
    background: #7c4dff;
    color: #ffffff;
    border-color: #7c4dff;
}

/* Responsive */
@media (max-width: 600px) {
    .cd-raffle-header { padding: 20px; }
    .cd-raffle-interactive-area { padding: 20px; }
    .cd-numbers-grid { grid-template-columns: repeat(4, 1fr); }
    .cd-action-bar { flex-direction: column; text-align: center; }
    .cd-buy-btn { width: 100%; justify-content: center; }
    .cd-winner-details { flex-direction: column; text-align: center; }
}
