/**
 * Estilos Frontend - Kivly WooCommerce Plugin
 */

/* Información de puntos - Estilo Flat Moderno */
.kivly-points-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
    border-radius: 12px;
    font-size: 15px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.kivly-points-info:hover {
    background: rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.3);
}

.kivly-points-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    background: #ffffff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kivly-crown-icon {
    width: 20px;
    height: 20px;
    stroke: #000000;
}

.kivly-points-text {
    flex: 1;
    font-weight: 500;
    line-height: 1.5;
}

.kivly-points-text strong {
    font-weight: 700;
    font-size: 20px;
    margin: 0 4px;
    color: #000000;
}

/* Puntos en página de producto */
.kivly-product-points {
    margin: 20px 0;
}

/* Puntos en checkout */
.kivly-checkout-points {
    margin: 16px 0;
}

/* Puntos en listado de productos (más compacto) */
.kivly-loop-points {
    margin: 10px 0 8px 0;
    padding: 10px 14px;
    font-size: 13px;
}

.kivly-loop-points .kivly-points-icon {
    width: 32px;
    height: 32px;
}

.kivly-loop-points .kivly-crown-icon {
    width: 16px;
    height: 16px;
}

.kivly-loop-points .kivly-points-text {
    font-size: 13px;
    font-weight: 500;
}

.kivly-loop-points .kivly-points-text strong {
    font-size: 15px;
    font-weight: 700;
}

/* Sección de canje - Estilo Flat Moderno */
.kivly-redeem-section {
    margin: 24px 0;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kivly-redeem-header {
    margin-bottom: 16px;
}

.kivly-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
}

.kivly-points-badge::before {
    content: "⭐";
    font-size: 18px;
}

.kivly-redeem-btn {
    display: inline-block;
    padding: 14px 28px;
    background: #000000;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.kivly-redeem-btn:hover {
    background: #1a1a1a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    color: #ffffff !important;
}

.kivly-no-points {
    color: #6b7280;
    margin: 12px 0;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.kivly-login-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 12px;
    font-size: 15px;
}

.kivly-login-notice .kivly-points-icon {
    background: #ffffff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kivly-login-notice .kivly-points-icon svg {
    width: 20px;
    height: 20px;
    stroke: #d97706;
}

/* Modal de recompensas */
.kivly-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.kivly-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 32px;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    position: relative;
    border: 1px solid #e5e7eb;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.kivly-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.kivly-modal-close:hover,
.kivly-modal-close:focus {
    color: #000;
}

.kivly-modal-content h3 {
    margin: 0 0 24px 0;
    color: #111827;
    font-size: 24px;
    font-weight: 700;
}

/* Grid de recompensas */
.kivly-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kivly-reward-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kivly-reward-card:hover {
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kivly-reward-card h4 {
    margin: 0 0 12px 0;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
}

.kivly-reward-cost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    margin: 10px 0;
}

.kivly-reward-cost::before {
    content: "⭐";
    font-size: 14px;
}

.kivly-reward-desc {
    color: #6b7280;
    font-size: 14px;
    margin: 10px 0;
    min-height: 40px;
    line-height: 1.5;
}

.kivly-reward-redeem {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    background: #000000;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.kivly-reward-redeem:hover {
    background: #1a1a1a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.kivly-reward-redeem:disabled {
    background: #e5e7eb;
    color: #9ca3af !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* Estados de carga y error */
.kivly-loading,
.kivly-error {
    text-align: center;
    padding: 24px;
    font-size: 15px;
    border-radius: 8px;
}

.kivly-loading {
    color: #000000;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.kivly-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 768px) {
    .kivly-modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }

    .kivly-rewards-grid {
        grid-template-columns: 1fr;
    }

    .kivly-points-info {
        font-size: 14px;
    }

    .kivly-points-text strong {
        font-size: 16px;
    }
}

/* Animaciones adicionales */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.kivly-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
 * ESTILOS PARA SHORTCODES
 * ============================================ */

/* Tarjeta de producto - Shortcode */
.kivly-product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.kivly-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.kivly-card-image {
    position: relative;
    overflow: hidden;
    background: #f9fafb;
}

.kivly-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.kivly-card-image:hover img {
    transform: scale(1.05);
}

.kivly-card-content {
    padding: 20px;
}

.kivly-card-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.kivly-card-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease;
}

.kivly-card-title a:hover {
    color: #000000;
}

.kivly-card-price {
    margin: 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.kivly-card-price del {
    font-size: 18px;
    color: #9ca3af;
    margin-right: 8px;
}

.kivly-card-points {
    margin: 12px 0;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.kivly-card-button {
    margin-top: 16px;
}

.kivly-card-button .button {
    width: 100%;
    display: block;
    text-align: center;
    padding: 14px 20px;
    background: #000000;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.kivly-card-button .button:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Balance de usuario - Shortcode */
.kivly-balance-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
    border-radius: 12px;
    font-size: 15px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.kivly-balance-text {
    flex: 1;
    font-weight: 500;
    line-height: 1.5;
}

.kivly-balance-text strong {
    font-weight: 700;
    font-size: 20px;
    margin: 0 4px;
}

/* Mensaje de login - Shortcode */
.kivly-shortcode-login {
    padding: 16px 20px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 12px;
    font-size: 15px;
    text-align: center;
}

/* Mensaje genérico de ganar puntos */
.kivly-earn-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
    border-radius: 12px;
    font-size: 15px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Carrito vacío */
.kivly-empty-cart {
    padding: 16px 20px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
}

/* Widget completo de balance - Shortcode [kivly_account_balance] */
.kivly-account-balance-widget {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    max-width: 600px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kivly-account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.kivly-greeting h3 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

.kivly-subtitle {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.kivly-balance-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #2271b1;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    font-size: 18px;
}

.kivly-balance-badge svg {
    flex-shrink: 0;
}

.kivly-wallet-buttons {
    margin: 24px 0;
}

.kivly-wallet-text {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.kivly-wallet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.kivly-wallet-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    text-align: left;
}

.kivly-wallet-btn img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.kivly-wallet-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.kivly-redeem-widget {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.kivly-redeem-widget h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.kivly-redeem-info {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.kivly-redeem-checkbox {
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.kivly-redeem-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

.kivly-redeem-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 2px 0 0 0;
    cursor: pointer;
}

.kivly-earn-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(34, 113, 177, 0.1);
    border: 1px solid #2271b1;
    border-radius: 12px;
    margin-top: 20px;
    font-size: 15px;
}

.kivly-earn-widget svg {
    flex-shrink: 0;
}

/* Responsive para shortcodes */
@media (max-width: 768px) {
    .kivly-product-card {
        max-width: 100%;
    }

    .kivly-card-content {
        padding: 16px;
    }

    .kivly-card-title {
        font-size: 16px;
    }

    .kivly-card-price {
        font-size: 20px;
    }

    .kivly-account-balance-widget {
        padding: 16px;
    }

    .kivly-account-header {
        flex-direction: column;
        gap: 16px;
    }

    .kivly-wallet-actions {
        grid-template-columns: 1fr;
    }

    .kivly-greeting h3 {
        font-size: 20px;
    }

    .kivly-balance-badge {
        font-size: 16px;
        padding: 10px 16px;
    }
}

