/* ============================================
   Raffle Stickers Pro - Frontend Styles
   Colores: Principal #c29e53, Secundario #121212
   ============================================ */

:root {
    --rsp-primary: #c29e53;
    --rsp-secondary: #121212;
    --rsp-white: #ffffff;
    --rsp-gray-light: #f5f5f5;
    --rsp-gray: #e0e0e0;
    --rsp-gray-dark: #666666;
    --rsp-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --rsp-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --rsp-radius: 12px;
    --rsp-transition: all 0.3s ease;
}

/* Container Principal */
.raffle-stickers-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.raffle-header {
    text-align: center;
    margin-bottom: 40px;
}

.raffle-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--rsp-secondary);
    margin: 0 0 15px;
}

.raffle-description {
    color: var(--rsp-gray-dark);
    font-size: 16px;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* Barra de Progreso */
.raffle-progress-section {
    background: var(--rsp-white);
    padding: 8px;
    border-radius: var(--rsp-radius);
    box-shadow: var(--rsp-shadow);
    margin-bottom: 40px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 15px;
}

.sold-count {
    color: var(--rsp-primary);
    font-weight: 700;
    font-size: 18px;
}

.total-count {
    color: var(--rsp-gray-dark);
}

.progress-bar-wrapper {
    position: relative;
    width: 100%;
    height: 20px;
    background: var(--rsp-gray-light);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--rsp-gray);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rsp-primary) 0%, #d4b574 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 15px;
    transition: width 0.5s ease;
    min-width: 60px;
}

.progress-percentage {
    color: var(--rsp-white);
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Paquetes de Stickers */
.raffle-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.package-card {
    position: relative;
    background: var(--rsp-white);
    border: 2px solid var(--rsp-gray);
    border-radius: var(--rsp-radius);
    padding: 12px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--rsp-transition);
    box-shadow: var(--rsp-shadow);
    display: flex;
    flex-direction: row;
    align-items: center;
}

.package-card:hover:not(.unavailable) {
    transform: translateY(-5px);
    box-shadow: var(--rsp-shadow-hover);
    border-color: var(--rsp-primary);
}

.package-card.selected {
    border-color: var(--rsp-primary);
    background: linear-gradient(135deg, rgba(194, 158, 83, 0.05) 0%, rgba(194, 158, 83, 0.1) 100%);
    box-shadow: 0 4px 12px rgba(194, 158, 83, 0.3);
}

.package-card.recommended {
    border-color: var(--rsp-primary);
    box-shadow: 0 4px 16px rgba(194, 158, 83, 0.2);
}

.package-card.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--rsp-gray-light);
}

.recommended-badge {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--rsp-primary);
    color: var(--rsp-white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(194, 158, 83, 0.4);
}

.recommended-badge svg {
    width: 14px;
    height: 14px;
}

.package-icon {
    color: var(--rsp-primary);
    /* margin-bottom: 15px; */
}

.package-icon svg {
    filter: drop-shadow(0 2px 4px rgba(194, 158, 83, 0.2));
}

.package-quantity {
    font-size: 36px;
    font-weight: 700;
    color: var(--rsp-secondary);
    margin-bottom: 8px;
    line-height: 1;
}

.package-label {
    color: var(--rsp-gray-dark);
    font-size: 10px;
    font-weight: 500;
}

.unavailable-message {
    margin-top: 10px;
    color: #e53e3e;
    font-size: 12px;
    font-weight: 600;
}

/* Sección de Compra */
.raffle-purchase-section {
    /* background: var(--rsp-white);
    padding: 35px;
    border-radius: var(--rsp-radius);
    box-shadow: var(--rsp-shadow); */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: end;
}

.quantity-selector,
.price-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quantity-selector label,
.price-display label {
    font-size: 14px;
    color: var(--rsp-white);
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--rsp-gray-light);
    padding: 8px;
    border-radius: 8px;
    border: 2px solid var(--rsp-gray);
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--rsp-primary) !important;
    color: var(--rsp-white);
    font-size: 20px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--rsp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover:not(:disabled) {
    background: #d4b574;
    transform: scale(1.05);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--rsp-secondary);
    border: none;
    background: transparent;
    padding: 8px;
}

.total-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--rsp-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-add-to-cart {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--rsp-primary) 0%, #d4b574 100%);
    color: var(--rsp-white);
    border: none;
    padding: 18px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--rsp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(194, 158, 83, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-to-cart:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(194, 158, 83, 0.4);
}

.btn-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--rsp-gray-dark);
}

.btn-add-to-cart svg {
    width: 24px;
    height: 24px;
}

/* Mensajes */
.raffle-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.raffle-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.raffle-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .raffle-stickers-container {
        padding: 0 15px;
        margin: 20px auto;
    }

    .raffle-title {
        font-size: 24px;
    }

    .raffle-packages {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    .raffle-purchase-section {
        grid-template-columns: 1fr;
        padding: 25px;
        gap: 20px;
    }

    .package-quantity {
        font-size: 28px;
    }

    .total-price {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .raffle-packages {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-add-to-cart {
        padding: 15px 30px;
        font-size: 14px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.raffle-stickers-container > * {
    animation: fadeIn 0.5s ease;
}

/* Loading */
.raffle-stickers-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.raffle-stickers-container.loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 4px solid var(--rsp-gray);
    border-top-color: var(--rsp-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
