/* WooCommerce Affiliate Rewards - Frontend Styles */

/* Contenedor principal */


:root{
        --accent-l: #38BDF8;
}

/* Tabs de navegación */
.wc-affiliate-rewards-tabs {
  display: flex;
    gap: 4px;
    margin: 20px 0 24px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(56,189,248,.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.wc-affiliate-rewards-tabs .tab {
   flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--t2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    min-width: 0;
}

.wc-affiliate-rewards-tabs .tab:hover {
       background: rgba(255,255,255,.04);
    color: var(--accent-l);
    
}

.wc-affiliate-rewards-tabs .tab.active {
      background: linear-gradient(135deg,rgba(14,165,233,.15),rgba(56,189,248,.08));
    color: var(--accent-l);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(14,165,233,.15);
}

/* Panel de Control (Dashboard) */
.wc-affiliate-dashboard h2 {
    font-size: 24px;
    margin-bottom: 25px;
    color: #333;
}

.wc-affiliate-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wc-affiliate-section.box-blue2{
    border: 1px solid rgba(14, 165, 233, 0.15)
}



.stat-box {
    background: #fff;
    padding: 25px;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-box h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 500;
}

.stat-box .stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #0073aa;
    margin: 0;
}

.stat-box.highlight {
    background: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.3);

}

.stat-box.highlight h3,
.stat-box.highlight .stat-number,
.stat-box.highlight .stat-label {
    color: var(--bs-green);
}

.stat-box .stat-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin: 5px 0 0 0;
}

/* Sección de enlace de afiliado */
.wc-affiliate-referral-link {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.wc-affiliate-referral-link h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.referral-link-box {
    display: flex;
    gap: 10px;
}

.referral-link-box input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.referral-link-box .button {
    padding: 12px 25px;
}

/* Instrucciones */
.wc-affiliate-instructions {
    background: #fff;
    padding: 25px;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    margin-bottom: 30px;
}

.wc-affiliate-instructions h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.wc-affiliate-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.wc-affiliate-instructions li {
    margin-bottom: 12px;
    line-height: 1.6;
}

/* Recompensas disponibles */
.wc-affiliate-available-rewards {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #28a745;
}

.wc-affiliate-available-rewards h3 {
    margin: 0 0 15px 0;
    color: #155724;
}

.wc-affiliate-available-rewards p {
    margin: 0 0 20px 0;
    color: #155724;
}

/* Tab de recompensas */
.wc-affiliate-rewards-tab h2 {
    font-size: 24px;
    margin-bottom: 25px;
    color: #333;
}

.no-rewards-message {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-rewards-message p {
    margin: 0 0 15px 0;
    color: #666;
}

/* Selector de duración */
.rewards-select-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.reward-duration-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.reward-option {
    flex: 1;
    min-width: 200px;
}

.reward-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #fff;
    border: 2px solid #e2e4e7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reward-option label:hover {
    border-color: #0073aa;
}

.reward-option input[type="radio"]:checked + .reward-label {
    color: #0073aa;
}

.reward-option input[type="radio"]:checked ~ label {
    border-color: #0073aa;
    background: #f0f8ff;
}

.reward-label {
    font-size: 16px;
    font-weight: 500;
}

.reward-count {
    font-size: 12px;
    color: #666;
}

/* Grid de productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-item {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-item.selected {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.3);
}

.product-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-item-info {
    padding: 15px;
}

.product-item-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 10px 0;
    color: #333;
}

.product-item-price {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
    margin: 0;
}

/* Área de selección de producto */
.product-selection-area {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.product-selection-area h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

#selected-product-display {
    margin-bottom: 20px;
}

#claim-reward-btn {
    padding: 15px 40px;
    font-size: 16px;
}

/* Tab de historial */
.wc-affiliate-history-tab h2 {
    font-size: 24px;
    margin-bottom: 25px;
    color: #333;
}

.no-history-message {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-history-message p {
    margin: 0 0 15px 0;
    color: #666;
}

/* Tabla de historial */
.wc-affiliate-history-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.wc-affiliate-history-table th,
.wc-affiliate-history-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.wc-affiliate-history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wc-affiliate-history-table tbody tr:hover {
    background: #f8f9fa;
}

.wc-affiliate-history-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mensaje de carga */
.loading-message {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Mensaje de error */
.wc-affiliate-error {
    color: #dc3545;
    padding: 15px;
    background: #f8d7da;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* Notificación toast */
.wc-affiliate-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.wc-affiliate-toast.success {
    background: #28a745;
}

.wc-affiliate-toast.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsivo */
@media (max-width: 600px) {
    .wc-affiliate-rewards-container {
        padding: 15px;
    }

    .wc-affiliate-rewards-tabs {
        flex-wrap: wrap;
    }

    .wc-affiliate-rewards-tabs .tab {
        flex: 1 1 33.33%;
        text-align: center;
        padding: 12px 10px;
        font-size: 14px;
    }

    .referral-link-box {
        flex-direction: column;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .reward-duration-selector {
        flex-direction: column;
    }
}